summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/transport.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-04-09 09:24:52 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2018-04-18 07:23:46 +0000
commit7fb0fe1f6972a7a35146fa9115b866ba29a6fbb7 (patch)
tree46f1236450ae918383bf56204b98a68199d28501 /src/vnet/session/transport.c
parent684d08c7e5378af5310346e9219a79ef1d901084 (diff)
udp/session: refactor to support dgram mode
- adds session layer support for datagram based protocols - updates udp to work in pure connectionless and datagram mode. The existing connected mode is now 'accessible' for apps as a dummy UDPC, as in, connected udp, protocol. - updates udp_echo, echo client, echo server code to work in datagram mode. Change-Id: I2960c0d2d246cb166005f545794ec31fe0d546dd Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/transport.c')
-rw-r--r--src/vnet/session/transport.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 797bdad1eaa..20b912929b4 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -57,6 +57,9 @@ format_transport_proto (u8 * s, va_list * args)
case TRANSPORT_PROTO_SCTP:
s = format (s, "SCTP");
break;
+ case TRANSPORT_PROTO_UDPC:
+ s = format (s, "UDPC");
+ break;
}
return s;
}
@@ -76,6 +79,9 @@ format_transport_proto_short (u8 * s, va_list * args)
case TRANSPORT_PROTO_SCTP:
s = format (s, "S");
break;
+ case TRANSPORT_PROTO_UDPC:
+ s = format (s, "U");
+ break;
}
return s;
}
@@ -100,6 +106,10 @@ unformat_transport_proto (unformat_input_t * input, va_list * args)
*proto = TRANSPORT_PROTO_TLS;
else if (unformat (input, "TLS"))
*proto = TRANSPORT_PROTO_TLS;
+ else if (unformat (input, "udpc"))
+ *proto = TRANSPORT_PROTO_UDPC;
+ else if (unformat (input, "UDPC"))
+ *proto = TRANSPORT_PROTO_UDPC;
else
return 0;
return 1;
@@ -185,6 +195,12 @@ transport_protocol_get_vft (transport_proto_t transport_proto)
return &tp_vfts[transport_proto];
}
+transport_service_type_t
+transport_protocol_service_type (transport_proto_t tp)
+{
+ return tp_vfts[tp].service_type;
+}
+
#define PORT_MASK ((1 << 16)- 1)
void