diff options
| author | David Lamparter <equinox@diac24.net> | 2016-12-15 21:34:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-15 21:34:53 +0100 |
| commit | f4e454eb79a6d63f0fba83635047215ac6cf0e5f (patch) | |
| tree | 402711325312b6367fbde3c9baf1f144d1723f5d /ospf6d/ospf6_interface.c | |
| parent | bb49a12161b8ab63bdf2f2f3f1566aa1bb32d124 (diff) | |
| parent | 5304ba7e560fc9b5f13fd5657e370d726714673b (diff) | |
Merge branch 'dev/osr/vty_index'
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_interface.c')
| -rw-r--r-- | ospf6d/ospf6_interface.c | 76 |
1 files changed, 25 insertions, 51 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 74c9ac739f..0ed8d30a8b 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -46,6 +46,7 @@ #include "ospf6_bfd.h" DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names") +DEFINE_QOBJ_TYPE(ospf6_interface) unsigned char conf_debug_ospf6_interface = 0; @@ -212,6 +213,8 @@ ospf6_interface_create (struct interface *ifp) oi->ifmtu = iobuflen; } + QOBJ_REG (oi, ospf6_interface); + oi->lsupdate_list = ospf6_lsdb_create (oi); oi->lsack_list = ospf6_lsdb_create (oi); oi->lsdb = ospf6_lsdb_create (oi); @@ -238,6 +241,8 @@ ospf6_interface_delete (struct ospf6_interface *oi) struct listnode *node, *nnode; struct ospf6_neighbor *on; + QOBJ_UNREG (oi); + for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) ospf6_neighbor_delete (on); @@ -1097,14 +1102,13 @@ DEFUN (ipv6_ospf6_ifmtu, "OSPFv3 Interface MTU\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; unsigned int ifmtu, iobuflen; struct listnode *node, *nnode; struct ospf6_neighbor *on; - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1158,13 +1162,12 @@ DEFUN (no_ipv6_ospf6_ifmtu, "Interface MTU\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; unsigned int iobuflen; struct listnode *node, *nnode; struct ospf6_neighbor *on; - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1206,12 +1209,11 @@ DEFUN (ipv6_ospf6_cost, "Outgoing metric of this interface\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; unsigned long int lcost; - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1247,10 +1249,8 @@ DEFUN (no_ipv6_ospf6_cost, "Calculate interface cost from bandwidth\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1272,8 +1272,8 @@ DEFUN (auto_cost_reference_bandwidth, "Use reference bandwidth method to assign OSPF cost\n" "The reference bandwidth in terms of Mbits per second\n") { + VTY_DECLVAR_CONTEXT(ospf6, o); int idx_number = 2; - struct ospf6 *o = vty->index; struct ospf6_area *oa; struct ospf6_interface *oi; struct listnode *i, *j; @@ -1306,7 +1306,7 @@ DEFUN (no_auto_cost_reference_bandwidth, "Use reference bandwidth method to assign OSPF cost\n" "The reference bandwidth in terms of Mbits per second\n") { - struct ospf6 *o = vty->index; + VTY_DECLVAR_CONTEXT(ospf6, o); struct ospf6_area *oa; struct ospf6_interface *oi; struct listnode *i, *j; @@ -1332,11 +1332,9 @@ DEFUN (ipv6_ospf6_hellointerval, SECONDS_STR ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1358,11 +1356,9 @@ DEFUN (ipv6_ospf6_deadinterval, SECONDS_STR ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1383,11 +1379,9 @@ DEFUN (ipv6_ospf6_transmitdelay, "Link state transmit delay\n" SECONDS_STR) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1409,11 +1403,9 @@ DEFUN (ipv6_ospf6_retransmitinterval, SECONDS_STR ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1435,11 +1427,9 @@ DEFUN (ipv6_ospf6_priority, "Priority value\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1467,11 +1457,9 @@ DEFUN (ipv6_ospf6_instance, "Instance ID value\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_number = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *)vty->index; assert (ifp); oi = (struct ospf6_interface *)ifp->info; @@ -1491,12 +1479,11 @@ DEFUN (ipv6_ospf6_passive, "Passive interface; no adjacency will be formed on this interface\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; struct listnode *node, *nnode; struct ospf6_neighbor *on; - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1525,10 +1512,8 @@ DEFUN (no_ipv6_ospf6_passive, "passive interface: No Adjacency will be formed on this I/F\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1552,10 +1537,8 @@ DEFUN (ipv6_ospf6_mtu_ignore, "Disable MTU mismatch detection on this interface\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1577,10 +1560,8 @@ DEFUN (no_ipv6_ospf6_mtu_ignore, "Disable MTU mismatch detection on this interface\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1603,11 +1584,9 @@ DEFUN (ipv6_ospf6_advertise_prefix_list, "Prefix list name\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_word = 4; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1645,10 +1624,8 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list, "Filter prefix using prefix-list\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1688,11 +1665,9 @@ DEFUN (ipv6_ospf6_network, "Specify OSPF6 point-to-point network\n" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); int idx_network = 3; struct ospf6_interface *oi; - struct interface *ifp; - - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; @@ -1733,11 +1708,10 @@ DEFUN (no_ipv6_ospf6_network, "Default to whatever interface type system specifies" ) { + VTY_DECLVAR_CONTEXT(interface, ifp); struct ospf6_interface *oi; - struct interface *ifp; int type; - ifp = (struct interface *) vty->index; assert (ifp); oi = (struct ospf6_interface *) ifp->info; |
