summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libnetfilter_conntrack/libnetfilter_conntrack.h18
-rw-r--r--src/expect/api.c28
2 files changed, 32 insertions, 14 deletions
diff --git a/include/libnetfilter_conntrack/libnetfilter_conntrack.h b/include/libnetfilter_conntrack/libnetfilter_conntrack.h
index 029eebd..5315f42 100644
--- a/include/libnetfilter_conntrack/libnetfilter_conntrack.h
+++ b/include/libnetfilter_conntrack/libnetfilter_conntrack.h
@@ -588,6 +588,24 @@ extern int nfexp_snprintf(char *buf,
extern int nfexp_catch(struct nfct_handle *h);
+/* low level API */
+extern int nfexp_build_expect(struct nfnl_subsys_handle *ssh,
+ void *req,
+ size_t size,
+ u_int16_t type,
+ u_int16_t flags,
+ const struct nf_expect *exp);
+
+extern int nfexp_parse_expect(enum nf_conntrack_msg_type type,
+ const struct nlmsghdr *nlh,
+ struct nf_expect *exp);
+
+extern int nfexp_build_query(struct nfnl_subsys_handle *ssh,
+ const enum nf_conntrack_query qt,
+ const void *data,
+ void *buffer,
+ unsigned int size);
+
/* Bitset representing status of connection. Taken from ip_conntrack.h
*
* Note: For backward compatibility this shouldn't ever change
diff --git a/src/expect/api.c b/src/expect/api.c
index 35c8672..35aaac9 100644
--- a/src/expect/api.c
+++ b/src/expect/api.c
@@ -465,12 +465,12 @@ int nfexp_attr_unset(struct nf_expect *exp,
* On error, -1 is returned and errno is appropiately set.
* On success, 0 is returned.
*/
-static int nfexp_build_expect(struct nfnl_subsys_handle *ssh,
- void *req,
- size_t size,
- u_int16_t type,
- u_int16_t flags,
- const struct nf_expect *exp)
+int nfexp_build_expect(struct nfnl_subsys_handle *ssh,
+ void *req,
+ size_t size,
+ u_int16_t type,
+ u_int16_t flags,
+ const struct nf_expect *exp)
{
assert(ssh != NULL);
assert(req != NULL);
@@ -509,11 +509,11 @@ static int nfexp_build_expect(struct nfnl_subsys_handle *ssh,
* On success, 0 is returned. On error, -1 is returned and errno is set
* appropiately.
*/
-static int nfexp_build_query(struct nfnl_subsys_handle *ssh,
- const enum nf_conntrack_query qt,
- const void *data,
- void *buffer,
- unsigned int size)
+int nfexp_build_query(struct nfnl_subsys_handle *ssh,
+ const enum nf_conntrack_query qt,
+ const void *data,
+ void *buffer,
+ unsigned int size)
{
struct nfnlhdr *req = buffer;
const u_int8_t *family = data;
@@ -571,9 +571,9 @@ static int nfexp_build_query(struct nfnl_subsys_handle *ssh,
* the message received is not of the requested type then 0 is returned,
* otherwise this function returns the message type parsed.
*/
-static int nfexp_parse_expect(enum nf_conntrack_msg_type type,
- const struct nlmsghdr *nlh,
- struct nf_expect *exp)
+int nfexp_parse_expect(enum nf_conntrack_msg_type type,
+ const struct nlmsghdr *nlh,
+ struct nf_expect *exp)
{
unsigned int flags;
int len = nlh->nlmsg_len;