summaryrefslogtreecommitdiff
path: root/src/network
AgeCommit message (Collapse)Author
2016-04-08network: check return valueZbigniew Jędrzejewski-Szmek
CID #1349698.
2016-04-08Merge pull request #2985 from keszybz/lldp-assertMartin Pitt
Replace if with assert_cc in lldp code and a build-sys tweak
2016-04-07Merge pull request #2943 from vinaykul/systemd_duid_review_fixesZbigniew Jędrzejewski-Szmek
DHCP DUID parsing fix, logging fix, man-page fix
2016-04-07lldp: replace if with assert_ccZbigniew Jędrzejewski-Szmek
LLDP_TX_HOLD or one of the other variables might be changed in the future resulting in a silent error here if the if was just removed. Replacement for #2983.
2016-04-04Address code-review items for pull-request #2890Vinay Kulkarni
1. Replace strtol with unhexchar, verified with valid and invalid DUID strings. 2. Fix logging to use log_syntax instead of log_error. 3. On error reading DUID, ignore read and preserve previous state. 4. Fix man-pages to use markup, remove options not yet implemented. 5. Remove spurious header line in new files.
2016-04-02Add networkd-gperf.c to gitignoreZbigniew Jędrzejewski-Szmek
For #2915.
2016-03-31Merge pull request #2915 from vinaykul/masterZbigniew Jędrzejewski-Szmek
2016-03-30DHCP DUID, IAID configuration optionsVinay Kulkarni
2016-03-24lldp: move public macros to sd-lldp.h and namespace themBeniamino Galvani
lldp.h contains definitions of LLDP types, subtypes and capabilities which should be exposed in public headers. Get rid of the file and move those definitions to sd-lldp.h with the SD_ prefix.
2016-03-21Revert "DHCP DUID and IAID configurability"Zbigniew Jędrzejewski-Szmek
2016-03-09DHCP DUID and IAID configurabilityVinay Kulkarni
2016-03-09Merge pull request #2755 from keszybz/more-testsMartin Pitt
Enable more tests by default, and even more with `--enable-tests=unsafe`
2016-03-05tree-wide: use SET_FLAG() macro to make code more clearAlexander Kuleshov
2016-03-04networkctl: avoid reading past end of input bufferZbigniew Jędrzejewski-Szmek
name is IFNAMSIZ bytes, but we would copy sizeof(info->name) bytes, which is IFNAMSIZ + 1. In effect we would go outside of the source buffer and possibly leave a non-null terminated string in info->name. CID #1351754.
2016-03-04networkctl: use ETHER_ADDR_NULL in one more placeZbigniew Jędrzejewski-Szmek
2016-02-25Merge pull request #2671 from 0xAX/move-pager-open-to-one-placeZbigniew Jędrzejewski-Szmek
tree-wide: merge pager_open_if_enabled() to the pager_open()
2016-02-26tree-wide: merge pager_open_if_enabled() to the pager_open()Alexander Kuleshov
Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication.
2016-02-23Merge pull request #2724 from vcaputo/minor-formatting-cleanupsZbigniew Jędrzejewski-Szmek
tree-wide: minor formatting inconsistency cleanups
2016-02-23tree-wide: minor formatting inconsistency cleanupsVito Caputo
2016-02-23networkctl: fix constThomas Hindoe Paaboel Andersen
2016-02-23Merge pull request #2717 from keszybz/networkctl-prettificationLennart Poettering
Networkctl prettification
2016-02-23networkctl: only print lldp legend for capabilities that were actually seenZbigniew Jędrzejewski-Szmek
2016-02-22tree-wide: make ++/-- usage consistent WRT spacingVito Caputo
Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
2016-02-22Merge pull request #2685 from poettering/lldp-fixes2Tom Gundersen
lldp fixes, second iteration
2016-02-22Merge pull request #2692 from ssahani/tunnelZbigniew Jędrzejewski-Szmek
networkd: tunnel fix tunnel address
2016-02-21networkd: make sure we allocate the NTA set before we add items to itLennart Poettering
See: #2683
2016-02-21sd-lldp: beef up callback logicLennart Poettering
Instead of just notifying about the fact that something changed in the database, actually inform the callback what precisely changed. This is useful, so that the LLDP tx logic can be put into "fast" mode as soon as a previously unknown peer appears, as suggested by the LLDP spec.
2016-02-21networkctl: ellipsize long LLDP fields in table outputLennart Poettering
2016-02-21networkctl: add missing newline to printf() format stringLennart Poettering
2016-02-21networkd: add basic LLDP transmission supportLennart Poettering
Let's add some minimalistic LLDP sender support. The idea is that this is either on or off, and all fields determined automatically rather than configured explicitly.
2016-02-21sd-lldp: filter out LLDP messages coming from our own MAC addressLennart Poettering
Let's not get confused should we be connected to some bridge that mirrors back our packets.
2016-02-21networkd: make a couple of functions staticLennart Poettering
These functions are nowadays used only within networkd-link.c, hence ther's no point in littering our public namespace with them.
2016-02-21networkd: rework when LLDP reception is enabledLennart Poettering
Being on the link-layer LLDP is nothing we should turn on only when there's a link beat. Instead, turn it on, whenever the iface is UP regardless if there's a link beat or not. This closes the race between a link beat being available and us subscribing to LLDP as a result.
2016-02-21networkctl: print a nice warning when networkd isn't runningLennart Poettering
2016-02-21networkctl: if there's no data from networkd about an iface show as "unmanaged"Lennart Poettering
After all, if we know that an interface exists but networkd did not store any info about it, then it's definitely unmanaged by it. (Note that we add this fix-up to networkctl, and not to sd-network, simply because a missing file might also be result of the interface not existing.)
2016-02-21networkctl: add a couple of (void) castsLennart Poettering
Where we knowingly ignore possible error results, let's cast to void.
2016-02-21networkd: rework how carrier bindings are serializedLennart Poettering
Instead of serializing the interface name, expose the interface index, since that's the only stable identifier.
2016-02-21networkd: turn on LLDP reception by default, in "routers-only" modeLennart Poettering
This way "networkctl status" becomes a bit more useful by default, as router information is just visible, without any further configuration. LLDP reception is fully passive and relatively low simple and low traffic, hence this should be safe to enable by default.
2016-02-21networkctl: extend "networkctl status" per-interface output to include LLDP infoLennart Poettering
This adds a small and useful field to the "systemctl status" output: the router(s) the interface is connected to as reported via LLDP. Example output: ● 2: enp0s25 Link File: /usr/lib/systemd/network/99-default.link Type: ether State: degraded (configured) Path: pci-0000:00:19.0 Driver: e1000e Connected To: GS1900 on port 2 (foobar) i.e. the last line is the relevant one.
2016-02-21networkctl: make use of xsprintf() where we canLennart Poettering
2016-02-21networkctl: simplify networkctlLennart Poettering
Move decode_and_sort_links() into acquire_info_all() which is the only place this is used. The result is then nicely symmetric to acquire_info_strv().
2016-02-21networkctl: rework interface data acquisitionLennart Poettering
Let's always use the same calls to acquire interface data. Specifically port "networkctl status" to use acquire_link_info_strv() and acquire_link_info_all() like the other calls.
2016-02-21networkctl: extend "networkctl list" and "networctl lldp" to optionally take ↵Lennart Poettering
interface names This way, the output may be reduced to only show data about the specified interfaces.
2016-02-21networkctl: add new call that unifies link data acquisition between "status" ↵Lennart Poettering
and "lldp" verbs
2016-02-21networkctl: fix dispatch_verb() tableLennart Poettering
VERB_DEFAULT may only appear once.
2016-02-21networkctl: split out system status stuff into its own functionLennart Poettering
2016-02-21sd-lldp: rework sd-lldp APILennart Poettering
This reworks the sd-lldp substantially, simplifying things on one hand, and extending the logic a bit on the other. Specifically: - Besides the sd_lldp object only one other object is maintained now, sd_lldp_neighbor. It's used both as storage for literal LLDP packets, and for maintainging info about peers in the database. Separation between packet, TLV and chassis data is not maintained anymore. This should be a major simplification. - The sd-lldp API has been extended so that a couple of per-neighbor fields may be queried directly, without iterating through the object. Other fields that may appear multiple times, OTOH have to be iterated through. - The maximum number of entries in the neighbor database is now configurable during runtime. - The generation of callbacks from sd_lldp objects is more restricted: callbacks are only invoked when actual data changed. - The TTL information is now hooked with a timer event, so that removals from the neighbor database due to TTLs now result in a callback event. - Querying LLDP neighbor database will now return a strictly ordered array, to guarantee stability. - A "capabilities" mask may now be configured, that selects what type of LLDP neighbor data is collected. This may be used to restrict collection of LLDP info about routers instead of all neighbors. This is now exposed via networkd's LLDP= setting. - sd-lldp's API to serialize the collected data to text files has been removed. Instead, there's now an API to extract the raw binary data from LLDP neighbor objects, as well as one to convert this raw binary data back to an LLDP neighbor object. networkd will save this raw binary data to /run now, and the client side can simply parse the information. - support for parsing the more exotic TLVs has been removed, since we are not using that. Instead there are now APIs to extract the raw data from TLVs. Given how easy it is to parse the TLVs clients should do so now directly instead of relying on our APIs for that. - A lot of the APIs that parse out LLDP strings have been simplified so that they actually return strings, instead of char arrays with a length. To deal with possibly dangerous characters the strings are escaped if needed. - APIs to extract and format the chassis and port IDs as strings has been added. - lldp.h has been simplified a lot. The enums are anonymous now, since they were never used as enums, but simply as constants. Most definitions we don't actually use ourselves have eben removed.
2016-02-20networkd: fix logging of error codesLennart Poettering
2016-02-20networkd: enable LLDP only on ethernetLennart Poettering
2016-02-20sd-netlink: fix ifi_iftype typeLennart Poettering
The iftype is an unsigned short, and not just an unsigned.