26 u32 *pool_indices = 0;
27 int current_status = 99;
48 vec_add1 (pool_indices, dp - mm->devices);
52 s =
format (s,
"{%smactime%s: [\n", q, q);
54 for (i = 0; i <
vec_len (pool_indices); i++)
67 if (now >= start0 && now <= end0)
98 s =
format (s,
"{%smac_address%s: %s%s%s, ", q, q, q, macstring, q);
100 switch (current_status)
103 status_string =
"static drop";
106 status_string =
"static allow";
109 status_string =
"dynamic drop";
112 status_string =
"dynamic allow";
115 status_string =
"d-quota inact";
118 status_string =
"d-quota activ";
121 status_string =
"code bug!";
127 s =
format (s,
"%sname%s: %s%s%s, %sstatus%s: %s%s%s,",
128 q, q, q, dp->
device_name, q, q, q, q, status_string, q);
129 s =
format (s,
"%sallow_pkts%s: %lld,", q, q, allow.
packets);
130 s =
format (s,
"%sallow_bytes%s: %lld,", q, q, allow.
bytes);
139 s =
format (s,
", %sip4_address%s: %s%U%s", q, q,
162 void (*fp) (
void *,
char *, int);
166 "http_static_server_register_builtin_handler");
#define MACTIME_DEVICE_FLAG_DYNAMIC_ALLOW_QUOTA
vlib_combined_counter_main_t drop_counters
const mac_address_t * ip_neighbor_get_mac(const ip_neighbor_t *ipn)
static int handle_get_mactime(http_builtin_method_type_t reqtype, u8 *request, http_session_t *hs)
const ip46_address_t * ip_neighbor_get_ip(const ip_neighbor_t *ipn)
u32 data_offset
Current data send offset.
#define MACTIME_DEVICE_FLAG_DYNAMIC_ALLOW
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Combined counter to hold both packets and byte differences.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
enum walk_rc_t_ walk_rc_t
Walk return code.
clib_timebase_range_t * ranges
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static f64 clib_timebase_now(clib_timebase_t *tb)
A representation of an IP neighbour/peer.
#define MACTIME_DEVICE_FLAG_STATIC_ALLOW
int free_data
Need to free data in detach_cache_entry.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
mactime_main_t mactime_main
counter_t packets
packet counter
u8 * data
File data, a vector.
vlib_combined_counter_main_t allow_counters
#define MACTIME_DEVICE_FLAG_DYNAMIC_DROP
format_function_t format_ip46_address
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define vec_free(V)
Free vector's memory (no header).
void ip_neighbor_walk(ip46_type_t type, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
#define clib_warning(format, args...)
f64 clib_timebase_find_sunday_midnight(f64 start_time)
void mactime_url_init(vlib_main_t *vm)
mactime_device_t * devices
u32 cache_pool_index
File cache pool index.
static walk_rc_t mactime_ip_neighbor_copy(index_t ipni, void *ctx)
#define MACTIME_DEVICE_FLAG_STATIC_DROP
Always drop packets from this device.
void * vlib_get_plugin_symbol(char *plugin_name, char *symbol_name)
http_builtin_method_type_t
counter_t bytes
byte counter
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 * format_mac_address(u8 *s, va_list *args)
ip_neighbor_t * ip_neighbor_get(index_t ipni)