Skip to content

Commit

Permalink
Basic IPC support to query status of daemon
Browse files Browse the repository at this point in the history
echo "help" |socat - UNIX-CONNECT:/run/querierd.sock

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Feb 8, 2022
1 parent fa435e1 commit 52e70b2
Show file tree
Hide file tree
Showing 5 changed files with 605 additions and 56 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Bridge Querier Helper
This daemon is a querier helper for the Linux bridge. Currently only
IGMP is supported, support for initiating MLD queries is planned.

Basic IPC support available:

echo "help" |socat - UNIX-CONNECT:/run/querierd.sock

> See `querierd -h` for help, e.g. to customize the IPC path.

Configuration
-------------
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ querierd_SOURCES = main.c cfparse.y config.c \
defs.h dvmrp.h \
iface.c iface.h netlink.c \
igmp.c igmpv2.h igmpv3.h \
inet.c kern.c log.c \
inet.c ipc.c kern.c log.c \
pev.c pev.h \
pathnames.h queue.h
querierd_CPPFLAGS = $(AM_CPPFLAGS)
Expand Down
22 changes: 12 additions & 10 deletions src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ typedef void (*ihfunc_t) (int);
#include "pathnames.h"
#include "pev.h"

#define NELEMS(a) (sizeof((a)) / sizeof((a)[0]))

/*
* External declarations for global variables and functions.
*/
Expand Down Expand Up @@ -129,11 +131,7 @@ extern const char *versionstring;
extern int cache_lifetime;
extern int prune_lifetime;
extern int mrt_table_id;
extern int debug_list(int, char *, size_t);
extern int debug_parse(char *);
extern void restart(void);
extern int register_input_handler(int, ihfunc_t);
extern void deregister_input_handler(int);

/* log.c */
extern void log_init(char *);
Expand Down Expand Up @@ -170,13 +168,13 @@ extern void netlink_exit(void);

/* config.c */
extern void config_set_ifflag(uint32_t);
extern struct ifi *config_iface_iter(int);
extern struct ifi *config_iface_add(char *);
extern struct ifi *config_iface_iter(int);
extern struct ifi *config_iface_add(char *);
extern void config_iface_addr_del(int, struct sockaddr *);
extern struct ifi *config_find_ifname(char *);
extern struct ifi *config_find_ifaddr(in_addr_t);
extern struct ifi *config_find_iface(int);
extern struct ifi *config_init_tunnel(in_addr_t, in_addr_t, uint32_t);
extern struct ifi *config_find_ifname(char *);
extern struct ifi *config_find_ifaddr(in_addr_t);
extern struct ifi *config_find_iface(int);
extern struct ifi *config_init_tunnel(in_addr_t, in_addr_t, uint32_t);
extern void config_iface_addr_add(int, struct sockaddr *, unsigned int);
extern void config_iface_from_kernel(void);

Expand All @@ -194,6 +192,10 @@ extern char *inet_fmts(uint32_t, uint32_t, char *, size_t);
extern uint32_t inet_parse(char *, int);
extern int inet_cksum(uint16_t *, uint32_t);

/* ipc.c */
extern void ipc_init(char *);
extern void ipc_exit(void);

/* kern.c */
extern int curttl;

Expand Down
Loading

0 comments on commit 52e70b2

Please sign in to comment.