summaryrefslogtreecommitdiff
path: root/src/shared/socket-util.h
Commit message (Collapse)AuthorAge
* util: never use ether_ntoa(), since it formats with %x, not %02x, which ↵Lennart Poettering2014-08-15
| | | | makes ethernet addresses look funny
* timesyncd: move the generic sockaddr_equal() call to socket-util.hLennart Poettering2014-08-12
|
* shared/socket-util: add function to query remote addressZbigniew Jędrzejewski-Szmek2014-07-15
|
* shared: split out in_addr related calls from socket-util.[ch] into its ↵Lennart Poettering2014-07-10
| | | | | | | private in-addr-util.[ch] These are enough calls for a new file, and they are sufficiently different from the sockaddr-related calls, hence let's split this out.
* nss-myhostname: move local address listing logic into shared, so that we can ↵Lennart Poettering2014-07-10
| | | | make use of it from machined
* networkd: add a number of calls to manipulate in_addr_union structsLennart Poettering2014-06-18
|
* socket-util: introduce in_addr_union similar to sockaddr_union and make use ↵Lennart Poettering2014-06-18
| | | | of it everywhere
* socket: optionally remove sockets/FIFOs in the file system after useLennart Poettering2014-06-04
|
* activate: export make_socket_fdZbigniew Jędrzejewski-Szmek2014-03-17
| | | | Also improve logging to print out the parsed address on error.
* shared: Add struct sockaddr_ll to sockaddr_unionPatrik Flykt2013-12-12
|
* socket: rework things to have only one sockaddr formatterLennart Poettering2013-11-07
|
* socket-proxyd: rework to support multiple sockets and splice()-based ↵Lennart Poettering2013-11-06
| | | | | | | | | zero-copy network IO This also drops --ignore-env, which can't really work anymore if we allow multiple fds. Also adds support for pretty printing of peer identities for debug purposes, and abstract namespace UNIX sockets. Also ensures that we never take more connections than a certain limit.
* active: rework make_socket_fd() to be based on socket_address_listen()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we set SO_REUSEADDR which is immensely useful.
* core: rework how we match mount units against each otherLennart Poettering2013-09-26
| | | | | | | | | | | | | | | | | | | | | | | Previously to automatically create dependencies between mount units we matched every mount unit agains all others resulting in O(n^2) complexity. On setups with large amounts of mount units this might make things slow. This change replaces the matching code to use a hashtable that is keyed by a path prefix, and points to a set of units that require that path to be around. When a new mount unit is installed it is hence sufficient to simply look up this set of units via its own file system paths to know which units to order after itself. This patch also changes all unit types to only create automatic mount dependencies via the RequiresMountsFor= logic, and this is exposed to the outside to make things more transparent. With this change we still have some O(n) complexities in place when handling mounts, but that's currently unavoidable due to kernel APIs, and still substantially better than O(n^2) as before. https://bugs.freedesktop.org/show_bug.cgi?id=69740
* Add __attribute__((const, pure, format)) in various placesZbigniew Jędrzejewski-Szmek2013-05-02
| | | | | | | | I'm assuming that it's fine if a _const_ or _pure_ function calls assert. It is assumed that the assert won't trigger, and even if it does, it can only trigger on the first call with a given set of parameters, and we don't care if the compiler moves the order of calls.
* systemd-activate: add a socket-activation test toolZbigniew Jędrzejewski-Szmek2013-02-27
|
* socket: support socket activation of containersLennart Poettering2012-12-22
|
* shared, core: do not always accept numbers in string lookupsMichal Schmidt2012-10-30
| | | | | | | | | | | | | | | | | | | | | | | | The behaviour of the common name##_from_string conversion is surprising. It accepts not only the strings from name##_table but also any number that falls within the range of the table. The order of items in most of our tables is an internal affair. It should not be visible to the user. I know of a case where the surprising numeric conversion leads to a crash. We will allow the direct numeric conversion only for the tables where the mapping of strings to numeric values has an external meaning. This holds for the following lookup tables: - netlink_family, ioprio_class, ip_tos, sched_policy - their numeric values are stable as they are defined by the Linux kernel interface. - log_level, log_facility_unshifted - the well-known syslog interface. We allow the user to use numeric values whose string names systemd does not know. For instance, the user may want to test a new kernel featuring a scheduling policy that did not exist when his systemd version was released. A slightly unpleasant effect of this is that the name##_to_string conversion cannot return pointers to constant strings anymore. The strings have to be allocated on demand and freed by the caller.
* use #pragma once instead of foo*foo #define guardsShawn Landden2012-07-19
| | | | | | | | | | | | | | | | | #pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported in other compilers. I've been using and maintaining (rebasing) this patch for a while now, as it annoyed me to see #ifndef fooblahfoo, etc all over the place, almost arrogant about the annoyance of having to define all these names to perform a commen but neccicary functionality, when a completely superior alternative exists. I havn't sent it till now, cause its kindof a style change, and it is bad voodoo to mess with style that has been established by more established editors. So feel free to lambast me as a crazy bafoon. v2 - preserve externally used headers
* relicense to LGPLv2.1 (with exceptions)Lennart Poettering2012-04-12
| | | | | | | | | | | | | | We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
* util: move all to shared/ and split external dependencies in separate ↵Kay Sievers2012-04-10
internal libraries Before: $ ldd /lib/systemd/systemd-timestamp linux-vdso.so.1 => (0x00007fffb05ff000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f90aac57000) libcap.so.2 => /lib64/libcap.so.2 (0x00007f90aaa53000) librt.so.1 => /lib64/librt.so.1 (0x00007f90aa84a000) libc.so.6 => /lib64/libc.so.6 (0x00007f90aa494000) /lib64/ld-linux-x86-64.so.2 (0x00007f90aae90000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f90aa290000) libattr.so.1 => /lib64/libattr.so.1 (0x00007f90aa08a000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f90a9e6e000) After: $ ldd systemd-timestamp linux-vdso.so.1 => (0x00007fff3cbff000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f5eaa1c3000) librt.so.1 => /lib64/librt.so.1 (0x00007f5ea9fbb000) libc.so.6 => /lib64/libc.so.6 (0x00007f5ea9c04000) /lib64/ld-linux-x86-64.so.2 (0x00007f5eaa3fc000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f5ea9a00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5ea97e4000)