diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-02-10 16:00:28 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-02-10 16:00:28 +0000 |
commit | 55bc8fead207fcb2aafe414ce84073f147ebce39 (patch) | |
tree | 377bbd9c61e9ac6c5c78e215ef961e8922dfc986 /src/include | |
parent | fe28e76256c4ff7d1af53ad3940bf737f6000107 (diff) | |
download | bcnm-55bc8fead207fcb2aafe414ce84073f147ebce39.tar.xz |
Add bcnm-waitif
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/bcnm/bcnm.h | 16 | ||||
-rw-r--r-- | src/include/bcnm/if.h | 22 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/include/bcnm/bcnm.h b/src/include/bcnm/bcnm.h new file mode 100644 index 0000000..f3d5bf2 --- /dev/null +++ b/src/include/bcnm/bcnm.h @@ -0,0 +1,16 @@ +/* ISC license. */ + +#ifndef BCNM_BCNM_H +#define BCNM_BCNM_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <bcnm/if.h> + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/bcnm/if.h b/src/include/bcnm/if.h new file mode 100644 index 0000000..c4217ab --- /dev/null +++ b/src/include/bcnm/if.h @@ -0,0 +1,22 @@ +/* ISC license. */ + +#ifndef BCNM_IF_H +#define BCNM_IF_H + +#include <sys/types.h> +#include <net/if.h> + +typedef struct bcnm_if_link_state_s bcnm_if_link_state_t, *bcnm_if_link_state_t_ref ; +struct bcnm_if_link_state_s +{ + char ifname[IF_NAMESIZE] ; + unsigned int state : 15 ; + unsigned int changed : 1 ; +} ; +#define BCNM_IF_LINK_STATE_ZERO { "", 0, 0 } + +extern int bcnm_if_getstate (char const *) ; +extern int bcnm_if_link_init (unsigned int) ; +extern ssize_t bcnm_if_link_event (int, bcnm_if_link_state_t *, size_t) ; + +#endif |