aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_types.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-21 16:07:46 -0700
committerDave Barach <openvpp@barachs.net>2020-04-03 22:10:22 +0000
commit00e01d3e875bb18397ff81e0f58f9b468477f473 (patch)
tree277b9ce692a465644de5d3481b42e6cce6394f46 /src/vnet/session/session_types.h
parent39aa7a5202a6a875bd6f5d341cb07f19ab0bf51e (diff)
session: improve error reporting
Type: improvement Change-Id: I9dd850a1ce85b0adb5136233f176117e0ee38817 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_types.h')
-rw-r--r--src/vnet/session/session_types.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h
index a0360136b1d..ca5dcc1c123 100644
--- a/src/vnet/session/session_types.h
+++ b/src/vnet/session/session_types.h
@@ -433,6 +433,53 @@ typedef struct session_dgram_header_
STATIC_ASSERT (sizeof (session_dgram_hdr_t) == (SESSION_CONN_ID_LEN + 8),
"session conn id wrong length");
+
+#define foreach_session_error \
+ _(NONE, "no error") \
+ _(UNKNOWN, "generic/unknown error") \
+ _(REFUSED, "refused") \
+ _(TIMEDOUT, "timedout") \
+ _(ALLOC, "obj/memory allocation error") \
+ _(NOROUTE, "no route") \
+ _(NOINTF, "no resolving interface") \
+ _(NOIP, "no ip for lcl interface") \
+ _(NOPORT, "no lcl port") \
+ _(NOSUPPORT, "not supported") \
+ _(PORTINUSE, "lcl port in use") \
+ _(IPINUSE, "ip in use") \
+ _(ALREADY_LISTENING, "ip port pair already listened on") \
+ _(INVALID_RMT_IP, "invalid remote ip") \
+ _(SEG_NO_SPACE, "Couldn't allocate a fifo pair") \
+ _(SEG_NO_SPACE2, "Created segment, couldn't allocate a fifo pair") \
+ _(SEG_CREATE, "Couldn't create a new segment") \
+ _(FILTERED, "session filtered") \
+ _(SCOPE, "scope not supported") \
+ _(BAPI_NO_FD, "bapi doesn't have a socket fd") \
+ _(BAPI_SEND_FD, "couldn't send fd over bapi socket fd") \
+ _(BAPI_NO_REG, "app bapi registration not found") \
+ _(MQ_MSG_ALLOC, "failed to alloc mq msg") \
+ _(TLS_HANDSHAKE, "failed tls handshake") \
+
+typedef enum session_error_p_
+{
+#define _(sym, str) SESSION_EP_##sym,
+ foreach_session_error
+#undef _
+ SESSION_N_ERRORS
+} session_error_p_t;
+
+typedef enum session_error_
+{
+#define _(sym, str) SESSION_E_##sym = -SESSION_EP_##sym,
+ foreach_session_error
+#undef _
+} session_error_t;
+
+/* Maintained for compatibility. Will be deprecated */
+#define SESSION_ERROR_SEG_CREATE SESSION_E_SEG_CREATE
+#define SESSION_ERROR_NO_SPACE SESSION_E_SEG_NO_SPACE
+#define SESSION_ERROR_NEW_SEG_NO_SPACE SESSION_E_SEG_NO_SPACE2
+
#endif /* SRC_VNET_SESSION_SESSION_TYPES_H_ */
/*