From 5c47cbfedf3a7b73d45a206ab8f0e9e0297c2b12 Mon Sep 17 00:00:00 2001 From: Geoff Salmon Date: Tue, 8 Jan 2013 19:21:23 -0500 Subject: [PATCH] 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. --- transport.c | 4 ++-- transport.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/transport.c b/transport.c index 713f018..a06530c 100644 --- a/transport.c +++ b/transport.c @@ -56,6 +56,8 @@ int transport_peer(struct transport *t, struct fdarray *fda, int event, struct transport *transport_create(enum transport_type type) { switch (type) { + case TRANS_UDS: + return uds_transport_create(); case TRANS_UDP_IPV4: return udp_transport_create(); case TRANS_UDP_IPV6: @@ -66,8 +68,6 @@ struct transport *transport_create(enum transport_type type) case TRANS_CONTROLNET: case TRANS_PROFINET: break; - case TRANS_UDS: - return uds_transport_create(); } return NULL; } diff --git a/transport.h b/transport.h index 03fcb79..d714b85 100644 --- a/transport.h +++ b/transport.h @@ -24,14 +24,16 @@ #include "fd.h" +/* Values from networkProtocol enumeration 7.4.1 Table 3 */ 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_IEEE_802_3, TRANS_DEVICENET, TRANS_CONTROLNET, TRANS_PROFINET, - TRANS_UDS, }; /**