Make enum transport_type match the networkProtocol enumeration

This means no conversion is necessary between the transport_type and
the networkProtocol field of the PortAddress struct. Not currently an
issue, but will be needed for implementing the CLOCK_DESCRIPTION
management TLV.
master
Geoff Salmon 2013-01-08 19:21:23 -05:00 committed by Richard Cochran
parent 7607774f30
commit 5c47cbfedf
2 changed files with 6 additions and 4 deletions

View File

@ -56,6 +56,8 @@ int transport_peer(struct transport *t, struct fdarray *fda, int event,
struct transport *transport_create(enum transport_type type) struct transport *transport_create(enum transport_type type)
{ {
switch (type) { switch (type) {
case TRANS_UDS:
return uds_transport_create();
case TRANS_UDP_IPV4: case TRANS_UDP_IPV4:
return udp_transport_create(); return udp_transport_create();
case TRANS_UDP_IPV6: case TRANS_UDP_IPV6:
@ -66,8 +68,6 @@ struct transport *transport_create(enum transport_type type)
case TRANS_CONTROLNET: case TRANS_CONTROLNET:
case TRANS_PROFINET: case TRANS_PROFINET:
break; break;
case TRANS_UDS:
return uds_transport_create();
} }
return NULL; return NULL;
} }

View File

@ -24,14 +24,16 @@
#include "fd.h" #include "fd.h"
/* Values from networkProtocol enumeration 7.4.1 Table 3 */
enum transport_type { enum transport_type {
TRANS_UDP_IPV4, /* 0 is Reserved in spec. Use it for UDS */
TRANS_UDS = 0,
TRANS_UDP_IPV4 = 1,
TRANS_UDP_IPV6, TRANS_UDP_IPV6,
TRANS_IEEE_802_3, TRANS_IEEE_802_3,
TRANS_DEVICENET, TRANS_DEVICENET,
TRANS_CONTROLNET, TRANS_CONTROLNET,
TRANS_PROFINET, TRANS_PROFINET,
TRANS_UDS,
}; };
/** /**