summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-18 11:30:06 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-18 11:30:06 +0100
commitedf1e713816cd514ba2d9c3e1a7661a2d27d38c8 (patch)
treeb7663dc33245e39d0a28d69137df60f3b464c211 /src/core/load-fragment.c
parentdd050decb6ad131ebdeabb71c4f9ecb4733269c0 (diff)
parentfaf1cc9323133384c6097763d7167a779aae2c6e (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.c31
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,