diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-18 11:30:06 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-18 11:30:06 +0100 |
commit | edf1e713816cd514ba2d9c3e1a7661a2d27d38c8 (patch) | |
tree | b7663dc33245e39d0a28d69137df60f3b464c211 /src/core/load-fragment.c | |
parent | dd050decb6ad131ebdeabb71c4f9ecb4733269c0 (diff) | |
parent | faf1cc9323133384c6097763d7167a779aae2c6e (diff) |
Merge pull request #1889 from ssahani/socket-proto
socket: Add support for socket protcol
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index dda79267f7..d5cf476fda 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -421,6 +421,37 @@ int config_parse_socket_listen(const char *unit, return 0; } +int config_parse_socket_protocol(const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + Socket *s; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + s = SOCKET(data); + + if (streq(rvalue, "udplite")) + s->socket_protocol = IPPROTO_UDPLITE; + else if (streq(rvalue, "sctp")) + s->socket_protocol = IPPROTO_SCTP; + else { + log_syntax(unit, LOG_ERR, filename, line, 0, "Socket protocol not supported, ignoring: %s", rvalue); + return 0; + } + + return 0; +} + int config_parse_socket_bind(const char *unit, const char *filename, unsigned line, |