aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/defs.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-02-24 12:58:20 +0000
committerDamjan Marion <dmarion@me.com>2020-02-24 15:47:53 +0000
commit1103c8c04adf06c7d14d1d5064490b03aa0b7dd1 (patch)
tree21386b0bd75edc1870eed110913fffc9fc1165d6 /src/vlib/defs.h
parent6e495ce428e110665ee9616e0951015963502cac (diff)
vlib: Alias RX or TX to direction
Type: improvement for those that find that name usefull. Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I6c99bcdbb10ca1615aeea6924c2d93a68b5b7684
Diffstat (limited to 'src/vlib/defs.h')
-rw-r--r--src/vlib/defs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vlib/defs.h b/src/vlib/defs.h
index ad58bc04681..a09a25b701f 100644
--- a/src/vlib/defs.h
+++ b/src/vlib/defs.h
@@ -48,8 +48,16 @@ typedef enum
VLIB_N_RX_TX = 2, /* Used to size arrays. */
} vlib_rx_or_tx_t;
+
#define vlib_foreach_rx_tx(v) for (v = 0; v < VLIB_N_RX_TX; v++)
+/* alias the rx/tx to 'direction' */
+typedef vlib_rx_or_tx_t vlib_dir_t;
+
+#define VLIB_N_DIR VLIB_N_RX_TX
+#define FOREACH_VLIB_DIR(_dir) \
+ for (_dir = VLIB_RX; _dir <= VLIB_TX; _dir++)
+
/* Read/write. */
typedef enum
{