summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-01 02:50:13 +0000
committerDave Barach <openvpp@barachs.net>2020-04-01 19:20:55 +0000
commit9c4ec6fc2c0994c5fdbe0491f6223a9c98ed153e (patch)
tree6318a71678fb83183cd89f388ce35d3fef8013aa /src/vnet/udp/udp.h
parenta039620c2eec19a6c2e525645eeb0728a1c18c8d (diff)
udp: improvements to cli
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2180e8d5cae6f94a256f3b62950cf66b6ee0e59a
Diffstat (limited to 'src/vnet/udp/udp.h')
-rw-r--r--src/vnet/udp/udp.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/vnet/udp/udp.h b/src/vnet/udp/udp.h
index 32e660be12f..736e3ce94f1 100644
--- a/src/vnet/udp/udp.h
+++ b/src/vnet/udp/udp.h
@@ -34,11 +34,25 @@ typedef enum
UDP_N_ERROR,
} udp_error_t;
-typedef enum
+#define foreach_udp_connection_flag \
+ _(CONNECTED, "CONNECTED") /**< connected mode */ \
+ _(OWNS_PORT, "OWNS_PORT") /**< port belong to conn (UDPC) */ \
+ _(CLOSING, "CLOSING") /**< conn closed with data */ \
+ _(LISTEN, "LISTEN") /**< conn is listening */ \
+
+enum udp_conn_flags_bits
+{
+#define _(sym, str) UDP_CONN_F_BIT_##sym,
+ foreach_udp_connection_flag
+#undef _
+ UDP_CONN_N_FLAGS
+};
+
+typedef enum udp_conn_flags_
{
- UDP_CONN_F_CONNECTED = 1 << 0, /**< connected mode */
- UDP_CONN_F_OWNS_PORT = 1 << 1, /**< port belong to conn (UDPC) */
- UDP_CONN_F_CLOSING = 1 << 2, /**< conn closed with data */
+#define _(sym, str) UDP_CONN_F_##sym = 1 << UDP_CONN_F_BIT_##sym,
+ foreach_udp_connection_flag
+#undef _
} udp_conn_flags_t;
typedef struct