aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-16 15:30:15 -0700
committerDave Barach <openvpp@barachs.net>2019-07-17 12:20:50 +0000
commit6e8b811ee409bff97996cd60d2ae04e884fd66d3 (patch)
tree5de28f3fbed978826da91fb5eb77362ebcb1a160 /src/vnet
parent2062ec0d67fb83fa25fc938c992a8e882612c777 (diff)
session: move constants definition
Type:refactor Change-Id: Ie4a89ae603cd365b28795c92daa08d5943e692ea Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/session/session_table.h2
-rw-r--r--src/vnet/session/session_types.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/vnet/session/session_table.h b/src/vnet/session/session_table.h
index bf33d50dda6..4aaa900f0c9 100644
--- a/src/vnet/session/session_table.h
+++ b/src/vnet/session/session_table.h
@@ -55,8 +55,6 @@ typedef struct _session_lookup_table
#define SESSION_TABLE_INVALID_INDEX ((u32)~0)
#define SESSION_LOCAL_TABLE_PREFIX ((u32)~0)
-#define SESSION_INVALID_INDEX ((u32)~0)
-#define SESSION_INVALID_HANDLE ((u64)~0)
#define SESSION_DROP_HANDLE (((u64)~0) - 1)
typedef int (*ip4_session_table_walk_fn_t) (clib_bihash_kv_16_8_t * kvp,
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h
index 21188bb0308..1c03aa25672 100644
--- a/src/vnet/session/session_types.h
+++ b/src/vnet/session/session_types.h
@@ -19,6 +19,9 @@
#include <svm/svm_fifo.h>
#include <vnet/session/transport_types.h>
+#define SESSION_INVALID_INDEX ((u32)~0)
+#define SESSION_INVALID_HANDLE ((u64)~0)
+
#define foreach_session_endpoint_fields \
foreach_transport_endpoint_cfg_fields \
_(u8, transport_proto) \
python import sys import os import logging """ @var formatting delimiter consisting of '=' characters """ double_line_delim = '=' * 78 """ @var formatting delimiter consisting of '-' characters """ single_line_delim = '-' * 78 def colorize(msg, color): return color + msg + COLOR_RESET class ColorFormatter(logging.Formatter): def init(self, fmt=None, datefmt=None): super(ColorFormatter, self).__init__(fmt, datefmt) def format(self, record): message = super(ColorFormatter, self).format(record) if hasattr(record, 'color'): message = colorize(message, record.color) return message try: verbose = int(os.getenv("V", 0)) except: verbose = 0 # 40 = ERROR, 30 = WARNING, 20 = INFO, 10 = DEBUG, 0 = NOTSET (all messages) if verbose >= 2: log_level = 10 elif verbose == 1: log_level = 20 else: log_level = 40 handler = logging.StreamHandler(sys.stdout) handler.setFormatter(ColorFormatter(fmt='%(asctime)s,%(msecs)03d %(message)s', datefmt="%H:%M:%S")) handler.setLevel(log_level) global_logger = logging.getLogger() global_logger.addHandler(handler) scapy_logger = logging.getLogger("scapy.runtime") scapy_logger.setLevel(logging.ERROR) def getLogger(name): logger = logging.getLogger(name) logger.setLevel(logging.DEBUG) return logger # Static variables to store color formatting strings. # # These variables (RED, GREEN, YELLOW and LPURPLE) are used to configure # the color of the text to be printed in the terminal. Variable COLOR_RESET # is used to revert the text color to the default one. if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(): RED = '\033[91m' GREEN = '\033[92m' YELLOW = '\033[93m' LPURPLE = '\033[94m' COLOR_RESET = '\033[0m' else: RED = '' GREEN = '' YELLOW = '' LPURPLE = '' COLOR_RESET = ''