Re: Fwd: Stop this APN madness!

2008-09-12 Thread Antti Kaijanmäki
to, 2008-08-28 kello 21:49 +0100, Stuart Ward kirjoitti:
> 
> We could be realy clever in the configuration screen and query the
> current operator, look up the APN for that oprtator. The only problem
> with this is that the operator names are sometimes come out as MCC/MNC
> numbers rather than the marketing name, but I can supply a list of all
> the MCC/MNC numbers to network names. This is all in a GSMA database.
> 
> -- Stuart Ward M +44 7782325143


Hi!

I've been really busy in these couple or so weeks and I haven't had time
to look into this and probably don't have much time in the following
weeks either, but let's keep up the conversation! I'm sure we can get
somewhere :)

Isaac from Wader[0] project contacted me and they might be willing to
use[1] m-b-p-i if those MCC/MNC[2] codes are added to database
format[3]. It only requires a new netid element for provider element and
everyone would be happy, no? So wouldn't it make sense to include these
codes in mobile-broadband-provider-info?

Stuart, can the IDs you provide be licensed under Creative Commons
Public Domain?

-- Antti

[0]http://public.warp.es/wader
[1]http://public.warp.es/wader/browser/trunk/resources/extra/networks.py
[2]http://en.wikipedia.org/wiki/Mobile_Network_Code
[3]http://live.gnome.org/NetworkManager/MobileBroadband/ServiceProviders

PS.
I added Pablo Martí from Wader project to CC as the link to their -devel
mailing list didn't work.





signature.asc
Description: Digitaalisesti allekirjoitettu viestin osa
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Static and dynamic wired interface

2008-09-12 Thread Robert Smits
On September 10, 2008 12:03:19 pm Dan Williams wrote:
> On Wed, 2008-09-10 at 08:44 -0700, Robert Smits wrote:
> > On September 10, 2008 06:23:12 am Dan Williams wrote:
> > > On Wed, 2008-09-10 at 12:01 +0300, Kristian Slavov wrote:
> > > > Hi,
> > > >
> > > > Is NM capable of handling the following scenario?
> > > > A laptop, when located at office, has a static address. Once outside,
> > > > DHCP is used to get an address.
> > >
> > > NM 0.7 is, but since you're mixing the two there will be some manual
> > > operation on your side since there's not a good generic way to
> > > autodetect what network you're on when you plug in the cable.
> > >
> > > You'll create two wired connections in the connection editor.  One is a
> > > DHCP connection with 'autoconnect=true', and the second is the static
> > > connection with 'autoconnect=false'.  Manual intervention will be
> > > required when you want to use the static connection at the office.
> > >
> > > What should happen is this:
> > >
> > > 1) When you're outside the office, the DHCP connection will
> > > automatically be used because it's 'autoconnect=true'.  If there isn't
> > > a DHCP server present, NM will fail the connection and wait for you to
> > > do something, or for a link change event.
> > >
> > > 2) At the office, NM would try DHCP first and then fail the connection
> > > after the DHCP timeout because of course there's no DHCP server.  At
> > > any point here you then choose the static connection from the applet
> > > menu, and NM will activate the static connection at your command.
> > >
> > > People have tossed around ideas like ARPing a known gateway's IP
> > > address and matching the ARP response to a known MAC address and then
> > > activating that connection, but that's pretty fragile and trivial to
> > > maliciously spoof.
> >
> > This way of doing things seems like a kluge. Why can't network-manager
> > just work with scpm which already does all of this, including nfs
> > networks?
>
> First, because scpm doesn't seem to be widely used.  You're actually the
> first person I've ever heard mention it, and when you did mention it, I
> had to go off and look it up.  Network profile mechanisms aren't new,
> but not that many people use them any more because for the most part
> stuff just works.  That's not to say that they aren't useful for some
> situations, like yours.

SCPM has been around for eons. Unlike network manager it actually does look 
after switching my nfs network settings between home, job, and an internet 
cafe. I wish it did just work. 

