mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-05 08:31:53 +00:00
CLI: v2 compatibility mode for attribute name display
Also fixed display of bgp_otc (was just "otc" before).
This commit is contained in:
parent
c3c12e1b4f
commit
4c59e20968
@ -1293,16 +1293,25 @@ connects to it. If changed on the command line by the <tt/-s/ option,
|
|||||||
BIRD or the CLI tool connects there instead.
|
BIRD or the CLI tool connects there instead.
|
||||||
|
|
||||||
<p>It's also possible to configure additional remote control sockets in the
|
<p>It's also possible to configure additional remote control sockets in the
|
||||||
configuration file by <cf/cli "name";/ and you can open how many
|
configuration file by <cf/cli "name" { <m/options/ };/ and you can open how many
|
||||||
sockets you wish. There are no checks whether the user configured the same
|
sockets you wish. There are no checks whether the user configured the same
|
||||||
socket multiple times and BIRD may behave weirdly if this happens. On shutdown,
|
socket multiple times and BIRD may behave weirdly if this happens. On shutdown,
|
||||||
the additional sockets get removed immediately and only the main socket stays
|
the additional sockets get removed immediately and only the main socket stays
|
||||||
until the very end.
|
until the very end. If there are no options, the braces may be omitted.
|
||||||
|
|
||||||
<p>The remote control socket can be also set as restricted by
|
<p>Options:
|
||||||
<cf/cli "name" { restrict; };/ instead of sending the <cf/restrict/ command
|
|
||||||
after connecting. The user may still overload the daemon by requesting insanely
|
<descrip>
|
||||||
complex filters so you shouldn't expose this socket to public anyway.
|
<tag><label id="cli-conf-restrict">restrict</tag>
|
||||||
|
Set the socket to be restricted as if the user always sent the
|
||||||
|
<cf/restrict/ command after connecting. The user may still overload
|
||||||
|
the daemon by requesting insanely complex filters so you shouldn't
|
||||||
|
expose this socket to public even if restricted.
|
||||||
|
|
||||||
|
<tag><label id="cli-conf-v2-attributes">v2 attributes</tag>
|
||||||
|
Display the names and composition of route attributes the same way as BIRD 2 does.
|
||||||
|
This is a compatibility option for easier transition from BIRD 2 to BIRD 3.
|
||||||
|
</descrip>
|
||||||
|
|
||||||
<sect>Usage
|
<sect>Usage
|
||||||
<label id="remote-control-usage">
|
<label id="remote-control-usage">
|
||||||
|
@ -267,6 +267,7 @@ struct ea_storage {
|
|||||||
struct ea_class {
|
struct ea_class {
|
||||||
#define EA_CLASS_INSIDE \
|
#define EA_CLASS_INSIDE \
|
||||||
const char *name; /* Name (both print and filter) */ \
|
const char *name; /* Name (both print and filter) */ \
|
||||||
|
const char *legacy_name; /* Name for printing in v2 sockets */ \
|
||||||
struct symbol *sym; /* Symbol to export to configs */ \
|
struct symbol *sym; /* Symbol to export to configs */ \
|
||||||
uint id; /* Autoassigned attribute ID */ \
|
uint id; /* Autoassigned attribute ID */ \
|
||||||
uint uc; /* Reference count */ \
|
uint uc; /* Reference count */ \
|
||||||
|
@ -320,6 +320,8 @@ cli_new(struct birdsock *sock, struct cli_config *cf)
|
|||||||
if (cf->restricted)
|
if (cf->restricted)
|
||||||
c->restricted = 1;
|
c->restricted = 1;
|
||||||
|
|
||||||
|
c->v2attributes = cf->v2attributes;
|
||||||
|
|
||||||
ev_schedule(c->event);
|
ev_schedule(c->event);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ typedef struct cli {
|
|||||||
struct config *main_config; /* Main config currently in use */
|
struct config *main_config; /* Main config currently in use */
|
||||||
int last_reply;
|
int last_reply;
|
||||||
int restricted; /* CLI is restricted to read-only commands */
|
int restricted; /* CLI is restricted to read-only commands */
|
||||||
|
bool v2attributes; /* Route attributes are mimicking BIRD 2 */
|
||||||
struct timeformat *tf; /* Time format override */
|
struct timeformat *tf; /* Time format override */
|
||||||
struct linpool *parser_pool; /* Pool used during parsing */
|
struct linpool *parser_pool; /* Pool used during parsing */
|
||||||
uint log_mask; /* Mask of allowed message levels */
|
uint log_mask; /* Mask of allowed message levels */
|
||||||
@ -63,6 +64,7 @@ struct cli_config {
|
|||||||
struct config *config;
|
struct config *config;
|
||||||
uint uid, gid, mode;
|
uint uid, gid, mode;
|
||||||
_Bool restricted;
|
_Bool restricted;
|
||||||
|
_Bool v2attributes;
|
||||||
};
|
};
|
||||||
#include "lib/tlists.h"
|
#include "lib/tlists.h"
|
||||||
|
|
||||||
|
@ -196,6 +196,7 @@ ea_gen_aspa_providers_format(const eattr *a, byte *buf, uint size)
|
|||||||
|
|
||||||
struct ea_class ea_gen_aspa_providers = {
|
struct ea_class ea_gen_aspa_providers = {
|
||||||
.name = "aspa_providers",
|
.name = "aspa_providers",
|
||||||
|
.legacy_name = "aspa_providers",
|
||||||
.type = T_CLIST,
|
.type = T_CLIST,
|
||||||
.format = ea_gen_aspa_providers_format,
|
.format = ea_gen_aspa_providers_format,
|
||||||
};
|
};
|
||||||
@ -1311,7 +1312,12 @@ ea_show(struct cli *c, const eattr *e)
|
|||||||
|
|
||||||
if (e->undef || cls->hidden)
|
if (e->undef || cls->hidden)
|
||||||
return;
|
return;
|
||||||
else if (cls->format)
|
|
||||||
|
const char *name = (c->v2attributes && !cls->conf) ? cls->legacy_name : cls->name;
|
||||||
|
if (!name)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (cls->format)
|
||||||
cls->format(e, buf, end - buf);
|
cls->format(e, buf, end - buf);
|
||||||
else
|
else
|
||||||
switch (e->type)
|
switch (e->type)
|
||||||
@ -1356,7 +1362,7 @@ ea_show(struct cli *c, const eattr *e)
|
|||||||
bsprintf(pos, "<type %02x>", e->type);
|
bsprintf(pos, "<type %02x>", e->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
cli_printf(c, -1012, "\t%s: %s", cls->name, buf);
|
cli_printf(c, -1012, "\t%s: %s", name, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
static void rt_show_cont(struct cli *c);
|
static void rt_show_cont(struct cli *c);
|
||||||
static void rt_show_done(struct rt_show_data *d);
|
static void rt_show_done(struct rt_show_data *d);
|
||||||
|
|
||||||
|
extern const char * const rta_src_names[RTS_MAX];
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rt_show_table(struct rt_show_data *d)
|
rt_show_table(struct rt_show_data *d)
|
||||||
{
|
{
|
||||||
@ -81,9 +83,19 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, int primary
|
|||||||
|
|
||||||
if (d->verbose)
|
if (d->verbose)
|
||||||
{
|
{
|
||||||
|
if (c->v2attributes)
|
||||||
|
{
|
||||||
|
ea_show_nexthop_list(c, nhad);
|
||||||
|
|
||||||
|
uint src = ea_get_int(a, &ea_gen_source, 0);
|
||||||
|
cli_printf(c, -1008, "\tType: %s univ", rta_src_names[src]);
|
||||||
|
}
|
||||||
|
|
||||||
ea_show_list(c, a);
|
ea_show_list(c, a);
|
||||||
cli_printf(c, -1008, "\tInternal route handling values: %luL %uG %uS id %u",
|
|
||||||
e->src->private_id, e->src->global_id, e->stale_cycle, e->id);
|
if (!c->v2attributes)
|
||||||
|
cli_printf(c, -1008, "\tInternal route handling values: %luL %uG %uS id %u",
|
||||||
|
e->src->private_id, e->src->global_id, e->stale_cycle, e->id);
|
||||||
}
|
}
|
||||||
else if (dest == RTD_UNICAST)
|
else if (dest == RTD_UNICAST)
|
||||||
ea_show_nexthop_list(c, nhad);
|
ea_show_nexthop_list(c, nhad);
|
||||||
|
@ -2206,11 +2206,13 @@ babel_router_id_format(const eattr *a, byte *buf, uint len)
|
|||||||
|
|
||||||
static struct ea_class ea_babel_metric = {
|
static struct ea_class ea_babel_metric = {
|
||||||
.name = "babel_metric",
|
.name = "babel_metric",
|
||||||
|
.legacy_name = "Babel.metric",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ea_class ea_babel_router_id = {
|
static struct ea_class ea_babel_router_id = {
|
||||||
.name = "babel_router_id",
|
.name = "babel_router_id",
|
||||||
|
.legacy_name = "Babel.router_id",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.readonly = 1,
|
.readonly = 1,
|
||||||
.format = babel_router_id_format,
|
.format = babel_router_id_format,
|
||||||
@ -2218,6 +2220,7 @@ static struct ea_class ea_babel_router_id = {
|
|||||||
|
|
||||||
static struct ea_class ea_babel_seqno = {
|
static struct ea_class ea_babel_seqno = {
|
||||||
.name = "babel_seqno",
|
.name = "babel_seqno",
|
||||||
|
.legacy_name = "Babel.seqno",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.readonly = 1,
|
.readonly = 1,
|
||||||
.hidden = 1,
|
.hidden = 1,
|
||||||
|
@ -1058,6 +1058,7 @@ bgp_format_unknown(const eattr *a, byte *buf, uint size)
|
|||||||
static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
||||||
[BA_ORIGIN] = {
|
[BA_ORIGIN] = {
|
||||||
.name = "bgp_origin",
|
.name = "bgp_origin",
|
||||||
|
.legacy_name = "BGP.origin",
|
||||||
.type = T_ENUM_BGP_ORIGIN,
|
.type = T_ENUM_BGP_ORIGIN,
|
||||||
.flags = BAF_TRANSITIVE,
|
.flags = BAF_TRANSITIVE,
|
||||||
.export = bgp_export_origin,
|
.export = bgp_export_origin,
|
||||||
@ -1067,6 +1068,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_AS_PATH] = {
|
[BA_AS_PATH] = {
|
||||||
.name = "bgp_path",
|
.name = "bgp_path",
|
||||||
|
.legacy_name = "BGP.as_path",
|
||||||
.type = T_PATH,
|
.type = T_PATH,
|
||||||
.flags = BAF_TRANSITIVE,
|
.flags = BAF_TRANSITIVE,
|
||||||
.encode = bgp_encode_as_path,
|
.encode = bgp_encode_as_path,
|
||||||
@ -1074,6 +1076,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_NEXT_HOP] = {
|
[BA_NEXT_HOP] = {
|
||||||
.name = "bgp_next_hop",
|
.name = "bgp_next_hop",
|
||||||
|
.legacy_name = "BGP.next_hop",
|
||||||
.type = T_IP,
|
.type = T_IP,
|
||||||
.flags = BAF_TRANSITIVE,
|
.flags = BAF_TRANSITIVE,
|
||||||
.encode = bgp_encode_next_hop,
|
.encode = bgp_encode_next_hop,
|
||||||
@ -1082,6 +1085,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_MULTI_EXIT_DISC] = {
|
[BA_MULTI_EXIT_DISC] = {
|
||||||
.name = "bgp_med",
|
.name = "bgp_med",
|
||||||
|
.legacy_name = "BGP.med",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.flags = BAF_OPTIONAL,
|
.flags = BAF_OPTIONAL,
|
||||||
.encode = bgp_encode_u32,
|
.encode = bgp_encode_u32,
|
||||||
@ -1089,6 +1093,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_LOCAL_PREF] = {
|
[BA_LOCAL_PREF] = {
|
||||||
.name = "bgp_local_pref",
|
.name = "bgp_local_pref",
|
||||||
|
.legacy_name = "BGP.local_pref",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.flags = BAF_TRANSITIVE,
|
.flags = BAF_TRANSITIVE,
|
||||||
.export = bgp_export_local_pref,
|
.export = bgp_export_local_pref,
|
||||||
@ -1097,6 +1102,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_ATOMIC_AGGR] = {
|
[BA_ATOMIC_AGGR] = {
|
||||||
.name = "bgp_atomic_aggr",
|
.name = "bgp_atomic_aggr",
|
||||||
|
.legacy_name = "BGP.atomic_aggr",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.flags = BAF_TRANSITIVE,
|
.flags = BAF_TRANSITIVE,
|
||||||
.encode = bgp_encode_raw,
|
.encode = bgp_encode_raw,
|
||||||
@ -1104,6 +1110,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_AGGREGATOR] = {
|
[BA_AGGREGATOR] = {
|
||||||
.name = "bgp_aggregator",
|
.name = "bgp_aggregator",
|
||||||
|
.legacy_name = "BGP.aggregator",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
.encode = bgp_encode_aggregator,
|
.encode = bgp_encode_aggregator,
|
||||||
@ -1112,6 +1119,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_COMMUNITY] = {
|
[BA_COMMUNITY] = {
|
||||||
.name = "bgp_community",
|
.name = "bgp_community",
|
||||||
|
.legacy_name = "BGP.community",
|
||||||
.type = T_CLIST,
|
.type = T_CLIST,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
.export = bgp_export_community,
|
.export = bgp_export_community,
|
||||||
@ -1120,6 +1128,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_ORIGINATOR_ID] = {
|
[BA_ORIGINATOR_ID] = {
|
||||||
.name = "bgp_originator_id",
|
.name = "bgp_originator_id",
|
||||||
|
.legacy_name = "BGP.originator_id",
|
||||||
.type = T_QUAD,
|
.type = T_QUAD,
|
||||||
.flags = BAF_OPTIONAL,
|
.flags = BAF_OPTIONAL,
|
||||||
.export = bgp_export_originator_id,
|
.export = bgp_export_originator_id,
|
||||||
@ -1128,6 +1137,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_CLUSTER_LIST] = {
|
[BA_CLUSTER_LIST] = {
|
||||||
.name = "bgp_cluster_list",
|
.name = "bgp_cluster_list",
|
||||||
|
.legacy_name = "BGP.cluster_list",
|
||||||
.type = T_CLIST,
|
.type = T_CLIST,
|
||||||
.flags = BAF_OPTIONAL,
|
.flags = BAF_OPTIONAL,
|
||||||
.export = bgp_export_cluster_list,
|
.export = bgp_export_cluster_list,
|
||||||
@ -1137,6 +1147,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_MP_REACH_NLRI] = {
|
[BA_MP_REACH_NLRI] = {
|
||||||
.name = "bgp_mp_reach_nlri",
|
.name = "bgp_mp_reach_nlri",
|
||||||
|
.legacy_name = "BGP.mp_reach_nlri",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.hidden = 1,
|
.hidden = 1,
|
||||||
.flags = BAF_OPTIONAL,
|
.flags = BAF_OPTIONAL,
|
||||||
@ -1144,6 +1155,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_MP_UNREACH_NLRI] = {
|
[BA_MP_UNREACH_NLRI] = {
|
||||||
.name = "bgp_mp_unreach_nlri",
|
.name = "bgp_mp_unreach_nlri",
|
||||||
|
.legacy_name = "BGP.mp_unreach_nlri",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.hidden = 1,
|
.hidden = 1,
|
||||||
.flags = BAF_OPTIONAL,
|
.flags = BAF_OPTIONAL,
|
||||||
@ -1151,6 +1163,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_EXT_COMMUNITY] = {
|
[BA_EXT_COMMUNITY] = {
|
||||||
.name = "bgp_ext_community",
|
.name = "bgp_ext_community",
|
||||||
|
.legacy_name = "BGP.ext_community",
|
||||||
.type = T_ECLIST,
|
.type = T_ECLIST,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
.export = bgp_export_ext_community,
|
.export = bgp_export_ext_community,
|
||||||
@ -1159,6 +1172,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_AS4_PATH] = {
|
[BA_AS4_PATH] = {
|
||||||
.name = "bgp_as4_path",
|
.name = "bgp_as4_path",
|
||||||
|
.legacy_name = "BGP.as4_path",
|
||||||
.type = T_PATH,
|
.type = T_PATH,
|
||||||
.hidden = 1,
|
.hidden = 1,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
@ -1167,6 +1181,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_AS4_AGGREGATOR] = {
|
[BA_AS4_AGGREGATOR] = {
|
||||||
.name = "bgp_as4_aggregator",
|
.name = "bgp_as4_aggregator",
|
||||||
|
.legacy_name = "BGP.as4_aggregator",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.hidden = 1,
|
.hidden = 1,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
@ -1176,6 +1191,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_AIGP] = {
|
[BA_AIGP] = {
|
||||||
.name = "bgp_aigp",
|
.name = "bgp_aigp",
|
||||||
|
.legacy_name = "BGP.aigp",
|
||||||
.type = T_OPAQUE,
|
.type = T_OPAQUE,
|
||||||
.flags = BAF_OPTIONAL | BAF_DECODE_FLAGS,
|
.flags = BAF_OPTIONAL | BAF_DECODE_FLAGS,
|
||||||
.export = bgp_export_aigp,
|
.export = bgp_export_aigp,
|
||||||
@ -1185,6 +1201,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_LARGE_COMMUNITY] = {
|
[BA_LARGE_COMMUNITY] = {
|
||||||
.name = "bgp_large_community",
|
.name = "bgp_large_community",
|
||||||
|
.legacy_name = "BGP.large_community",
|
||||||
.type = T_LCLIST,
|
.type = T_LCLIST,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
.export = bgp_export_large_community,
|
.export = bgp_export_large_community,
|
||||||
@ -1192,7 +1209,8 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
.decode = bgp_decode_large_community,
|
.decode = bgp_decode_large_community,
|
||||||
},
|
},
|
||||||
[BA_ONLY_TO_CUSTOMER] = {
|
[BA_ONLY_TO_CUSTOMER] = {
|
||||||
.name = "otc",
|
.name = "bgp_otc",
|
||||||
|
.legacy_name = "BGP.otc",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
.flags = BAF_OPTIONAL | BAF_TRANSITIVE,
|
||||||
.encode = bgp_encode_u32,
|
.encode = bgp_encode_u32,
|
||||||
@ -1200,6 +1218,7 @@ static union bgp_attr_desc bgp_attr_table[BGP_ATTR_MAX] = {
|
|||||||
},
|
},
|
||||||
[BA_MPLS_LABEL_STACK] = {
|
[BA_MPLS_LABEL_STACK] = {
|
||||||
.name = "bgp_mpls_label_stack",
|
.name = "bgp_mpls_label_stack",
|
||||||
|
.legacy_name = "BGP.mpls_label_stack",
|
||||||
.type = T_CLIST,
|
.type = T_CLIST,
|
||||||
.readonly = 1,
|
.readonly = 1,
|
||||||
.export = bgp_export_mpls_label_stack,
|
.export = bgp_export_mpls_label_stack,
|
||||||
|
@ -1527,22 +1527,26 @@ struct protocol proto_ospf = {
|
|||||||
|
|
||||||
struct ea_class ea_ospf_metric1 = {
|
struct ea_class ea_ospf_metric1 = {
|
||||||
.name = "ospf_metric1",
|
.name = "ospf_metric1",
|
||||||
|
.legacy_name = "OSPF.metric1",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ea_class ea_ospf_metric2 = {
|
struct ea_class ea_ospf_metric2 = {
|
||||||
.name = "ospf_metric2",
|
.name = "ospf_metric2",
|
||||||
|
.legacy_name = "OSPF.metric2",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ea_class ea_ospf_tag = {
|
struct ea_class ea_ospf_tag = {
|
||||||
.name = "ospf_tag",
|
.name = "ospf_tag",
|
||||||
|
.legacy_name = "OSPF.tag",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.format = ospf_tag_format,
|
.format = ospf_tag_format,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ea_class ea_ospf_router_id = {
|
struct ea_class ea_ospf_router_id = {
|
||||||
.name = "ospf_router_id",
|
.name = "ospf_router_id",
|
||||||
|
.legacy_name = "OSPF.router_id",
|
||||||
.type = T_QUAD,
|
.type = T_QUAD,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -754,12 +754,14 @@ radv_preference_format(const eattr *a, byte *buf, uint buflen)
|
|||||||
|
|
||||||
static struct ea_class ea_radv_preference = {
|
static struct ea_class ea_radv_preference = {
|
||||||
.name = "radv_preference",
|
.name = "radv_preference",
|
||||||
|
.legacy_name = "RAdv.preference",
|
||||||
.type = T_ENUM_RA_PREFERENCE,
|
.type = T_ENUM_RA_PREFERENCE,
|
||||||
.format = radv_preference_format,
|
.format = radv_preference_format,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ea_class ea_radv_lifetime = {
|
static struct ea_class ea_radv_lifetime = {
|
||||||
.name = "radv_lifetime",
|
.name = "radv_lifetime",
|
||||||
|
.legacy_name = "RAdv.lifetime",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1265,11 +1265,13 @@ rip_tag_format(const eattr *a, byte *buf, uint buflen)
|
|||||||
|
|
||||||
static struct ea_class ea_rip_metric = {
|
static struct ea_class ea_rip_metric = {
|
||||||
.name = "rip_metric",
|
.name = "rip_metric",
|
||||||
|
.legacy_name = "RIP.metric",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ea_class ea_rip_tag = {
|
static struct ea_class ea_rip_tag = {
|
||||||
.name = "rip_tag",
|
.name = "rip_tag",
|
||||||
|
.legacy_name = "RIP.tag",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.format = rip_tag_format,
|
.format = rip_tag_format,
|
||||||
};
|
};
|
||||||
|
@ -57,50 +57,56 @@ static struct f_val krt_bitfield_empty(const struct ea_class *cls UNUSED)
|
|||||||
static struct ea_class
|
static struct ea_class
|
||||||
ea_krt_prefsrc = {
|
ea_krt_prefsrc = {
|
||||||
.name = "krt_prefsrc",
|
.name = "krt_prefsrc",
|
||||||
|
.legacy_name = "Kernel.prefsrc",
|
||||||
.type = T_IP,
|
.type = T_IP,
|
||||||
},
|
},
|
||||||
ea_krt_realm = {
|
ea_krt_realm = {
|
||||||
.name = "krt_realm",
|
.name = "krt_realm",
|
||||||
|
.legacy_name = "Kernel.realm",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
},
|
},
|
||||||
ea_krt_scope = {
|
ea_krt_scope = {
|
||||||
.name = "krt_scope",
|
.name = "krt_scope",
|
||||||
|
.legacy_name = "Kernel.scope",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct ea_class ea_krt_metrics[] = {
|
static struct ea_class ea_krt_metrics[] = {
|
||||||
[RTAX_LOCK] = {
|
[RTAX_LOCK] = {
|
||||||
.name = "krt_lock",
|
.name = "krt_lock",
|
||||||
|
.legacy_name = "Kernel.lock",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.format = krt_bitfield_format,
|
.format = krt_bitfield_format,
|
||||||
.empty = krt_bitfield_empty,
|
.empty = krt_bitfield_empty,
|
||||||
},
|
},
|
||||||
[RTAX_FEATURES] = {
|
[RTAX_FEATURES] = {
|
||||||
.name = "krt_features",
|
.name = "krt_features",
|
||||||
|
.legacy_name = "Kernel.features",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
.format = krt_bitfield_format,
|
.format = krt_bitfield_format,
|
||||||
.empty = krt_bitfield_empty,
|
.empty = krt_bitfield_empty,
|
||||||
},
|
},
|
||||||
[RTAX_CC_ALGO] = {
|
[RTAX_CC_ALGO] = {
|
||||||
.name = "krt_congctl",
|
.name = "krt_congctl",
|
||||||
|
.legacy_name = "Kernel.congctl",
|
||||||
.type = T_STRING,
|
.type = T_STRING,
|
||||||
},
|
},
|
||||||
#define KRT_METRIC_INT(_rtax, _name) [_rtax] = { .name = _name, .type = T_INT }
|
#define KRT_METRIC_INT(_rtax, _name) [_rtax] = { .name = "krt_" _name, .legacy_name = "Kernel." _name, .type = T_INT }
|
||||||
KRT_METRIC_INT(RTAX_MTU, "krt_mtu"),
|
KRT_METRIC_INT(RTAX_MTU, "mtu"),
|
||||||
KRT_METRIC_INT(RTAX_WINDOW, "krt_window"),
|
KRT_METRIC_INT(RTAX_WINDOW, "window"),
|
||||||
KRT_METRIC_INT(RTAX_RTT, "krt_rtt"),
|
KRT_METRIC_INT(RTAX_RTT, "rtt"),
|
||||||
KRT_METRIC_INT(RTAX_RTTVAR, "krt_rttvar"),
|
KRT_METRIC_INT(RTAX_RTTVAR, "rttvar"),
|
||||||
KRT_METRIC_INT(RTAX_SSTHRESH, "krt_ssthresh"),
|
KRT_METRIC_INT(RTAX_SSTHRESH, "ssthresh"),
|
||||||
KRT_METRIC_INT(RTAX_CWND, "krt_cwnd"),
|
KRT_METRIC_INT(RTAX_CWND, "cwnd"),
|
||||||
KRT_METRIC_INT(RTAX_ADVMSS, "krt_advmss"),
|
KRT_METRIC_INT(RTAX_ADVMSS, "advmss"),
|
||||||
KRT_METRIC_INT(RTAX_REORDERING, "krt_reordering"),
|
KRT_METRIC_INT(RTAX_REORDERING, "reordering"),
|
||||||
KRT_METRIC_INT(RTAX_HOPLIMIT, "krt_hoplimit"),
|
KRT_METRIC_INT(RTAX_HOPLIMIT, "hoplimit"),
|
||||||
KRT_METRIC_INT(RTAX_INITCWND, "krt_initcwnd"),
|
KRT_METRIC_INT(RTAX_INITCWND, "initcwnd"),
|
||||||
KRT_METRIC_INT(RTAX_RTO_MIN, "krt_rto_min"),
|
KRT_METRIC_INT(RTAX_RTO_MIN, "rto_min"),
|
||||||
KRT_METRIC_INT(RTAX_INITRWND, "krt_initrwnd"),
|
KRT_METRIC_INT(RTAX_INITRWND, "initrwnd"),
|
||||||
KRT_METRIC_INT(RTAX_QUICKACK, "krt_quickack"),
|
KRT_METRIC_INT(RTAX_QUICKACK, "quickack"),
|
||||||
#ifdef RTAX_FASTOPEN_NO_COOKIE
|
#ifdef RTAX_FASTOPEN_NO_COOKIE
|
||||||
KRT_METRIC_INT(RTAX_FASTOPEN_NO_COOKIE, "krt_fastopen_no_cookie"),
|
KRT_METRIC_INT(RTAX_FASTOPEN_NO_COOKIE, "fastopen_no_cookie"),
|
||||||
#else
|
#else
|
||||||
#warning "Definition of RTAX_FASTOPEN_NO_COOKIE not found"
|
#warning "Definition of RTAX_FASTOPEN_NO_COOKIE not found"
|
||||||
#endif
|
#endif
|
||||||
|
@ -141,8 +141,9 @@ cli_opts_begin: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
cli_opts_block:
|
cli_opts_block:
|
||||||
/* EMPTY */ |
|
/* EMPTY */
|
||||||
cli_opts_block RESTRICT { this_cli_config->restricted = 1; }
|
| cli_opts_block RESTRICT ';' { this_cli_config->restricted = 1; }
|
||||||
|
| cli_opts_block V2 ATTRIBUTES ';' { this_cli_config->v2attributes = 1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
conf: THREADS expr {
|
conf: THREADS expr {
|
||||||
|
@ -986,11 +986,13 @@ krt_copy_config(struct proto_config *dest, struct proto_config *src)
|
|||||||
|
|
||||||
struct ea_class ea_krt_source = {
|
struct ea_class ea_krt_source = {
|
||||||
.name = "krt_source",
|
.name = "krt_source",
|
||||||
|
.legacy_name = "Kernel.source",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ea_class ea_krt_metric = {
|
struct ea_class ea_krt_metric = {
|
||||||
.name = "krt_metric",
|
.name = "krt_metric",
|
||||||
|
.legacy_name = "Kernel.metric",
|
||||||
.type = T_INT,
|
.type = T_INT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user