summaryrefslogtreecommitdiffstats
path: root/src/network
AgeCommit message (Collapse)AuthorFilesLines
2011-07-14Rework comment formatting.Rémy Oudompheng1-23/+27
Avoid duplicating function names in docstrings, and adopt a style similar to doxygen. Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
2010-11-21Make sure $STATE_DIR and expected subdirs are createdJesse Young1-5/+12
Signed-off-by: Jesse Young <jesse.young@gmail.com>
2010-01-31Fix FS#17406, FS#17307James Rayner1-3/+1
2009-12-31fix error bringing interface downJames Rayner1-1/+1
2009-12-03network: is_interface ignoring $1Jim Pryor1-1/+2
Was the intent for is_interface to be passed the INTERFACE as a parameter (that's how it's called in most or all places)? Or to read INTERFACE from the current environment? That's how it's implemented. Also made INTERFACE in bring_interface a local variable. I don't think this should break anything, but I'm only 95% confident.
2009-10-03connections/ethernet: Don't incorrectly return indicating failureJames Rayner1-4/+1
2009-09-27Only flush when disabling wireless interface, tidy up down/forcedownJames Rayner1-6/+6
2009-09-22Rework wireless to use wpa_supplicant more, add CONFIGSECTION supportJames Rayner1-0/+10
CONFIGSECTION will be useful later on for integration with autowifi. It'll allow WPA configurations to be stored _in_ the profile, rather than separately. Experimentally, WEP/none support has been migrated to wpa_supplicant. Support for string keys has not yet been merged.
2009-09-22Merge connections ethernet/ethernet-iprouteJames Rayner1-17/+6
2009-09-14Rename set_interface to bring_interfaceJim Pryor1-1/+1
3. Change the name of "set_interface up/down..." to "bring_interface up/down" to differentiate it from the similarly-named, merely record-keeping functions. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14don't count profile as connected if it was suspended without a profile-downJim Pryor1-1/+1
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14More localized sourcingJim Pryor1-20/+11
When we're sourcing a profile just to obtain a single variable, use the form: INTERFACE=$(. "$DIR/$profile"; echo "$INTERFACE") This makes it clearer in the source what we're expecting to obtain from the profile, and what we're ignoring. Also allows us to eliminate some more inclusive subshells. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14src/network tweaksJim Pryor1-21/+37
* changed some report_fails that were called without any preceding report_try --> report_err * deploy new check_iface functionality to profile_up and profile_down and interface_down * have profile_up/down report_debug the results of check_iface * the call to interface_down doesn't need to be sandboxed; all the profile sourcing functions it calls as subroutines do their own sandboxing. Don't they? * added missing INTERFACE="$1" to check_iface * tweaks to bring_interface Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14Consolidate check_iface and get_iface_profJim Pryor1-25/+13
1. Change the behavior of check_iface to match that of get_iface_prof (that is, echo either "external" or the profile name, and return 0=true, or echo nothing and return 1=false). 2. Then eliminate get_iface_prof. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14revert regexp ESSID patchesJim Pryor1-5/+5
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14Returns and exitsJim Pryor1-1/+1
* add some abortive returns * some exit tweaks Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14tabs->spaces, vim modelinesJim Pryor1-83/+84
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-14Tweaks while mergingJim Pryor1-1/+2
* added various quotes * made some vars local * tweaked some [[ ]]s, including one broken one in netcfg-menu * s/ra0/$INTERFACE/ in ethernet-iproute and wireless Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-07Added initial rfkill supportJames Rayner1-0/+3
Added some extra debug points Directed debug out to stderr, as debug messages were being used as output from find_essid.
2009-09-07at_interface_{up,down} => IFACE_{UP,DOWN}Jim Pryor1-27/+31
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-07Read /etc/network.d/interfaces/ when loading profileJames Rayner1-10/+8
* profile is sourced again after doing so, so profile-level assignments can override * folded validate_profile into load_profile: the extra source command in load_profile was redundant, so all that load_profile effectively did was just call validate_profile
2009-09-07move checkyesno to globals, make NETCFG_DEBUG a yes/no setting (default=no)Jim Pryor1-28/+0
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-09-07Lots of little tweaks that should never hurt. Some of them may help inJames Rayner1-16/+20
corner cases; others probably make no difference. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-17prevent check_iface from always returning external, output from get_iface_profJames Rayner1-4/+4
2009-08-15quotes!Jim Pryor1-31/+30
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15Isolate ip to ethernet-iproute, ifconfig to ethernet + wirelessJim Pryor1-6/+17
* The point of having both ethernet and ethernet-iproute was presumably to transition slowly from ifconfig/net-tools to iproute2. But the current codebase mixes the two in handling ethernet and wireless connections. This commit separates all the ip calls to the newer connections, and the ifconfig calls to the older connections. The latter now call set_interface with up-old, down-old, forcedown-old. * I'm not urging that ifconfig code sticks around. Just trying to make the code consistent with what seems to me to be its implicit design principles. * the check for NO-CARRIER in ethernet is now also done without calling iproute2 tools. I saw this technique recommended somewhere but have no citation. I don't know how many kernel revisions one can rely on any given part of /sys to remain stable for. It may be possible to achieve the same goal here in other ways. If in fact it's worth the effort to keep the ifconfig code around. * Began also to integrate the IPROUTE variable introduced in ethernet, but stopped. If that's integrated everywhere, shouldn't it make connection=ethernet equivalent to connection=ethernet-iproute? Is there justification for using it at some places but not everywhere? I just let it alone for now. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15start consolidation of ifconfig/ip/set_interfaceJim Pryor1-7/+9
* try to factor all the ifconfig/ip set dev code to single location (currently networks/set_interface, though I recommend a different name for this function because it's too close in name and different in functionality from set_iface, set_profile). * added "forcedown" option to set_interface, meaning "just go down don't worry about 'nodown' quirks" * even with "forcedown", this factoring would introduce "ip addr flush dev $INTERFACE" calls to existing code. I assume that's harmless? or even beneficial? * one code block (in ethernet_iproute) had stdout,stderr of the down calls redirected to /dev/null. I've moved that to set_interface, so now everyone's getting that behavior. I assume that's appropriate... * now no more calls to "ip" or "ifconfig" outside of set_interface, except the checks for NO-CARRIER after ethernet*/set_interface up. They might also be moved to network/set_interface? * as of this commit, all the set_interface calls are now using ip instead of ifconfig. A subsequent commit will isolate the ip-use to ethernet-iproute and the ifconfig-use to ethernet. * ALERT: attend to wireless_down, it seems to be calling set_interface down twice (once in ethernet_down, once in itself). And neither this commit nor the code it's patching respects quirk nodown in the ethernet_down block. Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15Improve suspend/resume, allow for subsets of ifacesJim Pryor1-16/+35
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15silence an error in set_ifaceJim Pryor1-1/+1
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15use subshells as sandboxes, and failing POST_UP/PRE_DOWN abortsJim Pryor1-18/+46
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15Improve listing/iterating over profilesJim Pryor1-15/+22
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-15Everyone use i/o functions from globals/hooksJim Pryor1-0/+1
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
2009-08-10Erase any suspended profiles on a newly connected interfaceJames Rayner1-0/+13
2009-08-10allow interfaces to be marked as externally controlledJames Rayner1-14/+28
2009-08-10Add interface setting, a debug mode and interface setting hooksJames Rayner1-0/+20
2009-08-10merge logging code from Jim PryorJames Rayner1-29/+14
2009-06-27fix taking all profiles downJames Rayner1-1/+1
2009-05-19Fix FS#14761 and handle if no profiles are activeJames Rayner1-18/+19
2009-05-19typo (fix #14761)Andrea Scarpino1-2/+2
2009-05-19fix #14761 (again)Andrea Scarpino1-3/+3
2009-05-19fix #14761Andrea Scarpino1-15/+13
2009-02-26remove stat_appendJames Rayner1-1/+1
2009-02-26FS#13492 - correct find command in all_downJames Rayner1-1/+2
2009-02-16various fixes, and new quirk 'noacheck'James Rayner1-2/+0
2008-12-22fix outputJames Rayner1-2/+2
2008-12-22substitute usage of 'ls' with 'find'James Rayner1-3/+3
2008-12-18use arguments to scripts rather than sourcing in connection functionsJames Rayner1-3/+2
2008-12-18FS11818, improve key handling, use subshells to avoid scope issues after libifyJames Rayner1-17/+20
2008-12-18fix libifyJames Rayner1-0/+297