summaryrefslogtreecommitdiff
path: root/src/network/networkctl.c
AgeCommit message (Collapse)Author
2016-01-12tree-wide: use xsprintf() where applicableDaniel Mack
Also add a coccinelle receipt to help with such transitions.
2015-11-27tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering
GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen
Sort the includes accoding to the new coding style.
2015-11-10networkctl: lldp port to extract_first_wordSusant Sahani
2015-11-03parse-util: introduce parse_ifindex() and make use of it everywhereLennart Poettering
We have enough places where we parse an ifindex, hence introduce a proper parsing function for it, that verifies all parameters.
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-27util-lib: move more locale-related calls to locale-util.[ch]Lennart Poettering
2015-10-27util-lib: move string table stuff into its own string-table.[ch]Lennart Poettering
2015-10-27util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]Lennart Poettering
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-09-29util: introduce common version() implementation and use it everywhereLennart Poettering
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-09-22cgtop: underline table headerLennart Poettering
Let's underline the header line of the table shown by cgtop, how it is customary for tables. In order to do this, let's introduce new ANSI underline macros, and clean up the existing ones as side effect.
2015-09-01tree-wide: do not shadow the global var timezoneThomas Hindoe Paaboel Andersen
2015-08-26dhcp,network: implement RFC 4833 (DHCP Timezone option)Lennart Poettering
This one is simply to add: encode the tzdata timezone in the DHCP options and optionally make use of it.
2015-08-06tree-wide: fix indentationThomas Hindoe Paaboel Andersen
2015-08-03tree-wide: convert bootchart and lldp code to use clock_boottime_or_monotonic()Lennart Poettering
We should avoid using CLOCK_BOOTTIME directly unless we actually can sensible distuingish it from CLOCK_MONOTONIC. CLOCK_BOOTTIME is only fully feature on very recent Linux kernels, hence we should stick to a fallback logic, which is already available in the clock_boottime_or_monotonic() call.
2015-06-13sd-netlink: rename from sd-rtnlTom Gundersen
2015-06-11sd-rtnl: make joining broadcast groups implicitTom Gundersen
2015-06-08tree-wide: remove spurious spaceThomas Hindoe Paaboel Andersen
2015-05-30networkctl: fix uninitialized variableRonny Chevalier
We ignore the return value of sd_device_get_devtype, then devtype could be uninitialized when used with streq_ptr. So we need to initialize it first.
2015-04-11shared: add terminal-util.[ch]Ronny Chevalier
2015-04-02networkctl: port from libudev to sd-deviceTom Gundersen
2015-03-27fix gcc warnings about uninitialized variablesHarald Hoyer
like: src/shared/install.c: In function ‘unit_file_lookup_state’: src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in this function [-Wmaybe-uninitialized] return r < 0 ? r : state; ^ src/shared/install.c:1796:13: note: ‘r’ was declared here int r; ^
2015-03-07networkctl: avoid leak if a field was specified twiceZbigniew Jędrzejewski-Szmek
The input data would have to be borked, so this is unlikely to happen, but since we have a nice helper function to do it properly... why not? CID #1261390.
2015-02-27networkd: add support for Uplink Failure DetectionAlin Rauta
Introduce BindCarrier= to indicate the set of links that determine if the current link should be brought UP or DOWN. [tomegun: add a bit to commit message]
2015-01-19man: add networkctl(1)Zbigniew Jędrzejewski-Szmek
2015-01-01networkctl: avoid potential use of unitialized variablesZbigniew Jędrzejewski-Szmek
Those values are based on a file we read from disk, so we should verify everything we receive, and make sure everything we print is sensible. Also, print fractional seconds for TTL.
2015-01-01networkctl: remove unused variableZbigniew Jędrzejewski-Szmek
2015-01-01network: fix scanf/printf formatZbigniew Jędrzejewski-Szmek
usec_t is defined as 64 bit wide, but long is 32 bit on many archs.
2014-12-31networkctl: fix strappend() error checkingDavid Herrmann
Make sure to test the right variable for NULL.
2014-12-19networkctl: lldp - respect arg_legendTom Gundersen
2014-12-19LLDP: Add support for networkctlSusant Sahani
2014-12-19networkctl: port to verbs helperTom Gundersen
2014-12-15networkctl: port from libudev to sd-hwdbTom Gundersen
2014-12-12networkctl: remove unused variableThomas Hindoe Paaboel Andersen
2014-12-12networkctl: also draw a nice unicode cirlce when "networkctl status" is run ↵Lennart Poettering
without parameters
2014-12-12networkctl: show interface names next to IP addresses if we dump adresses ↵Lennart Poettering
from all interfaces
2014-12-12networkctl: also show gateway address when "networkctl status" without ↵Lennart Poettering
further arguments is passed
2014-12-12networkctl: show MAC address OUI vendor next to MAC addressesLennart Poettering
2014-12-04networkctl: use the shared functions for enumerating the local gatewaysTom Gundersen
2014-12-04rtnl: when querying local addresses and gateways, take address family into ↵Lennart Poettering
account
2014-12-03networkctl: remove unused variableThomas Hindoe Paaboel Andersen
2014-12-03networkd: fix typoTorstein Husebø
V2: found another one
2014-12-02shared: add format helpers for printing MAC addressesTom Gundersen
Use these in networctl.
2014-12-02networkctl: print the Gateway in the status outputTom Gundersen
This is the IP address of the default route on the link, if present. A description is printed when available (the manufacturer of the gateway NIC based on its MAC address). In the future we should prefer LLDP information over MAC info.
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().