From 231d9c689bf76d4e8e2c9ebf909bd4612c068e97 Mon Sep 17 00:00:00 2001 From: Chris Cappuccio Date: Sat, 4 Jun 2016 21:41:36 -0700 Subject: [PATCH 1/2] superfluous check for kernel ppp auth secret --- ppp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppp.c b/ppp.c index f219b0be..d20490c8 100644 --- a/ppp.c +++ b/ppp.c @@ -395,7 +395,7 @@ conf_sppp_mh(FILE *output, struct sauthreq *spa, char *ifname, char *pfx) char type[TYPESZ]; StringList *req; - if (!(spa->proto | spa->name[0] | spa->secret[0] | (spa->flags & + if (!(spa->proto | spa->name[0] | (spa->flags & AUTHFLAG_NOCALLOUT) | (spa->flags & AUTHFLAG_NORECHALLENGE))) return; fprintf(output, " %s", pfx); From 63b02f320868f17ad0464a5938f8d7217b5556fb Mon Sep 17 00:00:00 2001 From: Chris Cappuccio Date: Sun, 5 Jun 2016 11:08:26 -0700 Subject: [PATCH 2/2] basic support for eigrpd/eigrpctl through ctl framework a flush/clear function for ctl daemons needs to be developed (clear neighbors, etc.) --- commands.c | 3 +++ commands.h | 12 ++++++++++++ ctl.c | 21 +++++++++++++++++++++ externs.h | 3 +++ 4 files changed, 39 insertions(+) diff --git a/commands.c b/commands.c index b4032627..46d0739d 100644 --- a/commands.c +++ b/commands.c @@ -165,6 +165,7 @@ Menu showlist[] = { { "bgp", "BGP information", CMPL(ta) (char **)bgcs, sizeof(struct prot1), 0, 4, pr_prot1 }, { "ospf", "OSPF information", CMPL(ta) (char **)oscs, sizeof(struct prot1), 0, 3, pr_prot1 }, { "ospf6", "OSPF6 information", CMPL(ta) (char **)os6cs, sizeof(struct prot1), 0, 3, pr_prot1 }, + { "eigrp", "EIGRP information", CMPL(ta) (char **)eics, sizeof(struct prot1), 0, 3, pr_prot1 }, { "rip", "RIP information", CMPL(ta) (char **)rics, sizeof(struct prot1), 0, 3, pr_prot1 }, { "ldp", "LDP information", CMPL(ta) (char **)lics, sizeof(struct prot1), 0, 3, pr_prot1 }, { "ike", "IKE information", CMPL(ta) (char **)ikcs, sizeof(struct prot1), 0, 3, pr_prot1 }, @@ -819,6 +820,7 @@ static char pfhelp[] = "Packet filter control", ospfhelp[] = "OSPF control", ospf6help[] = "OSPF6 control", + eigrphelp[] = "EIGRP control", bgphelp[] = "BGP control", riphelp[] = "RIP control", ldphelp[] = "LDP control", @@ -897,6 +899,7 @@ Command cmdtab[] = { { "pf", pfhelp, CMPL(t) (char **)ctl_pf, ssctl, ctlhandler, 1, 0, 1 }, { "ospf", ospfhelp, CMPL(t) (char **)ctl_ospf, ssctl, ctlhandler, 1, 0, 1 }, { "ospf6", ospf6help, CMPL(t) (char **)ctl_ospf6, ssctl, ctlhandler, 1, 0, 1 }, + { "eigrp", eigrphelp, CMPL(t) (char **)ctl_eigrp, ssctl, ctlhandler, 1, 0, 1 }, { "bgp", bgphelp, CMPL(t) (char **)ctl_bgp, ssctl, ctlhandler, 1, 0, 1 }, { "rip", riphelp, CMPL(t) (char **)ctl_rip, ssctl, ctlhandler, 1, 0, 1 }, { "ldp", ldphelp, CMPL(t) (char **)ctl_ldp, ssctl, ctlhandler, 1, 0, 1 }, diff --git a/commands.h b/commands.h index 68363a97..dddaebe6 100644 --- a/commands.h +++ b/commands.h @@ -111,6 +111,18 @@ struct prot1 os6cs[] = { { 0, 0, { 0 } } }; +struct prot1 eics[] = { + { "interfaces", "Interface", + { EIGRPCTL, "show", "interfaces", OPT, OPT, NULL } }, + { "neighbor", "Neighbor", + { EIGRPCTL, "show", "neighbor", OPT, OPT, NULL } }, + { "topology", "Topology", + { EIGRPCTL, "show", "topology", OPT, OPT, NULL } }, + { "traffic", "Traffic", + { EIGRPCTL, "show", "traffic", OPT, OPT, NULL } }, + { 0, 0, { 0 } } +}; + struct prot1 rics[] = { { "fib", "Forward Information Base", { RIPCTL, "show", "fib", OPT, NULL } }, diff --git a/ctl.c b/ctl.c index a8610094..43c8bc4b 100644 --- a/ctl.c +++ b/ctl.c @@ -30,6 +30,7 @@ /* service daemons */ #define OSPFD "/usr/sbin/ospfd" #define OSPF6D "/usr/sbin/ospf6d" +#define EIGRPD "/usr/sbin/eigrpd" #define BGPD "/usr/sbin/bgpd" #define RIPD "/usr/sbin/ripd" #define ISAKMPD "/sbin/isakmpd" @@ -71,6 +72,7 @@ struct daemons ctl_daemons[] = { { "pf", "PF", ctl_pf, PFCONF_TEMP, 0600, 1, 0 }, { "ospf", "OSPF", ctl_ospf, OSPFCONF_TEMP, 0600, 0, RT_TABLEID_MAX }, { "ospf6", "OSPF6",ctl_ospf6, OSPF6CONF_TEMP, 0600, 0, RT_TABLEID_MAX }, +{ "eigrp", "EIGRP",ctl_eigrp, EIGRPCONF_TEMP, 0600, 0, RT_TABLEID_MAX }, { "bgp", "BGP", ctl_bgp, BGPCONF_TEMP, 0600, 0, 0 }, { "rip", "RIP", ctl_rip, RIPCONF_TEMP, 0600, 0, RT_TABLEID_MAX }, { "ldp", "LDP", ctl_ldp, LDPCONF_TEMP, 0600, 0, 0 }, @@ -160,6 +162,25 @@ struct ctl ctl_ospf6[] = { { 0, 0, { 0 }, 0, 0, 0 } }; +/* eigrpd, eigrpctl */ +char *ctl_eigrp_test[] = { EIGRPD, "-nf", REQTEMP, '\0' }; +struct ctl ctl_eigrp[] = { + { "enable", "enable service", + { EIGRPD, "-f", REQTEMP, NULL }, NULL, DB_X_ENABLE, T_EXEC }, + { "disable", "disable service", + { PKILL, table, "eigrpd", NULL }, NULL, DB_X_DISABLE, T_EXEC }, + { "edit", "edit configuration", + { "eigrp", (char *)ctl_eigrp_test, NULL }, call_editor, 0, + T_HANDLER_FILL1 }, + { "reload", "reload service", + { EIGRPCTL, "reload", NULL }, NULL, 0, T_EXEC }, + { "fib", "fib couple/decouple", + { EIGRPCTL, "fib", REQ, NULL }, NULL, 0, T_EXEC }, + { "log", "log brief/verbose", + { EIGRPCTL, "lob", REQ, NULL }, NULL, 0, T_EXEC }, + { 0, 0, { 0 }, 0, 0, 0 } +}; + /* bgpd, bgpctl */ char *ctl_bgp_test[] = { BGPD, "-nf", REQTEMP, NULL, '\0' }; struct ctl ctl_bgp[] = { diff --git a/externs.h b/externs.h index 55215418..92a50825 100644 --- a/externs.h +++ b/externs.h @@ -127,6 +127,7 @@ extern char metricnames[]; #define PFCONF_TEMP "/var/run/pf.conf" #define OSPFCONF_TEMP "/var/run/ospfd.conf" #define OSPF6CONF_TEMP "/var/run/ospf6d.conf" +#define EIGRPCONF_TEMP "/var/run/eigrpd.conf" #define BGPCONF_TEMP "/var/run/bgpd.conf" #define RIPCONF_TEMP "/var/run/ripd.conf" #define LDPCONF_TEMP "/var/run/ldpd.conf" @@ -166,6 +167,7 @@ void rmtemp(char *); #define PFCTL "/sbin/pfctl" #define OSPFCTL "/usr/sbin/ospfctl" #define OSPF6CTL "/usr/sbin/ospf6ctl" +#define EIGRPCTL "/usr/sbin/eigrpctl" #define BGPCTL "/usr/sbin/bgpctl" #define RIPCTL "/usr/sbin/ripctl" #define LDPCTL "/usr/sbin/ldpctl" @@ -200,6 +202,7 @@ extern struct daemons ctl_daemons[]; extern struct ctl ctl_pf[]; extern struct ctl ctl_ospf[]; extern struct ctl ctl_ospf6[]; +extern struct ctl ctl_eigrp[]; extern struct ctl ctl_relay[]; extern struct ctl ctl_bgp[]; extern struct ctl ctl_rip[];