aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/udp/udp.h
diff options
context:
space:
mode:
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