summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application_interface.c17
-rw-r--r--src/vnet/session/transport.c7
-rw-r--r--src/vnet/session/transport.h3
3 files changed, 25 insertions, 2 deletions
diff --git a/src/vnet/session/application_interface.c b/src/vnet/session/application_interface.c
index 8dab3d67bce..ec317896f14 100644
--- a/src/vnet/session/application_interface.c
+++ b/src/vnet/session/application_interface.c
@@ -326,7 +326,22 @@ unformat_vnet_uri (unformat_input_t * input, va_list * args)
sep->is_ip4 = 0;
return 1;
}
-
+ if (unformat (input, "sctp://%U/%d", unformat_ip4_address, &sep->ip.ip4,
+ &sep->port))
+ {
+ sep->transport_proto = TRANSPORT_PROTO_SCTP;
+ sep->port = clib_host_to_net_u16 (sep->port);
+ sep->is_ip4 = 1;
+ return 1;
+ }
+ if (unformat (input, "sctp://%U/%d", unformat_ip6_address, &sep->ip.ip6,
+ &sep->port))
+ {
+ sep->transport_proto = TRANSPORT_PROTO_SCTP;
+ sep->port = clib_host_to_net_u16 (sep->port);
+ sep->is_ip4 = 0;
+ return 1;
+ }
return 0;
}
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 2f01ac6c092..964e739550e 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -54,6 +54,9 @@ format_transport_proto (u8 * s, va_list * args)
case TRANSPORT_PROTO_UDP:
s = format (s, "UDP");
break;
+ case TRANSPORT_PROTO_SCTP:
+ s = format (s, "SCTP");
+ break;
}
return s;
}
@@ -86,6 +89,10 @@ unformat_transport_proto (unformat_input_t * input, va_list * args)
*proto = TRANSPORT_PROTO_UDP;
else if (unformat (input, "UDP"))
*proto = TRANSPORT_PROTO_UDP;
+ if (unformat (input, "sctp"))
+ *proto = TRANSPORT_PROTO_SCTP;
+ else if (unformat (input, "SCTP"))
+ *proto = TRANSPORT_PROTO_SCTP;
else
return 0;
return 1;
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h
index 61a2b7b8aa6..12b6a0551d8 100644
--- a/src/vnet/session/transport.h
+++ b/src/vnet/session/transport.h
@@ -70,6 +70,7 @@ typedef enum _transport_proto
{
TRANSPORT_PROTO_TCP,
TRANSPORT_PROTO_UDP,
+ TRANSPORT_PROTO_SCTP,
TRANSPORT_N_PROTO
} transport_proto_t;
@@ -110,7 +111,7 @@ transport_endpoint_fib_proto (transport_endpoint_t * tep)
always_inline u8
transport_is_stream (u8 proto)
{
- return (proto == TRANSPORT_PROTO_TCP);
+ return ((proto == TRANSPORT_PROTO_TCP) || (proto == TRANSPORT_PROTO_SCTP));
}
always_inline u8