Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
SPAN: Add 'is_l2" flag to DETAILS response messages.
[vpp.git]
/
src
/
vat
/
api_format.c
diff --git
a/src/vat/api_format.c
b/src/vat/api_format.c
index
9962561
..
7bb463c
100644
(file)
--- a/
src/vat/api_format.c
+++ b/
src/vat/api_format.c
@@
-7782,7
+7782,7
@@
api_tap_create_v2 (vat_main_t * vam)
u8 host_ip6_gw_set = 0;
u32 host_ip6_prefix_len = 0;
int ret;
u8 host_ip6_gw_set = 0;
u32 host_ip6_prefix_len = 0;
int ret;
-
int
rx_ring_sz = 0, tx_ring_sz = 0;
+
u32
rx_ring_sz = 0, tx_ring_sz = 0;
memset (mac_address, 0, sizeof (mac_address));
memset (mac_address, 0, sizeof (mac_address));
@@
-7793,7
+7793,7
@@
api_tap_create_v2 (vat_main_t * vam)
{
random_mac = 0;
}
{
random_mac = 0;
}
- else if (unformat (i, "id %
s
", &id))
+ else if (unformat (i, "id %
u
", &id))
;
else if (unformat (i, "host-if-name %s", &host_if_name))
;
;
else if (unformat (i, "host-if-name %s", &host_if_name))
;
@@
-7875,15
+7875,15
@@
api_tap_create_v2 (vat_main_t * vam)
mp->use_random_mac = random_mac;
mp->use_random_mac = random_mac;
- mp->id =
id
;
+ mp->id =
ntohl (id)
;
mp->host_namespace_set = host_ns != 0;
mp->host_bridge_set = host_bridge != 0;
mp->host_ip4_addr_set = host_ip4_prefix_len != 0;
mp->host_ip6_addr_set = host_ip6_prefix_len != 0;
mp->host_namespace_set = host_ns != 0;
mp->host_bridge_set = host_bridge != 0;
mp->host_ip4_addr_set = host_ip4_prefix_len != 0;
mp->host_ip6_addr_set = host_ip6_prefix_len != 0;
- mp->rx_ring_sz =
rx_ring_sz
;
- mp->tx_ring_sz =
tx_ring_sz
;
+ mp->rx_ring_sz =
ntohs (rx_ring_sz)
;
+ mp->tx_ring_sz =
ntohs (tx_ring_sz)
;
- if (random_mac)
+ if (random_mac
== 0
)
clib_memcpy (mp->mac_address, mac_address, 6);
if (host_mac_addr_set)
clib_memcpy (mp->host_mac_addr, host_mac_addr, 6);
clib_memcpy (mp->mac_address, mac_address, 6);
if (host_mac_addr_set)
clib_memcpy (mp->host_mac_addr, host_mac_addr, 6);
@@
-8872,7
+8872,7
@@
api_bier_route_add_del (vat_main_t * vam)
}
/* Construct the API message */
}
/* Construct the API message */
- M2 (BIER_ROUTE_ADD_DEL, mp, sizeof (vl_api_fib_path
3
_t));
+ M2 (BIER_ROUTE_ADD_DEL, mp, sizeof (vl_api_fib_path_t));
mp->br_is_add = is_add;
mp->br_tbl_id.bt_set = set;
mp->br_is_add = is_add;
mp->br_tbl_id.bt_set = set;
@@
-8881,7
+8881,7
@@
api_bier_route_add_del (vat_main_t * vam)
mp->br_bp = ntohs (bp);
mp->br_n_paths = 1;
mp->br_paths[0].n_labels = 1;
mp->br_bp = ntohs (bp);
mp->br_n_paths = 1;
mp->br_paths[0].n_labels = 1;
- mp->br_paths[0].label_stack[0] = ntohl (next_hop_out_label);
+ mp->br_paths[0].label_stack[0]
.label
= ntohl (next_hop_out_label);
mp->br_paths[0].afi = (next_hop_proto_is_ip4 ? 0 : 1);
if (next_hop_proto_is_ip4)
mp->br_paths[0].afi = (next_hop_proto_is_ip4 ? 0 : 1);
if (next_hop_proto_is_ip4)
@@
-19634,7
+19634,7
@@
api_netmap_delete (vat_main_t * vam)
}
static void
}
static void
-vl_api_mpls_fib_path_print (vat_main_t * vam, vl_api_fib_path
2
_t * fp)
+vl_api_mpls_fib_path_print (vat_main_t * vam, vl_api_fib_path_t * fp)
{
if (fp->afi == IP46_TYPE_IP6)
print (vam->ofp,
{
if (fp->afi == IP46_TYPE_IP6)
print (vam->ofp,
@@
-19654,7
+19654,7
@@
vl_api_mpls_fib_path_print (vat_main_t * vam, vl_api_fib_path2_t * fp)
static void
vl_api_mpls_fib_path_json_print (vat_json_node_t * node,
static void
vl_api_mpls_fib_path_json_print (vat_json_node_t * node,
- vl_api_fib_path
2
_t * fp)
+ vl_api_fib_path_t * fp)
{
struct in_addr ip4;
struct in6_addr ip6;
{
struct in_addr ip4;
struct in6_addr ip6;
@@
-19683,7
+19683,7
@@
vl_api_mpls_tunnel_details_t_handler (vl_api_mpls_tunnel_details_t * mp)
{
vat_main_t *vam = &vat_main;
int count = ntohl (mp->mt_count);
{
vat_main_t *vam = &vat_main;
int count = ntohl (mp->mt_count);
- vl_api_fib_path
2
_t *fp;
+ vl_api_fib_path_t *fp;
i32 i;
print (vam->ofp, "[%d]: sw_if_index %d via:",
i32 i;
print (vam->ofp, "[%d]: sw_if_index %d via:",
@@
-19707,7
+19707,7
@@
vl_api_mpls_tunnel_details_t_handler_json (vl_api_mpls_tunnel_details_t * mp)
vat_main_t *vam = &vat_main;
vat_json_node_t *node = NULL;
int count = ntohl (mp->mt_count);
vat_main_t *vam = &vat_main;
vat_json_node_t *node = NULL;
int count = ntohl (mp->mt_count);
- vl_api_fib_path
2
_t *fp;
+ vl_api_fib_path_t *fp;
i32 i;
if (VAT_JSON_ARRAY != vam->json_tree.type)
i32 i;
if (VAT_JSON_ARRAY != vam->json_tree.type)
@@
-19773,7
+19773,7
@@
vl_api_mpls_fib_details_t_handler (vl_api_mpls_fib_details_t * mp)
{
vat_main_t *vam = &vat_main;
int count = ntohl (mp->count);
{
vat_main_t *vam = &vat_main;
int count = ntohl (mp->count);
- vl_api_fib_path
2
_t *fp;
+ vl_api_fib_path_t *fp;
int i;
print (vam->ofp,
int i;
print (vam->ofp,
@@
-19793,7
+19793,7
@@
static void vl_api_mpls_fib_details_t_handler_json
vat_main_t *vam = &vat_main;
int count = ntohl (mp->count);
vat_json_node_t *node = NULL;
vat_main_t *vam = &vat_main;
int count = ntohl (mp->count);
vat_json_node_t *node = NULL;
- vl_api_fib_path
2
_t *fp;
+ vl_api_fib_path_t *fp;
int i;
if (VAT_JSON_ARRAY != vam->json_tree.type)
int i;
if (VAT_JSON_ARRAY != vam->json_tree.type)
@@
-20522,8
+20522,9
@@
vl_api_sw_interface_span_details_t_handler (vl_api_sw_interface_span_details_t
}
}));
/* *INDENT-ON* */
}
}));
/* *INDENT-ON* */
- print (vam->ofp, "%20s => %20s (%s)",
- sw_if_from_name, sw_if_to_name, states[mp->state]);
+ print (vam->ofp, "%20s => %20s (%s) %s",
+ sw_if_from_name, sw_if_to_name, states[mp->state],
+ mp->is_l2 ? "l2" : "device");
}
static void
}
static void
@@
-20572,6
+20573,7
@@
static void
vat_json_object_add_string_copy (node, "dst-if-name", sw_if_to_name);
}
vat_json_object_add_uint (node, "state", mp->state);
vat_json_object_add_string_copy (node, "dst-if-name", sw_if_to_name);
}
vat_json_object_add_uint (node, "state", mp->state);
+ vat_json_object_add_uint (node, "is-l2", mp->is_l2);
}
static int
}
static int
@@
-22776,7
+22778,7
@@
_(tap_delete, \
"<vpp-if-name> | sw_if_index <id>") \
_(sw_interface_tap_dump, "") \
_(tap_create_v2, \
"<vpp-if-name> | sw_if_index <id>") \
_(sw_interface_tap_dump, "") \
_(tap_create_v2, \
- "
name <name
> [hw-addr <mac-addr>] [host-ns <name>] [rx-ring-size <num> [tx-ring-size <num>]") \
+ "
id <num
> [hw-addr <mac-addr>] [host-ns <name>] [rx-ring-size <num> [tx-ring-size <num>]") \
_(tap_delete_v2, \
"<vpp-if-name> | sw_if_index <id>") \
_(sw_interface_tap_v2_dump, "") \
_(tap_delete_v2, \
"<vpp-if-name> | sw_if_index <id>") \
_(sw_interface_tap_v2_dump, "") \