RE: NetworkManager Settings and D-Bus
Date: Mon, 25 Jul 2011 16:40:57 -0400 From: Bob Bader li...@dbent.net Subject: RE: NetworkManager Settings and D-Bus If I am providing too many parameters I would think the error would be different than it telling me that there are too few parameters. The error message is: Fewer items found in D-Bus signature [what NM expects] than in Python arguments [that you provided in your script]. So the error message is technically correct. I sympathise though, the wording is a bit confusing. ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: [PATCH 1/2] dtd: enhance APN types, add APN plans
Hello Marcel, On 07/25/2011 04:58 PM, Marcel Holtmann wrote: -!ATTLIST apn type (mms|prepaid|wap) #IMPLIED +!ATTLIST apn type (internet|mms|wap) #IMPLIED +!ATTLIST apn plan (contract|prepaid) #IMPLIED actually I probably slipped some literal translation from German into this one. Maybe it is better to use postpaid vs prepaid. Sure, postpaid might be better here. I will prepare another patch. Regards, Oleg -- Intel Finland Oy Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: No 3G after disconnecting
Marius Kotsbak marius.kots...@gmail.com hat am 26. Juli 2011 um 02:17 geschrieben: Den 25. juli 2011 12:08, skrev wp1191918-hgvs: Hi, I have found the following problem with an Ericsson F5521gw 3G modem: 1. start system 2. bring up 3g connection by clicking on the configureation in nm-applet 3. wait until connection is established and can be used 4. disconnect from 3g connection 5. when trying to bring up the connection again it fails Seems like I found the cause. See my attached patch to the bug report: https://bugzilla.gnome.org/show_bug.cgi?id=650740 -- Marius Hi Marius, looks like with your patch I am no longer able to bring up the 3G connection on any time. I have captured the debug: ** (modem-manager:17857): DEBUG: 1311674406.968858 (ttyACM0) opening serial port... ** (modem-manager:17857): DEBUG: 1311674406.969198 (ttyACM0) device open count is 1 (open) ** (modem-manager:17857): DEBUG: 1311674406.969239 Modem /org/freedesktop/ModemManager/Modems/0: state changed (disabled - enabling) ** (modem-manager:17857): DEBUG: 1311674407.70317 (ttyACM0): -- 'ATZ E0 V1CR' ** (modem-manager:17857): DEBUG: 1311674407.81300 (ttyACM0): -- 'ATZ E0CRLF*EMRDY: 1CRLF V1CR' ** (modem-manager:17857): DEBUG: 1311674407.86296 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.86561 (ttyACM0): -- 'ATE0CR' ** (modem-manager:17857): DEBUG: 1311674407.94383 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.94626 (ttyACM0): -- 'AT+CMEE=1CR' ** (modem-manager:17857): DEBUG: 1311674407.106294 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.106517 (ttyACM0): -- 'ATX4 C1CR' ** (modem-manager:17857): DEBUG: 1311674407.118375 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.118615 (ttyACM0): -- 'AT+CFUN=1CR' ** (modem-manager:17857): DEBUG: 1311674407.146329 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.146502 (ttyACM1) opening serial port... ** (modem-manager:17857): DEBUG: 1311674407.147068 (ttyACM1) device open count is 1 (open) ** (modem-manager:17857): DEBUG: 1311674407.147223 (ttyACM0): -- 'AT+IFC=1,1CR' ** (modem-manager:17857): DEBUG: 1311674407.159581 (ttyACM0): -- 'CRLFERRORCRLF' ** (modem-manager:17857): DEBUG: Got failure code 100: Unknown error ** (modem-manager:17857): DEBUG: 1311674407.159755 (ttyACM1): -- 'CRLF*EMRDY: 1CRLF' ** (modem-manager:17857): DEBUG: 1311674407.159878 (ttyACM0): -- 'AT+CSCS=UTF-8CR' ** (modem-manager:17857): DEBUG: 1311674407.178268 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.178437 (ttyACM0): -- 'AT+CSCS?CR' ** (modem-manager:17857): DEBUG: 1311674407.188459 (ttyACM0): -- 'CRLF+CSCS: ' ** (modem-manager:17857): DEBUG: 1311674407.190277 (ttyACM0): -- 'UTF-8CRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.190535 Modem /org/freedesktop/ModemManager/Modems/0: state changed (enabling - registered) ** (modem-manager:17857): DEBUG: 1311674407.190854 (ttyACM0): -- 'AT+CREG=2CR' ** (modem-manager:17857): DEBUG: 1311674407.206247 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.206411 (ttyACM0): -- 'AT+CSQCR' ** (modem-manager:17857): DEBUG: 1311674407.218377 (ttyACM0): -- 'CRLF+CSQ: 13,99CRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.218877 (ttyACM0): -- 'AT+CREG?CR' ** (modem-manager:17857): DEBUG: 1311674407.234408 (ttyACM0): -- 'CRLF+CREG: 2,1,16CA,007FAFBBCRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: CS registration state changed: 1 ** (modem-manager:17857): DEBUG: 1311674407.234802 (ttyACM0): -- 'AT+CGREG=2CR' ** (modem-manager:17857): DEBUG: 1311674407.250379 (ttyACM0): -- 'CRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.250737 (ttyACM0): -- 'AT+COPS=3,2;+COPS?CR' ** (modem-manager:17857): DEBUG: 1311674407.274307 (ttyACM0): -- 'CRLF+COPS: 0,2,26201,2 CRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.274675 (ttyACM0): -- 'AT+COPS=3,0;+COPS?CR' ** (modem-manager:17857): DEBUG: 1311674407.306407 (ttyACM0): -- 'CRLF+COPS: 0,0,T-Mobile D,2 CRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.306900 (ttyACM0): -- 'AT+CSQCR' ** (modem-manager:17857): DEBUG: 1311674407.318306 (ttyACM0): -- 'CRLF+CSQ: 13,99CRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674407.318512 (ttyACM0): -- 'AT+CGREG?CR' ** (modem-manager:17857): DEBUG: 1311674407.330332 (ttyACM0): -- 'CRLF+CGREG: 2,1,16CA,007FAFBB,2CRLFCRLFOKCRLF' ** (modem-manager:17857): DEBUG: 1311674419.304153 (ttyACM0): network_mode = 0 ** (modem-manager:17857): DEBUG: 1311674419.304153 (ttyACM0): username = xxx ** (modem-manager:17857): DEBUG: 1311674419.304153 (ttyACM0): number = *99# ** (modem-manager:17857): DEBUG: 1311674419.304153 (ttyACM0): apn = my-apn.tda.t-d1.de ** (modem-manager:17857): DEBUG: 1311674419.304153 (ttyACM0): allowed_mode = 0 ** (modem-manager:17857): DEBUG: 1311674419.304153 (ttyACM0): password = yyy ** (modem-manager:17857): DEBUG: 1311674419.304424 (ttyACM0): simple
Re: No 3G after disconnecting
Den 26. juli 2011 12:17, skrev wp1191918-hgvs: Marius Kotsbakmarius.kots...@gmail.com hat am 26. Juli 2011 um 02:17 geschrieben: Den 25. juli 2011 12:08, skrev wp1191918-hgvs: Hi, I have found the following problem with an Ericsson F5521gw 3G modem: 1. start system 2. bring up 3g connection by clicking on the configureation in nm-applet 3. wait until connection is established and can be used 4. disconnect from 3g connection 5. when trying to bring up the connection again it fails Seems like I found the cause. See my attached patch to the bug report: https://bugzilla.gnome.org/show_bug.cgi?id=650740 -- Marius Hi Marius, looks like with your patch I am no longer able to bring up the 3G connection on any time. Strange. I would recommend turning off and on the modem again (if you have a button for that, else turn off and on the laptop). Also make sure there is only one modem-manager running. Anyway, looking at the log it seems like the mbm module is not used at all (so I can't see that my patch made any difference). It uses general ACM PPP dial, not the usb0 ethernet connection. Make sure you have the cdc_ncm module. You also need the following patch (included in modemmanager =0.4.996, but it is just a text file change needed): http://cgit.freedesktop.org/ModemManager/ModemManager/commit/?id=0b757465ffe6108066d32312ab4e895c372c8f72 See also https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/792301 -- Marius ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
[PATCH 0/4] APN type and plan extensions for automatic provisioning
Hello, Please find patches that extend the mobile-broadband-provider-info database with the plan tag specifier (prepaid or postpaid). APN type is extended with the internet. The provider info database is modified accordingly. Regards, Oleg Oleg Zhurakivskyy (4): dtd: enhance APN types, add APN plans all: re-tag APNs according to the new dtd 1/3 all: re-tag APNs according to the new dtd 2/3 all: re-tag APNs according to the new dtd 3/3 serviceproviders.2.dtd |3 +- serviceproviders.xml | 1456 2 files changed, 730 insertions(+), 729 deletions(-) ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
[PATCH 4/4] all: re-tag APNs according to the new dtd 3/3
--- serviceproviders.xml | 452 +- 1 files changed, 226 insertions(+), 226 deletions(-) diff --git a/serviceproviders.xml b/serviceproviders.xml index 839c1f2..0e9bdf1 100644 --- a/serviceproviders.xml +++ b/serviceproviders.xml @@ -5043,53 +5043,53 @@ conceived. nameNetworkNorway/name gsm network-id mcc=242 mnc=05/ - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameOneCall/name gsm network-id mcc=242 mnc=05/ - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameLebara/name gsm - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameAltibox/name gsm - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameSheTalks/name gsm - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameTelipol/name gsm network-id mcc=242 mnc=05/ - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameVentelo/name gsm network-id mcc=242 mnc=07/ - apn value=internet.ventelo.no/ + apn value=internet.ventelo.no type=internet plan=postpaid/ /gsm /provider provider nameLudo Mobil/name gsm network-id mcc=242 mnc=07/ - apn value=internet.ventelo.no/ + apn value=internet.ventelo.no type=internet plan=postpaid/ /gsm /provider provider @@ -5101,11 +5101,11 @@ conceived. ussd*111#/ussd dtmf4730/dtmf /balance-check - apn value=internet.tele2.no + apn value=internet.tele2.no type=internet plan=postpaid nameMobilt internet/name /apn !-- http://www.tele2.no/mobilt-bredbaand.html -- - apn value=mobileinternet.tele2.no + apn value=mobileinternet.tele2.no type=internet plan=postpaid nameMobilt bredbånd/name /apn /gsm @@ -5118,14 +5118,14 @@ conceived. nameNepal Telecom/name gsm network-id mcc=429 mnc=01/ - apn value=ntnet/ + apn value=ntnet type=internet plan=postpaid/ /gsm /provider provider nameMero Mobile/name gsm network-id mcc=429 mnc=02/ - apn value=mero/ + apn value=mero type=internet plan=postpaid/ /gsm /provider /country @@ -5137,16 +5137,16 @@ conceived. gsm network-id mcc=530 mnc=00/ network-id mcc=530 mnc=05/ - apn value=wap.telecom.co.nz type=wap + apn value=wap.telecom.co.nz type=wap plan=postpaid nameXT mobile (WAP)/name /apn - apn value=internet.telecom.co.nz + apn value=internet.telecom.co.nz type=internet plan=postpaid nameXT mobile (Internet with Firewall)/name /apn - apn value=direct.telecom.co.nz + apn value=direct.telecom.co.nz type=internet plan=postpaid nameXT mobile (Direct Internet)/name /apn - apn value=oa.telecom.co.nz + apn value=oa.telecom.co.nz type=internet plan=postpaid nameXT mobile (One Office/Remote Office)/name /apn /gsm @@ -5155,15 +5155,15 @@ conceived. nameVodafone/name gsm network-id mcc=530 mnc=01/ -
[PATCH 3/4] all: re-tag APNs according to the new dtd 2/3
--- serviceproviders.xml | 460 +- 1 files changed, 230 insertions(+), 230 deletions(-) diff --git a/serviceproviders.xml b/serviceproviders.xml index 019e7f4..839c1f2 100644 --- a/serviceproviders.xml +++ b/serviceproviders.xml @@ -2638,21 +2638,21 @@ conceived. balance-check dtmf453/dtmf /balance-check - apn value=orangeinternet + apn value=orangeinternet type=internet plan=postpaid nameContract/name usernameorange/username passwordorange/password dns193.35.133.10/dns dns193.35.134.10/dns /apn - apn value=internetvpn + apn value=internetvpn type=internet plan=postpaid nameContract (with VPN)/name usernameorange/username passwordorange/password dns193.35.133.10/dns dns193.35.134.10/dns /apn - apn value=orangewap type=wap + apn value=orangewap type=wap plan=postpaid nameOrange WAP/name usernameorange/username passwordmultimedia/password @@ -2669,7 +2669,7 @@ conceived. nameGeocell/name gsm network-id mcc=282 mnc=01/ - apn value=Internet + apn value=Internet type=internet plan=postpaid dns212.72.130.20/dns dns212.72.152.001/dns /apn @@ -2683,10 +2683,10 @@ conceived. nameSure (Cable amp; Wireless)/name gsm network-id mcc=234 mnc=55/ - apn value=wap type=wap + apn value=wap type=wap plan=postpaid nameWAP/name /apn - apn value=internet + apn value=internet type=internet plan=postpaid nameInternet/name /apn /gsm @@ -2699,21 +2699,21 @@ conceived. nameMTN/name gsm network-id mcc=620 mnc=01/ - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameVodafone (ONEtouch)/name gsm network-id mcc=620 mnc=02/ - apn value=browse/ + apn value=browse type=internet plan=postpaid/ /gsm /provider provider nameTigo/name gsm network-id mcc=620 mnc=03/ - apn value=web.tigo.com.gh + apn value=web.tigo.com.gh type=internet plan=postpaid usernameweb/username /apn /gsm @@ -2722,7 +2722,7 @@ conceived. nameZain/name gsm network-id mcc=620 mnc=06/ - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider @@ -2737,17 +2737,17 @@ conceived. nameCosmote/name gsm network-id mcc=202 mnc=01/ - apn value=internet/ + apn value=internet type=internet plan=postpaid/ /gsm /provider provider nameVodafone/name gsm network-id mcc=202 mnc=05/ - apn value=internet + apn value=internet type=internet plan=postpaid nameContract/name /apn - apn value=web.session + apn value=web.session type=internet plan=postpaid nameMobile Broadband On Demand/name /apn /gsm @@ -2757,7 +2757,7 @@ conceived. gsm network-id mcc=202 mnc=09/ network-id mcc=202 mnc=10/ - apn value=gint.b-online.gr + apn value=gint.b-online.gr type=internet plan=postpaid usernameweb/username passwordweb/password
Re: [PATCH 1/4] dtd: enhance APN types, add APN plans
Den 26. juli 2011 13:37, skrev Oleg Zhurakivskyy: --- serviceproviders.2.dtd |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/serviceproviders.2.dtd b/serviceproviders.2.dtd index a0c5a31..931929b 100644 --- a/serviceproviders.2.dtd +++ b/serviceproviders.2.dtd @@ -18,7 +18,8 @@ password?, dns*) !ATTLIST apn value CDATA #REQUIRED -!ATTLIST apn type (mms|prepaid|wap) #IMPLIED +!ATTLIST apn type (internet|mms|wap) #IMPLIED +!ATTLIST apn plan (prepaid|postpaid) #IMPLIED What if an APN is used for both post- and prepaid (which all I have encountered have been)? Is the idea then to tag them as postpaid? -- Marius ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: [PATCH 2/4] all: re-tag APNs according to the new dtd 1/3
Den 26. juli 2011 13:37, skrev Oleg Zhurakivtskyy: --- serviceproviders.xml | 544 +- 1 files changed, 272 insertions(+), 272 deletions(-) @@ -202,7 +202,7 @@ conceived. gsm network-id mcc=722 mnc=010/ network-id mcc=722 mnc=070/ - apn value=internet.gprs.unifon.com.ar + apn value=internet.gprs.unifon.com.ar type=internet plan=postpaid usernamewap/username passwordwap/password /apn Probably wap. dtmf125/dtmf ussd-response*100#/ussd-response /balance-check - apn value=telstra.wap + apn value=telstra.wap type=internet plan=postpaid dns139.130.4.4/dns dns203.50.2.71/dns Probably wap. gsm network-id mcc=206 mnc=10/ - apn value=telenetwap.be + apn value=telenetwap.be type=internet plan=postpaid nameWalkamp; Talk/name /apn Probably wap. - apn value=telenetwap.be + apn value=telenetwap.be type=internet plan=postpaid nameWalkamp; Surf/name /apn Probably wap. nameBatelco/name gsm network-id mcc=426 mnc=01/ - apn value=internet.batelco.com + apn value=internet.batelco.com type=internet plan=postpaid nameoNet/name usernamewap/username passwordwap/password Probably wap. @@ -837,7 +837,7 @@ conceived. provider nameVelox/name gsm - apn value=wap.telcel.com + apn value=wap.telcel.com type=internet plan=postpaid usernameiesgprs/username passwordiesgprs2002/password dns66.36.250.14/dns Probably wap. @@ -852,7 +852,7 @@ conceived. network-id mcc=724 mnc=11/ network-id mcc=724 mnc=23/ - apn value=zap.vivo.com.br + apn value=zap.vivo.com.br type=internet plan=postpaid usernamevivo/username passwordvivo/password /apn @@ -877,14 +877,14 @@ conceived. nameB-Mobile/name gsm network-id mcc=528 mnc=02/ - apn value=bmobilewap/ + apn value=bmobilewap type=internet plan=postpaid/ /gsm Probably wap. /provider provider nameDSTCOM/name gsm network-id mcc=528 mnc=11/ - apn value=dst.wap + apn value=dst.wap type=internet plan=postpaid usernamewap/username passwordwap/password /apn Probably wap.@@ -1008,7 +1008,7 @@ conceived. nameRogers/name gsm network-id mcc=302 mnc=720/ - apn value=internet.com + apn value=internet.com type=internet plan=postpaid usernamewapuser1/username passwordwap/password dns207.181.101.4/dns Probably wap. @@ -1124,10 +1124,10 @@ conceived. nameMobilicity/name gsm network-id mcc=302 mnc=320/ - apn value=wap.davewireless.com + apn value=wap.davewireless.com type=internet plan=postpaid nameMobile Web/name /apn Probably wap. - apn value=bam.entelpcs.cl + apn value=bam.entelpcs.cl type=internet plan=postpaid nameWAP/name usernameentelpcs/username passwordentelpcs/password Probably wap. nameMTN/name gsm network-id mcc=280 mnc=10/ - apn value=internet + apn value=internet type=internet plan=postpaid usernamewap/username passwordwap/password /apn Probably wap, not internet. -
Re: [PATCH 4/4] all: re-tag APNs according to the new dtd 3/3
Den 26. juli 2011 13:37, skrev Oleg Zhurakivskyy: --- serviceproviders.xml | 452 +- 1 files changed, 226 insertions(+), 226 deletions(-) diff --git a/serviceproviders.xml b/serviceproviders.xml index 839c1f2..0e9bdf1 100644 --- a/serviceproviders.xml +++ b/serviceproviders.xml @@ -5043,53 +5043,53 @@ conceived. @@ -5101,11 +5101,11 @@ conceived. ussd*111#/ussd dtmf4730/dtmf /balance-check - apn value=internet.tele2.no + apn value=internet.tele2.no type=internet plan=postpaid nameMobilt internet/name /apn This does not work with PC modems, so it should be tagged as wap. !-- http://www.tele2.no/mobilt-bredbaand.html -- - apn value=mobileinternet.tele2.no + apn value=mobileinternet.tele2.no type=internet plan=postpaid nameMobilt bredbånd/name /apn This is used for PC modems. -- Marius ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: [PATCH 1/4] dtd: enhance APN types, add APN plans
Hello Marius, On 07/26/2011 02:40 PM, Marius Kotsbak wrote: What if an APN is used for both post- and prepaid (which all I have encountered have been)? Is the idea then to tag them as postpaid? One alternative would be to further enhance the database format in order to permit multiple plans for the APN or just to list such APNs twice. Which one is more sensible? Regards, Oleg -- Intel Finland Oy Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: [PATCH 1/4] dtd: enhance APN types, add APN plans
Den 26. juli 2011 14:19, skrev Oleg Zhurakivskyy: Hello Marius, On 07/26/2011 02:40 PM, Marius Kotsbak wrote: What if an APN is used for both post- and prepaid (which all I have encountered have been)? Is the idea then to tag them as postpaid? One alternative would be to further enhance the database format in order to permit multiple plans for the APN Japp. or just to list such APNs twice. Which one is more sensible? No, that will be ugly, as I guess that very many of the APNs are used for both. At least here in Norway, it is the SIM card or subscription that gives if it is pre- or postpaid, not the APN. -- Marius ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
[PATCH 0/4] Network Zones support
On 06/30/2011 11:11 PM, Dan Williams wrote: On Tue, 2011-06-28 at 19:03 +0200, Thomas Woerner wrote: Hello Dan, we were talking some time ago about classification of network connections according to their trust level in network zones. Jiri Popelka and I want to work on network zone support and also on making firewalld the default firewall solution for Fedora 16. For network zone support, we had a first look at NetworkManager to have an idea where and how it could be added. NetworkManager is managing the connections and interfaces and therefore the best place to manage the zones also in my opinion. I think an extention of the D-BUS interface is needed to provide information about the connections, the corresponding interfaces and zones, also the list of zones and the connections bound to a zone. Additionally the cli and also the UIs need some work. The way I was looking at it, the zone would simply be a freeform case-insensitive string (possibly alphanumeric characters only) in the NM configuration (and also thus in the ifcfg files). NM wouldn't care about the zones specifically, but would pass that through to whatever listens to these signals. We could define some standard zone names like Home, Work, Public, etc, and we could make the UI only show/accept those zone names. Whatever the firewall did with that information would be up to the firewall; NM would simply store the information and emit it on network events. Before a connection is established a message should be sent out that the connection C with interface I will be placed into zone Z. Firewalld would react and add the interface I to the zone Z in the firewall configuration. When the C was disconnected a new message needs to be sent out to inform firewalld to remove interface I from zone Z. Right; we can add a new D-Bus interface called org.freedesktop.NetworkManager.Zones or something like that which would namespace these signals. That's easy enough to do. We already call the dispatcher scripts at the same places so this is pretty easy to add. So this would be a few small parts: 1) Add a new 'zone' property to the NMSettingConnection object in libnm-util/nm-setting.c as type G_TYPE_STRING 2) Add a the new interface XML in introspection/ 3) Add a new GInterface skeleton in src/ that NMPolicy can implement, which just defines the glib signals that would be emitted 4) Convert NMPolicy into a real GObject, which should be pretty trivial since it's almost one already 5) Have NMPolicy implement the new GInterface 6) Decide whether we can just use the NMDevice object state and property notifications of ip-interface to emit the signal from NMPolicy, or whether we should create a new signal on the NMDevice object which gets emitted at the right time, which NMPolicy then listens for and re-emits on the new D-Bus interface after doing any munging that might be required (each device has an 'interface' and 'ip-interface' property; the 'interface' property isn't always an IP-capable kernel network interface but is a kernel device. So for 3G modems the 'interface' property would be eg 'ttyUSB0' and when PPP is finally brought up the 'ip-interface' property would change to 'ppp0' which could be used with firewall rules) For #6, when should the signal be emitted? When NM *starts* to configure the device even before IP addresses are acquired and assigned? Ethernet static IP configuration is quite fast, so there could be a race condition here if the firewall isn't fast enough applying the policy. Do we care about that? Hi, I've started implementing the network zones feature [1] according to instructions in Dan's mail. I'm a glibGObjectDBus newbie, so it took me some time and I'll be very grateful if somebody could have a look at my patches. Jirka Klimes saw them some time ago and I'd like to thank him for his notes. It's only a stub so far but it would be great if you could look at it to tell me if I'm on a good way or totally wrong so I have something to build on. So far the ConnectionAdded(iface_name, zone_name) signal from NMPolicy on org.freedesktop.NetworkManager.Zones D-BUS interface is emitted when NMDevice has been activated (or when it's ip-interface property has been changed). Also the ConnectionRemoved signal is sent when the NMDevice has been disconnected. [1] https://fedoraproject.org/wiki/Features/network-zones PS: I'm leaving for holiday tomorrow and will show up in 2 weeks. Jiri Popelka (4): New 'zone' property of the NMSettingConnection. New Zones interface Convert NMPolicy into a real GObject. Have NMPolicy implement the new NMZonesInterface. include/NetworkManager.h |3 + introspection/Makefile.am |3 +- introspection/all.xml |1 + introspection/nm-zones.xml | 42 +++ libnm-glib/Makefile.am |6 +- libnm-util/libnm-util.ver |1 +
[PATCH 4/4] Have NMPolicy implement the new NMZonesInterface.
--- include/NetworkManager.h |3 + src/nm-policy.c | 126 ++ 2 files changed, 119 insertions(+), 10 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 17c3a11..dc403a4 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -62,6 +62,9 @@ #define NM_DBUS_INTERFACE_SECRET_AGENTNM_DBUS_INTERFACE .SecretAgent #define NM_DBUS_PATH_SECRET_AGENT /org/freedesktop/NetworkManager/SecretAgent +#define NM_DBUS_INTERFACE_ZONES NM_DBUS_INTERFACE .Zones +#define NM_DBUS_PATH_ZONESNM_DBUS_PATH /Zones + /** * NMState: * @NM_STATE_UNKNOWN: networking state is unknown diff --git a/src/nm-policy.c b/src/nm-policy.c index f84306a..5451418 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -47,6 +47,7 @@ #include nm-vpn-manager.h #include nm-policy-hostname.h #include nm-manager-auth.h +#include nm-zones-interface.h typedef struct { gboolean disposed; @@ -74,8 +75,11 @@ typedef struct { char *cur_hostname; /* hostname we want to assign */ } NMPolicyPrivate; +static void zones_interface_init (NMZonesInterface *zones_interface_class); -G_DEFINE_TYPE (NMPolicy, nm_policy, G_TYPE_OBJECT) +G_DEFINE_TYPE_EXTENDED (NMPolicy, nm_policy, G_TYPE_OBJECT, 0, + G_IMPLEMENT_INTERFACE (NM_TYPE_ZONES_INTERFACE, + zones_interface_init)) #define NM_POLICY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_POLICY, NMPolicyPrivate)) @@ -968,6 +972,72 @@ get_device_connection (NMDevice *device) } static void +device_signal_zone (NMPolicy *self, + NMDevice *device, + NMConnection *connection, + NMDeviceState new_state) +{ + NMSettingConnection *setting_connection = nm_connection_get_setting_connection (connection); + const char * zone_name = nm_setting_connection_get_zone (setting_connection); + const char * ip_iface = nm_device_get_ip_iface (device); + + if (!ip_iface || !zone_name) { + nm_log_warn (LOGD_CORE, couldn't determine IP interface (%p) or Zone (%p)!, +ip_iface, setting_connection, zone_name); + return; + } + + if (new_state == NM_DEVICE_STATE_ACTIVATED) { + g_signal_emit_by_name(self, + NM_ZONES_INTERFACE_CONNECTION_ADDED, ip_iface, zone_name); + + nm_log_dbg (LOGD_DEVICE, (%s): added to zone '%s', + ip_iface, + zone_name); + } else if (new_state == NM_DEVICE_STATE_DISCONNECTED) { + g_signal_emit_by_name(self, + NM_ZONES_INTERFACE_CONNECTION_REMOVED, ip_iface, zone_name); + + nm_log_dbg (LOGD_DEVICE, (%s): removed from zone '%s', + ip_iface, + zone_name); + } +} + +static void +device_ip_iface_changed (NMDevice *device, + GParamSpec *pspec, + gpointer user_data) +{ + NMConnection *connection = get_device_connection (device); + NMSettingConnection *setting_connection = nm_connection_get_setting_connection (connection); + const char * zone_name = nm_setting_connection_get_zone (setting_connection); + const char * ip_iface = nm_device_get_ip_iface (device); + + if (!ip_iface || !zone_name) { + nm_log_warn (LOGD_CORE, couldn't determine IP interface (%p) or Zone (%p)!, +ip_iface, setting_connection, zone_name); + return; + } + + g_signal_emit_by_name(self, + NM_ZONES_INTERFACE_CONNECTION_ADDED, ip_iface, zone_name); + + nm_log_dbg (LOGD_DEVICE, (%s): added to zone '%s', + ip_iface, + zone_name); + +} + +static void +device_ip_config_changed (NMDevice *device, + GParamSpec *pspec, + gpointer user_data) +{ + update_routing_and_dns ((NMPolicy *) user_data, TRUE); +} + +static void device_state_changed (NMDevice *device, NMDeviceState new_state, NMDeviceState old_state, @@ -1028,6 +1098,8 @@ device_state_changed (NMDevice *device, * settings service when the next connection is made. */ nm_connection_clear_secrets (connection); + + device_signal_zone (self, device, connection, new_state); } update_routing_and_dns (self, FALSE); @@ -1045,6 +1117,8 @@ device_state_changed (NMDevice *device, /* Device is now available for
[PATCH 3/4] Convert NMPolicy into a real GObject.
--- src/main.c |2 +- src/nm-policy.c | 389 --- src/nm-policy.h | 21 +++- 3 files changed, 246 insertions(+), 166 deletions(-) diff --git a/src/main.c b/src/main.c index 328c253..109b352 100644 --- a/src/main.c +++ b/src/main.c @@ -778,7 +778,7 @@ main (int argc, char *argv[]) done: if (policy) - nm_policy_destroy (policy); + g_object_unref (policy); if (manager) g_object_unref (manager); diff --git a/src/nm-policy.c b/src/nm-policy.c index 20729fd..f84306a 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -48,7 +48,8 @@ #include nm-policy-hostname.h #include nm-manager-auth.h -struct NMPolicy { +typedef struct { + gboolean disposed; NMManager *manager; guint update_state_id; GSList *pending_activation_checks; @@ -71,7 +72,12 @@ struct NMPolicy { char *orig_hostname; /* hostname at NM start time */ char *cur_hostname; /* hostname we want to assign */ -}; +} NMPolicyPrivate; + + +G_DEFINE_TYPE (NMPolicy, nm_policy, G_TYPE_OBJECT) + +#define NM_POLICY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_POLICY, NMPolicyPrivate)) #define RETRIES_TAG autoconnect-retries #define RETRIES_DEFAULT4 @@ -227,23 +233,25 @@ get_best_ip6_device (NMManager *manager, NMActRequest **out_req) } static void -_set_hostname (NMPolicy *policy, +_set_hostname (NMPolicy *self, gboolean change_hostname, const char *new_hostname, const char *msg) { + NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self); + if (change_hostname) { NMDnsManager *dns_mgr; - g_free (policy-cur_hostname); - policy-cur_hostname = g_strdup (new_hostname); + g_free (priv-cur_hostname); + priv-cur_hostname = g_strdup (new_hostname); dns_mgr = nm_dns_manager_get (NULL); - nm_dns_manager_set_hostname (dns_mgr, policy-cur_hostname); + nm_dns_manager_set_hostname (dns_mgr, priv-cur_hostname); g_object_unref (dns_mgr); } - if (nm_policy_set_system_hostname (policy-cur_hostname, msg)) + if (nm_policy_set_system_hostname (priv-cur_hostname, msg)) nm_utils_call_dispatcher (hostname, NULL, NULL, NULL, NULL, NULL); } @@ -253,36 +261,38 @@ lookup_callback (HostnameThread *thread, const char *hostname, gpointer user_data) { - NMPolicy *policy = (NMPolicy *) user_data; + NMPolicy *self = (NMPolicy *) user_data; + NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self); char *msg; /* Update the hostname if the calling lookup thread is the in-progress one */ - if (!hostname_thread_is_dead (thread) (thread == policy-lookup)) { - policy-lookup = NULL; + if (!hostname_thread_is_dead (thread) (thread == priv-lookup)) { + priv-lookup = NULL; if (!hostname) { /* Fall back to localhost.localdomain */ msg = g_strdup_printf (address lookup failed: %d, result); - _set_hostname (policy, TRUE, NULL, msg); + _set_hostname (self, TRUE, NULL, msg); g_free (msg); } else - _set_hostname (policy, TRUE, hostname, from address lookup); + _set_hostname (self, TRUE, hostname, from address lookup); } hostname_thread_free (thread); } static void -update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) +update_system_hostname (NMPolicy *self, NMDevice *best4, NMDevice *best6) { + NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (self); char *configured_hostname = NULL; NMActRequest *best_req4 = NULL; NMActRequest *best_req6 = NULL; const char *dhcp_hostname, *p; - g_return_if_fail (policy != NULL); + g_return_if_fail (self != NULL); - if (policy-lookup) { - hostname_thread_kill (policy-lookup); - policy-lookup = NULL; + if (priv-lookup) { + hostname_thread_kill (priv-lookup); + priv-lookup = NULL; } /* Hostname precedence order: @@ -295,24 +305,24 @@ update_system_hostname (NMPolicy *policy, NMDevice *best4, NMDevice *best6) */ /* Try a persistent hostname first */ - g_object_get (G_OBJECT (policy-manager), NM_MANAGER_HOSTNAME, configured_hostname, NULL); + g_object_get (G_OBJECT (priv-manager), NM_MANAGER_HOSTNAME, configured_hostname, NULL); if (configured_hostname) { - _set_hostname (policy, TRUE, configured_hostname, from system configuration); + _set_hostname (self, TRUE, configured_hostname, from
Re: [PATCH 2/4] all: re-tag APNs according to the new dtd 1/3
Hello Marius, On 07/26/2011 03:08 PM, Marius Kotsbak wrote: Probably wap. Thanks for the input! In some cases the APN type might be internet although the word wap is present in the name. Because of this, only APNs which were clearly marked as wap in the database before, were marked so in this patch. As a first step, I suggest to agree and to fix the format of the database and remark all the APNs without any changes according to the new DTD. After that, separate APNs can be updated, case by case. Does this sound OK? Regards, Oleg -- Intel Finland Oy Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: [PATCH 2/4] all: re-tag APNs according to the new dtd 1/3
Den 26. juli 2011 16:32, skrev Oleg Zhurakivskyy: Hello Marius, On 07/26/2011 03:08 PM, Marius Kotsbak wrote: Probably wap. Thanks for the input! In some cases the APN type might be internet although the word wap is present in the name. Because of this, only APNs which were clearly marked as wap in the database before, were marked so in this patch. It might be. But please correct the Norwegian and Danish ones I commented. -- Marius ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list