stream: Add basic stream service for systemd sockets

This allows systemd socket activation by passing URIs such as systemd://foo
to plugins such as VICI.

For example setting charon.plugins.vici.socket = systemd://vici, a
systemd socket file descriptor with the name "vici" will be picked up.

So these would be the corresponding unit options:

  [Socket]
  FileDescriptorName=vici
  Service=strongswan.service

  ListenStream=/run/charon.vici

The implementation currently is very basic and right now only the first
file descriptor for a particular identifier is picked up if there are
multiple socket units with the same FileDescriptorName.

Signed-off-by: aszlig <[email protected]>

Closes strongswan/strongswan#79.
This commit is contained in:
aszlig
2017-10-10 11:11:11 +02:00
committed by Tobias Brunner
parent ea613d5d27
commit 59db98fb94
4 changed files with 118 additions and 0 deletions
+7
View File
@@ -96,6 +96,7 @@ fetcher/fetcher_manager.h eap/eap.h pen/pen.h ipsec/ipsec_types.h \
networking/host.h networking/host_resolver.h networking/packet.h \
networking/tun_device.h networking/streams/stream.h \
networking/streams/stream_unix.h networking/streams/stream_service_unix.h \
networking/streams/stream_service_systemd.h \
networking/streams/stream_tcp.h networking/streams/stream_service_tcp.h \
networking/streams/stream_service.h networking/streams/stream_manager.h \
resolver/resolver.h resolver/resolver_response.h resolver/rr_set.h \
@@ -192,6 +193,12 @@ if USE_LIBCAP
libstrongswan_la_LIBADD += -lcap
endif
if USE_SYSTEMD
AM_CPPFLAGS += $(systemd_CFLAGS) -DUSE_SYSTEMD
libstrongswan_la_SOURCES += networking/streams/stream_service_systemd.c
libstrongswan_la_LIBADD += $(systemd_LIBS)
endif
EXTRA_DIST = \
asn1/oid.txt asn1/oid.pl \
crypto/proposal/proposal_keywords_static.txt \