> Second, profiles make for a pretty sucky experience, and are only really
> necessary for connections which you can't autodetect, like wired ones.
> I'd seriously hate to have to select a profile every time I moved to a
> new location, but of course most of those locations don't require the
> use of a wired network.  Again, profiles as such limit usability for
> anyone who doesn't use wired networks.  Connections like wireless,
> mobile broadband, bluetooth, etc can all be autodetected quite well and
> thus don't need profiles as such.

Sucky? What's sucks is not automatically switching my nfs network when I 
change connections. SCPM is actually VERY easy to use and not sucky at all. 
All I need to do is hit F3 during the boot process and select which profile I 
want. After that it selects all my settings, including the nfs network and it 
all just runs. I'd be perfectly happy to use it with knetwork manager.

> Third, you could certainly create some scpm scripts to flip the
> 'autoconnect' property of the two connections you'd care about.  Thus,
> in conjunction with your current usage of scpm, NM would certainly give
> you a click-free (aside from choosing your profile with scpm which
> you're already doing) method of selecting your location.
>
> In short, I think you could make this work with scpm just fine, as long
> as you can use it to either modify ifcfg files in /etc (for system
> connections) or after you log in (for user connections).  Should be
> pretty trivial to set up.
>
> If the right connection is chosen, NM can already facilitate most of the
> profile stuff you're probably using, like NFS, proxies, etc, through
> dispatcher scripts with no additional choice of "profile" required like
> AIUI scpm would require.  So again, there could be no additional effort
> required on your part besides choosing the right scpm setup.
>
> Dan

I'm not comfortable writing scripts or modifying config files. I'm gradually 
doing a lot more of that than I want to, and I'm learning, but I'm more 
interested in having it working than learning how to write scripts. I 
appreciate your directions, but my days are already far too long to have any 
time left over to write scripts. That's not your fault, I know, and I don't 
suggest it is, but I do wish scpm and network manager worked together without 
more configuration on my part. 

-- 
Robert Smits CEP525G

Nanaimo, Duncan & District Labour Council

Re: Stop this APN madness!

2008-09-12 Thread Antti Kaijanmäki
This is quite old mail, but I forgot to CC the list back then.


--- Välitetty viesti -
Lähettäjä: Antti Kaijanmäki <[EMAIL PROTECTED]>
Vastaanottaja: Dan Williams <[EMAIL PROTECTED]>
Aihe: Re: Stop this APN madness!
Päiväys: Mon, 25 Aug 2008 07:05:10 +0300

pe, 2008-08-22 kello 11:05 -0400, Dan Williams kirjoitti:
> On Fri, 2008-08-22 at 13:46 +0300, Antti Kaijanmäki wrote:
> > Hi,
 
> > 
> > So it's not safe to blindly override CID 1 or anything else for that
> > matter.
> 
> Probably not.  As an enhancement, NM should:
> 
> 1) Issue AT+CGDCONT=? to get the allowable range of CID slots; not all
> devices conform to the standard here of course so you have to quirk
> stuff.  Some phones may have fewer than 10 slots.  Some devices may have
> all slots filled.
> 
> 2) Iterate over all the slots with AT+CGDCONT? and search for the
> user-specified APN.
> 
> 3) If the user-specified APN is found, use that slot.
> 
> 4) If the user-specified APN is not found, use a free slot.
> 
> 3) If there are no free slots, use the last slot and overwrite whatever
> is there.

this is almost exactly what I proposed :)
great! let's do it!


> > Now let's talk about APNs, shall we. Once again you hear a lot of "just
> > use 'internet' as APN and you should be ready to go". Well that might be
> > true for some providers, but just for example take a look provider
> > information of India[3].
> 
> That's where MBCA comes into play, to gently ask the user which APN they
> need :)

Yes, that's the whole point of MBCA :)


> > On most cases if you use wrong APN you just don't get connected. No true
> > harm there except frustrated users. But now a more disturbing scenario;
> > some service providers have multiple billing methods for mobile
> > broadband. There's at least constant monthly fees, pay-per-Mb and even
> > pay-per-time. The selection between these is done by selecting a
> > specific APN. 
> > 
> > Just think for a minute here if we just blindly issue *99* and that's a
> > pay-per-Mb APN (CID 1) when the user thinks he has constant monthly fee
> > (CID 2). Or "internet" is the pay-per-Mb APN of users service provider.
> > Or we break the users phone by overriding CID 1 with something.
> 
> I think if you don't enter an APN, it'll just use the default APN which
> should have been set up from your provider as such.  Of course that
> might be the wrong APN, but at some point the user needs to take
> responsbility for knowing how to operate their equipment.

