summaryrefslogtreecommitdiff
path: root/lib/vty.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.h')
-rw-r--r--lib/vty.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/vty.h b/lib/vty.h
index 0839f7fb68..0980f73afa 100644
--- a/lib/vty.h
+++ b/lib/vty.h
@@ -166,6 +166,11 @@ static inline void vty_push_context(struct vty *vty, int node, uint64_t id)
#define VTY_DECLVAR_CONTEXT_SUB(structname, ptr) \
struct structname *ptr = VTY_GET_CONTEXT_SUB(structname); \
VTY_CHECK_CONTEXT(ptr);
+#define VTY_DECLVAR_INSTANCE_CONTEXT(structname, ptr) \
+ if (vty->qobj_index == 0) \
+ return CMD_NOT_MY_INSTANCE; \
+ struct structname *ptr = VTY_GET_CONTEXT(structname); \
+ VTY_CHECK_CONTEXT(ptr);
struct vty_arg {
const char *name;