#ifndef _BGPLG_H
#define _BGPLG_H
#define NAME "bgplg"
#define BGPLG_TIMEOUT 60
struct cmd {
const char *name;
int minargs;
int maxargs;
const char *args;
char *earg[255];
int (*func)(struct cmd *, char **);
};
#define CMDS { \
{ "show ip bgp", 1, 1, "<prefix>", \
{ BGPCTL, "show", "ip", "bgp", NULL } }, \
{ "show ip bgp as", 1, 1, "<asnum>", \
{ BGPCTL, "show", "ip", "bgp", "as", NULL } }, \
{ "show ip bgp source-as", 1, 1, "<asnum>", \
{ BGPCTL, "show", "ip", "bgp", "source-as", NULL } }, \
{ "show ip bgp transit-as", 1, 1, "<asnum>", \
{ BGPCTL, "show", "ip", "bgp", "transit-as", NULL } }, \
{ "show ip bgp peer-as", 1, 1, "<asnum>", \
{ BGPCTL, "show", "ip", "bgp", "peer-as", NULL } }, \
{ "show ip bgp empty-as", 0, 0, NULL, \
{ BGPCTL, "show", "ip", "bgp", "empty-as", NULL } }, \
{ "show ip bgp summary", 0, 0, NULL, \
{ BGPCTL, "show", "ip", "bgp", "summary", NULL } }, \
{ "show ip bgp community", 1, 1, "<community>", \
{ BGPCTL, "show","ip", "bgp", "community", NULL } }, \
{ "show ip bgp detail community", 1, 1, "<community>", \
{ BGPCTL, "show","ip", "bgp", "detail", "community", NULL } },\
{ "show ip bgp ext-community", 2, 2, "<ext-community>", \
{ BGPCTL, "show","ip", "bgp", "ext-community", NULL } }, \
{ "show ip bgp detail ext-community", 2, 2, "<ext-community>",\
{ BGPCTL, "show","ip", "bgp", "detail", "ext-community", NULL } },\
{ "show ip bgp large-community", 1, 1, "<large-community>",\
{ BGPCTL, "show","ip", "bgp", "large-community", NULL } }, \
{ "show ip bgp detail large-community", 1, 1, "<large-community>",\
{ BGPCTL, "show","ip", "bgp", "detail", "large-community", NULL } },\
{ "show ip bgp detail", 1, 1, "<prefix>", \
{ BGPCTL, "show","ip", "bgp", "detail", NULL } }, \
{ "show ip bgp detail as", 1, 1, "<asnum>", \
{ BGPCTL, "show","ip", "bgp", "detail", "as", NULL } }, \
{ "show ip bgp in", 1, 1, "<neighbor>", \
{ BGPCTL, "show","ip", "bgp", "in", "neighbor", NULL } }, \
{ "show ip bgp out", 1, 1, "<neighbor>", \
{ BGPCTL, "show","ip", "bgp", "out", "neighbor", NULL } }, \
{ "show ip bgp ovs", 1, 1, "<state>", \
{ BGPCTL, "show","ip", "bgp", "ovs", NULL } }, \
{ "show ip bgp avs", 1, 1, "<state>", \
{ BGPCTL, "show","ip", "bgp", "avs", NULL } }, \
{ "show ip bgp memory", 0, 0, NULL, \
{ BGPCTL, "show", "ip", "bgp", "memory", NULL } }, \
{ "show neighbor", 0, 1, NULL, \
{ BGPCTL, "show", "neighbor", NULL } }, \
{ "show nexthop", 0, 0, NULL, \
{ BGPCTL, "show", "nexthop", NULL } }, \
{ "traceroute", 1, 1, "<address>", \
{ TRACEROUTE, "-ASl", NULL } }, \
{ "ping", 1, 1, "<address>", \
{ PING, "-c4", "-w2", NULL } }, \
{ "traceroute6", 1, 1, "<address>", \
{ TRACEROUTE6, "-Al", NULL } }, \
{ "ping6", 1, 1, "<address>", \
{ PING6, "-c4", "-i2", NULL } }, \
{ "help", 0, 0, NULL, { NULL }, lg_help }, \
{ NULL } \
}
int lg_help(struct cmd *, char **);
int lg_exec(const char *, char **);
int lg_checkperm(struct cmd *);
void lg_sig_alarm(int);
ssize_t lg_strip(char *);
#endif