#ifndef UI_H #define UI_H #include #include #include "list.h" enum ui_event_id { UI_EVT_SCROLL_LEFT, UI_EVT_SCROLL_RIGHT, }; enum ui_align { UI_ALIGN_LEFT, UI_ALIGN_RIGHT, }; struct ui_text { chtype *str; size_t slen; size_t len; }; struct ui_col { struct list_head entry; uint32_t id; char *name; uint32_t len; int pos; int color; enum ui_align align; }; struct ui_table { int y; int x; int rows_y; struct list_head cols; struct ui_text *row; int hdr_color; int col_pad; int width; int height; int scroll_x; }; extern void ui_table_init(struct ui_table *tbl); extern void ui_table_uninit(struct ui_table *tbl); extern void ui_table_clear(struct ui_table *tbl); extern void ui_table_pos_set(struct ui_table *tbl, int y, int x); extern void ui_table_height_set(struct ui_table *tbl, int height); extern void ui_table_col_add(struct ui_table *tbl, uint32_t id, char *name, uint32_t len); extern void ui_table_col_color_set(struct ui_table *tbl, int col_id, int color); extern void ui_table_col_align_set(struct ui_table *tbl, int col_id, enum ui_align align); extern void ui_table_row_add(struct ui_table *tbl); extern void ui_table_row_show(struct ui_table *tbl); extern void ui_table_row_col_set(struct ui_table *tbl, uint32_t col_id, const char *str); extern void ui_table_header_color_set(struct ui_table *tbl, int color); extern void ui_table_header_print(struct ui_table *tbl); extern void ui_table_event_send(struct ui_table *tbl, enum ui_event_id id); #endif /* UI_H */ t.git/'>summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2017-02-08 11:16:30 +0100
committerDavid S. Miller <davem@davemloft.net>2017-02-08 15:25:16 -0500
commitc53b8e1b5a6a84da753d8b19c4f59fd8b693d579 (patch)
tree3e635e40bea26b4e55b495277e11c966a7244af6
parente9ad5e7d8d3cf55ceb204b0f7a26c89bfd4b41fe (diff)
mlxsw: spectrum_router: Store nexthops in a hash table
Later in the patchset we'll add the NH_{ADD,DEL} events which will let us know when a nexthop is considered to be dead. Based on these events we need to be able to add or remove the nexthop from the device's tables. Therefore, store the private nexthop structs in a hash table and use the kernel's fib_nh struct as the key, so that we'll be able to easily find them when the events are received. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.h1
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c58
2 files changed, 55 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h