summaryrefslogtreecommitdiffstats
path: root/include/libnfnetlink/libnfnetlink.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libnfnetlink/libnfnetlink.h')
-rw-r--r--include/libnfnetlink/libnfnetlink.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
index 982c1b6..839a3ee 100644
--- a/include/libnfnetlink/libnfnetlink.h
+++ b/include/libnfnetlink/libnfnetlink.h
@@ -43,25 +43,20 @@ struct nfnl_callback {
u_int16_t attr_count;
};
-struct nfnl_handle {
- int fd;
- struct sockaddr_nl local;
- struct sockaddr_nl peer;
- u_int8_t subsys_id;
- u_int32_t seq;
- u_int32_t dump;
- struct nlmsghdr *last_nlhdr;
-
- u_int8_t cb_count;
- struct nfnl_callback *cb; /* array of callbacks */
-};
+struct nfnl_handle;
+struct nfnl_subsys_handle;
extern int nfnl_fd(struct nfnl_handle *h);
/* get a new library handle */
-extern int nfnl_open(struct nfnl_handle *, u_int8_t, u_int8_t, unsigned int);
+extern struct nfnl_handle *nfnl_open(void);
extern int nfnl_close(struct nfnl_handle *);
+extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *,
+ u_int8_t, u_int8_t,
+ unsigned int);
+extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+
/* sending of data */
extern int nfnl_send(struct nfnl_handle *, struct nlmsghdr *);
extern int nfnl_sendmsg(const struct nfnl_handle *, const struct msghdr *msg,
@@ -69,7 +64,7 @@ extern int nfnl_sendmsg(const struct nfnl_handle *, const struct msghdr *msg,
extern int nfnl_sendiov(const struct nfnl_handle *nfnlh,
const struct iovec *iov, unsigned int num,
unsigned int flags);
-extern void nfnl_fill_hdr(struct nfnl_handle *, struct nlmsghdr *,
+extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *,
unsigned int, u_int8_t, u_int16_t, u_int16_t,
u_int16_t);
extern int nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t,
@@ -84,9 +79,9 @@ extern int nfnl_listen(struct nfnl_handle *,
/* receiving */
extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len);
-extern int nfnl_callback_register(struct nfnl_handle *,
+extern int nfnl_callback_register(struct nfnl_subsys_handle *,
u_int8_t type, struct nfnl_callback *cb);
-extern int nfnl_callback_unregister(struct nfnl_handle *, u_int8_t type);
+extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type);
extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len);
/* parsing */