Re: serial connections
2008/4/29 Dan Williams <[EMAIL PROTECTED]>: > > On Mon, 2008-04-28 at 22:57 +0400, Vitja Makarov wrote: > > I looked now at cdc-acm and found that some devices define cdc acm > > proto subclass that could be one of: > > > > - V25TER (my phone has this) > > - PCCA101 > > - PCCA101-WAKE > > - GSM > > - 3G > > - CDMA > > > > I think this could be added to hal-info to provide device info. > > But my phone is definitely GSM, I don't know anout .V25ter, > > but it seems to be not only GSM modem. > > > > In case of modem devices that could be possible to use dynamic probing: > > > > my phone says this: > > < AT+GCAP > > > +GCAP: +CGSM,+DS,+W > > > > But in case of all other chips such as cp2101, ftdio_sio, cypress_m5 and > so on, > > that should be bad idea to probe them. I not very familar with mobile > phones, > > but I have a wild guess that they all CDC_ACM modems, and that should be > > very good. > > > > Btw HAL could get some info based on USB info, and if unsure try to > > probe the device. > > Isn't that a good idea? > > Right, there should still probably be .fdi files that specify whether to > probe the port or not. Or, invert the check and probe everything > _except_ what's listed in the .fdi file. But probing devices that we > want to know about is the way to go. > > Dan > I've posted patch to hal and here, that tries to probe CDC modems. It uses callouts mechanism that it should be easy to specify which one to probe right in .fdi. I found one probelem with old discharged ubiq phone. When it boots(PC is charger) it first appear as usb device, and only after few(~1.5) minutes gives replies. vitja. ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Is NetworkManager ready for servers with may interfaces?
On Sun, 4 May 2008, Dan Williams wrote: > Ubuntu/Debian doesn't have a native plugin yet, but you can use the > KeyFile plugin if you like. Thanks. (It's becoming obvious I couldn't have just scraped up an Ubuntu NM 0.7 up on my own w/o a lot of help.) My next stop was to grab some of the "rogue" .debs out there I've seen for NM 0.7.X and disassemble one- take it apart, see the installed files and the scripts then duplicate what I can. > You just won't get integration with the distro config tools and > whatnot, since the KeyFile plugin is a completely new config format. I hate to keep asking silly questions, but which/what distro config tools won't I able to integrate with, and will that be a problem if I just use NM to manage my interfaces? -Kenny -- Kenneth R. Crudup Sr. SW Engineer, Scott County Consulting, Los Angeles O: 3630 S. Sepulveda Blvd. #138, L.A., CA 90034-6809 (888) 454-8181 ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Fedora 8 on laptop lenovo T61P
On vendredi 11 janvier 2008, you wrote: > On Thu, 2008-01-10 at 20:24 +0100, Francois wrote: > > The pb I have is that knetworkmanager doesn't take care of the IP > > address I wrote in the ifcfg-wlan0 file. It takes an IP from my dhcp > > router, but my laptop has a fixed ip, It is configurated that way, it > > is not supposed to take an IP from my dhcp router. > > The NM bits in 0.7 don't quite yet support static IP > from /etc/systconfig/network-scripts/ifcfg-* yet. That's coming so Do we have such support in the latest svn release (svn3623) ? Something else : I saw different warnings in the messages log file. Do not know whether or not it's important. Just for info. May 4 19:08:05 celtes10 NetworkManager: Marking connection 'myhome' invalid. May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0) failed. May 4 19:08:05 celtes10 NetworkManager: Deactivating device wlan0. May 4 19:08:05 celtes10 NetworkManager: remove_network_cb(): Couldn't remove network from supplicant interface: The requested network does not exist.. May 4 19:08:05 celtes10 NetworkManager: SWITCH: no current connection, found better connection 'Auto myhome (wlan0)'. May 4 19:08:05 celtes10 NetworkManager: Activating device wlan0 May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled... May 4 19:08:05 celtes10 NetworkManager: (wlan0) Supplicant interface state change: 2 -> 0 May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0) Stage 1 of 5 (Device Prepare) started... May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled... May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0) Stage 1 of 5 (Device Prepare) complete. May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0) Stage 2 of 5 (Device Configure) starting... May 4 19:08:05 celtes10 NetworkManager: Activation (wlan0/wireless): connection 'Auto myhome' requires no security. No secrets needed. thank you. Francois P.S. I resend that message as I did a mistake on my first attempt (wrong address - sorry Dan ;-( ) -- ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
openvpn fails on inactivity timeout
May 4 13:35:45 nbecker1 openvpn[12533]: Initialization Sequence Completed OK, it's up ... May 4 13:37:39 nbecker1 nm-openvpn[21349]: [nbecker] Inactivity timeout (--ping-restart), restarting May 4 13:37:39 nbecker1 nm-openvpn[21349]: SIGUSR1[soft,ping-restart] received, process restarting May 4 13:37:41 nbecker1 nm-openvpn[21349]: Re-using SSL/TLS context May 4 13:37:41 nbecker1 nm-openvpn[21349]: LZO compression initialized May 4 13:37:41 nbecker1 nm-openvpn[21349]: UDPv4 link local: [undef] May 4 13:37:41 nbecker1 nm-openvpn[21349]: UDPv4 link remote: 71.168.34.70:5002 May 4 13:37:41 nbecker1 nm-openvpn[21349]: [nbecker] Peer Connection Initiated with 71.168.34.70:5002 May 4 13:37:42 nbecker1 nm-openvpn[21349]: Preserving previous TUN/TAP instance: tun1 May 4 13:37:42 nbecker1 nm-openvpn[21349]: /usr/bin/nm-openvpn-service-openvpn-helper tun1 1500 1542 10.4.0.50 10.4.0.49 restart May 4 13:37:42 nbecker1 nm-openvpn[21349]: script failed: shell command exited with error status: 1 May 4 13:37:42 nbecker1 nm-openvpn[21349]: Exiting ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: openvpn routing problem
Neal Becker wrote: > If I use nm (NetworkManager-0.7.0-0.9.3.svn3623.fc9.x86_64) to setup > openvpn, it wants to route: > /sbin/route -n > Kernel IP routing table > Destination Gateway Genmask Flags Metric RefUse > Iface > 71.168.34.70192.168.1.1 255.255.255.255 UGH 0 00 > eth0 > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 00 > eth0 > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 00 > wlan0 > 0.0.0.0 0.0.0.0 0.0.0.0 U 0 00 > tun0 > > That's no good, I don't want the default route set to tun0. Here's what I > have if I manually start openvpn: > /sbin/route -n > Kernel IP routing table > Destination Gateway Genmask Flags Metric RefUse > Iface > 10.4.0.49 0.0.0.0 255.255.255.255 UH0 00 > tun0 > 10.4.0.010.4.0.49 255.255.255.0 UG0 00 > tun0 > 192.168.1.0 0.0.0.0 255.255.255.0 U 0 00 > wlan0 I see, I needed to fill in the 'use vpn for addresses' under the 'advanced' tab. ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
openvpn routing problem
If I use nm (NetworkManager-0.7.0-0.9.3.svn3623.fc9.x86_64) to setup openvpn, it wants to route: /sbin/route -n Kernel IP routing table Destination Gateway Genmask Flags Metric RefUse Iface 71.168.34.70192.168.1.1 255.255.255.255 UGH 0 00 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 00 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 00 wlan0 0.0.0.0 0.0.0.0 0.0.0.0 U 0 00 tun0 That's no good, I don't want the default route set to tun0. Here's what I have if I manually start openvpn: /sbin/route -n Kernel IP routing table Destination Gateway Genmask Flags Metric RefUse Iface 10.4.0.49 0.0.0.0 255.255.255.255 UH0 00 tun0 10.4.0.010.4.0.49 255.255.255.0 UG0 00 tun0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 00 wlan0 ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: NM not recognizing PPTP connection...
On Sat, 2008-05-03 at 03:33 -0400, Brian Cardarella wrote: > I have established a PPTP connection with Network Manager (via the > applet), can confirm that it is working but NM doens't recognize it. > The NMapp icon is still disconnected, and all Gnome applications start > start in off-line mode. I'm using Ubuntu 8.04. Any thoughts? > > Preferably I would like the PPTP connection to establish automatically > when my mobile usb modem (/dev/ttyACM0) is detected. Any way of doing > this? You mean PPP (Point-to-Point Protocol) connection not PPTP (Point-to-Point Tunneling Protocol, a VPN thing) right? What SVN revision are you using? When you say "confirm that it is working", what do you mean you're able to select it from the applet's menu? Dan ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Is NetworkManager ready for servers with may interfaces?
On Fri, 2008-05-02 at 16:23 -0700, Kenneth Crudup wrote: > On Fri, 2 May 2008, Rui Tiago Cação Matos wrote: > > > If you're wondering how [the system settings plugin] gets launched: > > $ less > > /usr/share/dbus-1/system-services/org.freedesktop.NetworkManagerSystemSettings.service > > i.e. it's automatically launched by DBus when NM needs it. > > Thank you very much for this; I think I might have found one problem. > That file reads: > > > [D-BUS Service] > Name=org.freedesktop.NetworkManagerSystemSettings > Exec=/usr/sbin/nm-system-settings --config /etc/nm-system-settings.conf > User=root > > > ... but there's no file "/etc/nm-system-settings.conf"; there's one > in the D-Bus directory, though: > > -rw-r--r-- 1 root root 902 2008-05-02 10:03 > /etc/dbus-1/system.d/nm-system-settings.conf > > Should I just make a symlink? No, the dbus conf file is for dbus permissions. There isn't a shipped config file for the settings service. Basically, just make one up that has: [main] plugins=keyfile and point the system settings service to that. You then get to actually create the connection files, which by default are in /etc/NetworkManager/system_config/ and look like normal .ini files. I should get Tambet to mail you a sample file or something, it's a bit long to explain there. But Tambet will also soon land the connection editing patches so that you could use nm-connection-editor to add/create/delete system connections instead of writing them in a text editor. dan ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Is NetworkManager ready for servers with may interfaces?
On Fri, 2008-05-02 at 10:11 -0700, Kenneth Crudup wrote: > On Fri, 2 May 2008, Dan Williams wrote: > > > If your distro has a system settings plugin > > How does one determine this? > > (FWIW, I'm running Ubuntu 8.04.) Ubuntu/Debian doesn't have a native plugin yet, but you can use the KeyFile plugin if you like. You just won't get integration with the distro config tools and whatnot, since the KeyFile plugin is a completely new config format. Dan ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Dispatcher script dynamics
Ive been using NetworkManager svn for a while and with the recent dispatcher changes, there is a bit of a "feature loss": Originally, I start nm AFTER my xsession starts, so that the dispatcher is run in the same tty as X in order to run a Gtk application as part of a dispatcher script (firestarter firewall for those interested). Obviously, now that the dispatcher system is spawned under DBUS, one cannot write scripts to start gui applications using dispatcher...or can they? Well it so happens that you can if you allow TCP connections to X and do something like "xhost +localhost" and set the DISPLAY environment variable, you can run gui applications. But this is very inconvenient and I dont really want any connections to my X anyway. Furthermore, applications dont know anything about the environment to run in, and as such, firestarter will always complain that it cannot run its scripts (error: "which: no iptables in ((null))", probably because it cannot fork the shell). SO THEN, can anyone think of some alternative method that allows the starting of GUI's as part of the dispatcher's functionality without ugly hacks such as above? ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
[PATCH] hal probe modem caps ondemand
Probe CDC-ACM modems, found in most cell phones on the fly, using AT+GCAP modem command. I tested it with 1 Nokia GSM phone, and 2 CDMA. vitja. diff --git a/fdi/information/10freedesktop/10-modem.fdi b/fdi/information/10freedesktop/10-modem.fdi index 1a93013..6753b51 100644 --- a/fdi/information/10freedesktop/10-modem.fdi +++ b/fdi/information/10freedesktop/10-modem.fdi @@ -275,7 +275,34 @@ - + + + + + + + + + + modem + V25TER + hald-probe-modem + + + + modem + GSM-07.07 + GSM-07.05 + + + + + modem + IS-707-A + + + + diff --git a/hald/linux/probing/Makefile.am b/hald/linux/probing/Makefile.am index 274b870..9e0c7ec 100644 --- a/hald/linux/probing/Makefile.am +++ b/hald/linux/probing/Makefile.am @@ -20,7 +20,8 @@ libexec_PROGRAMS = \ hald-probe-serial \ hald-probe-ieee1394-unit \ hald-probe-net-bluetooth \ - hald-probe-video4linux + hald-probe-video4linux \ + hald-probe-modem endif hald_probe_smbios_SOURCES = probe-smbios.c ../../logger.c @@ -39,6 +40,9 @@ hald_probe_hiddev_LDADD = $(top_builddir)/libhal/libhal.la hald_probe_serial_SOURCES = probe-serial.c ../../logger.c hald_probe_serial_LDADD = $(top_builddir)/libhal/libhal.la +hald_probe_modem_SOURCES = probe-modem.c ../../logger.c +hald_probe_modem_LDADD = $(top_builddir)/libhal/libhal.la + hald_probe_storage_SOURCES = probe-storage.c linux_dvd_rw_utils.c linux_dvd_rw_utils.h ../../logger.c hald_probe_storage_LDADD = $(top_builddir)/libhal/libhal.la $(top_builddir)/partutil/libpartutil.la @GLIB_LIBS@ @VOLUME_ID_LIBS@ diff --git a/hald/linux/probing/probe-modem.c b/hald/linux/probing/probe-modem.c new file mode 100644 index 000..4599faa --- /dev/null +++ b/hald/linux/probing/probe-modem.c @@ -0,0 +1,165 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include +#include +#include + +#include "libhal/libhal.h" +#include "../../logger.h" + +#define MODEM_CAP_GSM 0x0001 /* GSM commands */ +#define MODEM_CAP_IS707_A 0x0002 /* CDMA circuit switched data commands */ +#define MODEM_CAP_DS 0x0004 /* data compression */ +#define MODEM_CAP_ES 0x0008 /* error control */ +#define MODEM_CAP_FCLASS 0x0010 /* Fax commands */ +#define MODEM_CAP_MS 0x0020 /* Modulation control commands */ +#define MODEM_CAP_W 0x0040 /* Wireless commands */ + +struct modem_caps { + char *name; + int bits; +}; + +static struct modem_caps modem_caps[] = { + {"+CGSM", MODEM_CAP_GSM}, + /* TODO: is that the same */ + {"+CIS707-A", MODEM_CAP_IS707_A}, + {"+CIS707", MODEM_CAP_IS707_A}, + {"+CIS707P", MODEM_CAP_IS707_A}, + {NULL} +} ; + +#define AT_CAPS_PROBE "AT+GCAP\r\n" +static +int modem_probe_caps(int fd) +{ + char buf[200]; + char *ptr, *field = NULL; + int err, ret = 0; + + err = write(fd, AT_CAPS_PROBE, sizeof(AT_CAPS_PROBE) - 1); + + if (err != sizeof(AT_CAPS_PROBE) - 1) + return -1; + + /* 100ms is enough for modem to send all the data */ + usleep(10); + + err = read(fd, buf, sizeof(buf) - 1); + if (err <= 0) + return -1; + buf[err] = 0; + + /* check okay reply */ + ptr = strstr(buf, "\r\nOK\r\n"); + if (!ptr) + return -1; + *ptr = 0; + + /* find +GCAP: string */ + ptr = strstr(buf, "\r\n+GCAP:"); + + if (ptr == NULL) + return -1; + ptr += 8; + + /* and parse it */ + do { + err = *ptr == '\0' || *ptr == '\r' || *ptr == '\n'; + if (*ptr == ' ' || *ptr == ',' || err) { + *ptr = 0; + if (field) { +struct modem_caps *cap = modem_caps; + +while (cap->name) { + if (!strcmp(cap->name, field)) + ret |= cap->bits; + cap++; +} + } + field = NULL; + } else if (NULL == field) { + field = ptr; + } + ptr++; + } while (!err); + + return ret; +} + +int main(int argc, char *argv[]) +{ + struct termios orig, attrs; + DBusError error; + LibHalContext *ctx; + char *udi; + char *device; + int fd, caps; + system("set > /tmp/aa"); + + setup_logger(); + + if ((udi = getenv("UDI")) == NULL) { + HAL_ERROR(("UDI is not set")); + return -1; + } + + if ((device = getenv("HAL_PROP_SERIAL_DEVICE")) == NULL) { + HAL_ERROR(("HAL_PROP_SERIAL_DEVICE is not set")); + return -1; + } + + fd = open(device, O_RDWR|O_NDELAY); + + if (-1 == fd) { + HAL_ERROR(("open():", strerror(errno))); + return -1; + } + + if (tcgetattr(fd, &orig)) + return -1; + + memcpy(&attrs, &orig, sizeof(attrs)); +attrs.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | IGNPAR); +attrs.c_oflag &= ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET); +attrs.c_lflag &= ~(ICANON | XCASE | ECHO | ECHOE | ECHONL); +attrs.c_lflag &= ~(ECHO | ECHOE); +attrs.c_cc[VMIN] = 1; +