summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-12-07 17:30:16 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2016-12-09 17:36:25 +0100
commita50b7cebd58520d7f7ddbb82214788bc794791ac (patch)
treedcf212f69beda2084d6c5c68a314eccb0e693546 /lib
parent52c6b0e20a94e29126e3ddb180704d9d4c87e14f (diff)
lib: remove vty->index
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/if.c2
-rw-r--r--lib/keychain.c2
-rw-r--r--lib/routemap.c2
-rw-r--r--lib/vrf.c2
-rw-r--r--lib/vty.h31
6 files changed, 8 insertions, 34 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index ffbbacc872..29584f82b5 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,7 +1,6 @@
## Process this file with automake to produce Makefile.in.
-AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
- -DVTY_DEPRECATE_INDEX
+AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib
AM_CFLAGS = $(WERROR)
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
AM_YFLAGS = -d
diff --git a/lib/if.c b/lib/if.c
index a1bac2ce81..fb12f201b2 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -784,7 +784,7 @@ DEFUN (interface,
vty_out (vty, "%% interface %s not in %s%s", ifname, vrfname, VTY_NEWLINE);
return CMD_WARNING;
}
- VTY_PUSH_CONTEXT_COMPAT (INTERFACE_NODE, ifp);
+ VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp);
return CMD_SUCCESS;
}
diff --git a/lib/keychain.c b/lib/keychain.c
index f8a3ffc012..cd8039b95b 100644
--- a/lib/keychain.c
+++ b/lib/keychain.c
@@ -251,7 +251,7 @@ DEFUN (key_chain,
struct keychain *keychain;
keychain = keychain_get (argv[idx_word]->arg);
- VTY_PUSH_CONTEXT_COMPAT (KEYCHAIN_NODE, keychain);
+ VTY_PUSH_CONTEXT (KEYCHAIN_NODE, keychain);
return CMD_SUCCESS;
}
diff --git a/lib/routemap.c b/lib/routemap.c
index d6a5b713c5..5f2b2c0dfb 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -2549,7 +2549,7 @@ DEFUN (route_map,
map = route_map_get (mapname);
index = route_map_index_get (map, permit, pref);
- VTY_PUSH_CONTEXT_COMPAT (RMAP_NODE, index);
+ VTY_PUSH_CONTEXT (RMAP_NODE, index);
return CMD_SUCCESS;
}
diff --git a/lib/vrf.c b/lib/vrf.c
index 0d0b1cc27d..14501c5265 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -494,7 +494,7 @@ DEFUN (vrf,
vrfp = vrf_get (VRF_UNKNOWN, vrfname);
- VTY_PUSH_CONTEXT_COMPAT (VRF_NODE, vrfp);
+ VTY_PUSH_CONTEXT (VRF_NODE, vrfp);
return CMD_SUCCESS;
}
diff --git a/lib/vty.h b/lib/vty.h
index 3ca9159211..24bdcd1817 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -29,14 +29,6 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#define VTY_BUFSIZ 512
#define VTY_MAXHIST 20
-#if defined(VTY_DEPRECATE_INDEX) && defined(__GNUC__) && \
- (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && \
- !defined(__ICC)
-#define INDEX_WARNING __attribute__((deprecated))
-#else
-#define INDEX_WARNING
-#endif
-
/* VTY struct. */
struct vty
{
@@ -82,10 +74,6 @@ struct vty
/* History insert end point */
int hindex;
- /* For current referencing point of interface, route-map,
- access-list etc... */
- void *index INDEX_WARNING;
-
/* qobj object ID (replacement for "index") */
uint64_t qobj_index;
@@ -139,32 +127,19 @@ struct vty
char address[SU_ADDRSTRLEN];
};
-#undef INDEX_WARNING
-
static inline void vty_push_context(struct vty *vty,
- int node, uint64_t id, void *idx)
+ int node, uint64_t id)
{
vty->node = node;
vty->qobj_index = id;
-#if defined(VTY_DEPRECATE_INDEX) && defined(__GNUC__) && \
- (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- vty->index = idx;
-#pragma GCC diagnostic pop
-#else
- vty->index = idx;
-#endif
}
/* note: VTY_PUSH_CONTEXT(..., NULL) doesn't work, since it will try to
* dereference "NULL->qobj_node.nid" */
#define VTY_PUSH_CONTEXT(nodeval, ptr) \
- vty_push_context(vty, nodeval, QOBJ_ID_0SAFE(ptr), NULL)
+ vty_push_context(vty, nodeval, QOBJ_ID_0SAFE(ptr))
#define VTY_PUSH_CONTEXT_NULL(nodeval) \
- vty_push_context(vty, nodeval, 0ULL, NULL)
-#define VTY_PUSH_CONTEXT_COMPAT(nodeval, ptr) \
- vty_push_context(vty, nodeval, QOBJ_ID_0SAFE(ptr), ptr)
+ vty_push_context(vty, nodeval, 0ULL)
#define VTY_PUSH_CONTEXT_SUB(nodeval, ptr) do { \
vty->node = nodeval; \
/* qobj_index stays untouched */ \