diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-11-17 15:45:05 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-11-17 15:45:05 +0100 |
commit | e04555c04545278cfe3aeae85d707b1d78e5abeb (patch) | |
tree | 19eb2904bbf4d5b3ada4c464ced28db176197d53 /nest | |
parent | d0e2d6d1e05455cf1ec4e71135edaa659fe96dac (diff) |
Implement description field of protocol.
Diffstat (limited to 'nest')
-rw-r--r-- | nest/config.Y | 3 | ||||
-rw-r--r-- | nest/proto.c | 3 | ||||
-rw-r--r-- | nest/protocol.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/nest/config.Y b/nest/config.Y index 4721112a..f2879430 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -44,7 +44,7 @@ CF_KEYWORDS(ROUTER, ID, PROTOCOL, PREFERENCE, DISABLED, DEBUG, ALL, OFF, DIRECT) CF_KEYWORDS(INTERFACE, IMPORT, EXPORT, FILTER, NONE, TABLE, STATES, ROUTES, FILTERS) CF_KEYWORDS(PASSWORD, FROM, PASSIVE, TO, ID, EVENTS, PACKETS, PROTOCOLS, INTERFACES) CF_KEYWORDS(PRIMARY, STATS, COUNT, FOR, COMMANDS, PREEXPORT, GENERATE) -CF_KEYWORDS(LISTEN, BGP, V6ONLY, ADDRESS, PORT, PASSWORDS) +CF_KEYWORDS(LISTEN, BGP, V6ONLY, ADDRESS, PORT, PASSWORDS, DESCRIPTION) CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT, RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE) @@ -141,6 +141,7 @@ proto_item: | EXPORT imexport { this_proto->out_filter = $2; } | TABLE rtable { this_proto->table = $2; } | ROUTER ID idval { this_proto->router_id = $3; } + | DESCRIPTION dsc { this_proto->dsc = $2; } ; imexport: diff --git a/nest/proto.c b/nest/proto.c index 7bb1286d..c05db767 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -307,6 +307,7 @@ protos_commit(struct config *new, struct config *old, int force_reconfig, int ty if (sym && sym->class == SYM_PROTO && !new->shutdown) { /* Found match, let's check if we can smoothly switch to new configuration */ + /* No need to check description */ nc = sym->def; if (!force_reconfig && nc->protocol == oc->protocol @@ -702,6 +703,8 @@ proto_do_show(struct proto *p, int verbose) buf); if (verbose) { + if (p->cf->dsc) + cli_msg(-1006, " Description: %s", p->cf->dsc); cli_msg(-1006, " Preference: %d", p->preference); cli_msg(-1006, " Input filter: %s", filter_name(p->in_filter)); cli_msg(-1006, " Output filter: %s", filter_name(p->out_filter)); diff --git a/nest/protocol.h b/nest/protocol.h index 484df846..807b579f 100644 --- a/nest/protocol.h +++ b/nest/protocol.h @@ -81,6 +81,7 @@ struct proto_config { struct protocol *protocol; /* Protocol */ struct proto *proto; /* Instance we've created */ char *name; + char *dsc; unsigned debug, preference, disabled; /* Generic parameters */ u32 router_id; /* Protocol specific router ID */ struct rtable_config *table; /* Table we're attached to */ |