summaryrefslogtreecommitdiffstats
path: root/src/peer_group.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/peer_group.h')
-rw-r--r--src/peer_group.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/peer_group.h b/src/peer_group.h
index edba73e..69974a4 100644
--- a/src/peer_group.h
+++ b/src/peer_group.h
@@ -95,3 +95,17 @@ struct fastd_peer_group {
const fastd_peer_t *_peer = (peer); \
_peer ? fastd_peer_group_lookup(_peer->group, attr) : &conf.peer_group->attr; \
})
+
+/**
+ Looks up an shell command attribute in the peer group tree, for a given peer
+
+ Returns a pointer to the attribute, going up the group tree to the first group
+ where the attribute is not NULL if such a group exists. Uses the default group
+ if no peer is given.
+
+ @param peer the peer
+ @param attr the name of the shell command member
+
+ \hideinitializer
+ */
+#define fastd_peer_group_lookup_peer_shell_command(peer, attr) container_of(fastd_peer_group_lookup_peer(peer, attr.command), fastd_shell_command_t, command)