stream: Add basic stream service for systemd sockets
authoraszlig <aszlig@redmoonstudios.org>
Wed, 30 Aug 2017 00:36:34 +0000 (02:36 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 10 Oct 2017 09:11:11 +0000 (11:11 +0200)
commit59db98fb941ca2c30b9d5c83da2fc7ae475ebeec
tree3c59696adbac3b8cf785da200dc68d00602f6f6d
parentea613d5d276f31aed9d7de3f3e28fe1b786b983a
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 <aszlig@redmoonstudios.org>
Closes strongswan/strongswan#79.
src/libstrongswan/Makefile.am
src/libstrongswan/networking/streams/stream_manager.c
src/libstrongswan/networking/streams/stream_service_systemd.c [new file with mode: 0644]
src/libstrongswan/networking/streams/stream_service_systemd.h [new file with mode: 0644]