Umm, there's nothing that states that CID 1 contains the default APN. 


> > Okay. Enough hot air. Now some concrete solutions.
> > 
> > on nm-connection-editor:
> >  * remove the dial number entry and move the APN entry to it's place
> 
> Probably; I'm not aware of any mobile broadband providers that don't use
> the standard numbers, so we can hide this for now.
> 
> >  * under the hood set gsm.number to ### (see below for explanation)
> 
> Well, we'd just make it NULL/blank actually, that means "not present".

OK. What ever :)


> > NM (or modem-manager):
> >  * when mobile broadband connection is activated check the dial number
> >  * if the number is not ###, just dial the damn thing
> >- don't set APN or anything. User clearly knows which CID is correct.
> 
> You can find wrong directions all over the web.  What I'd prefer to do
> is require an APN, and if the APN is not present, dial the default APN.
> In conjunction with that, make it really easy to select the APN via the
> assistant and require this on creation of the connection.  Perhaps don't
> immediately connect GSM-based devices from the applet, but bring up the
> mobile broadband wizard and select an APN for the connection first.

As I said there's no such thing as default APN. We can't trust what ever
that's set to CID 1 is correct. Indeed we should bring up MBCA if
compiled in or the manual mobile broadband settings dialog if MBCA is
not available.


> >  * if the number is ### do something smart
> >- first check if specified APN is already assigned to some CID 
> >  - get the list using "AT+CGDCONT?" and iterate that
> >  - if found, use that CID for dialing (ATD*99***#)
> 
> Yes.
> 
> >- if the APN is not set then try to append it to the list
> >  - AT+CGDCONT=,"IP",
> 
> Yup, but subject to the maximum number of CIDs available which has to be
> queried too.
> 
> >  - check that it really was appended to the list and use it
> >- if appending fails for some reason just override CID 1
> >  - AT+CGDCONT=1,"IP",
> >  - good fail safe would be storing the original CID to a file so
> > that it can be manually restored if we manage to break someones phone.
> 
> Maybe, but that's icing on the cake after doing the rest of the stuff.
> I'm a big fan of not coding something until you actually find out it's
> needed.

So you need at least one user with bricked phone? :)

 -- Antti



signature.asc
Description: Digitaalisesti allekirjoitettu viestin osa

[PATCH] honour exit code of resolvconf

2008-09-12 Thread Alexander Sack
We need honour the exit code of resolvconf. Otherwise NM wont detect
that resolvconf failed (e.g. in case /etc/resolv.conf isnt a symlink)
and then dont update resolv.conf at all.

Patch attached.

 - Alexander

=== modified file 'src/named-manager/nm-named-manager.c'
--- a/src/named-manager/nm-named-manager.c	2008-09-05 18:57:07 +
+++ b/src/named-manager/nm-named-manager.c	2008-09-09 13:58:11 +
@@ -286,17 +286,17 @@ dispatch_resolvconf (const char *domain,
 			g_set_error (error,
  NM_NAMED_MANAGER_ERROR,
  NM_NAMED_MANAGER_ERROR_SYSTEM,
  "Could not write to %s: %s\n",
  RESOLVCONF_PATH,
  g_strerror (errno));
 		else {
 			retval = write_resolv_conf (f, domain, searches, nameservers, error);
-			pclose (f);
+			retval &= pclose (f) == 0;
 		}
 	} else {
 		cmd = g_strconcat (RESOLVCONF_PATH, " -d ", "NetworkManager", NULL);
 		nm_info ("(%s): removing resolv.conf from %s", iface, RESOLVCONF_PATH);
 		if (nm_spawn_process (cmd) == 0)
 			retval = TRUE;
 	}
 

___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list