diff options
Diffstat (limited to 'src/helpers/rpc.c')
-rw-r--r-- | src/helpers/rpc.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/helpers/rpc.c b/src/helpers/rpc.c index 3a7b337..732e9ba 100644 --- a/src/helpers/rpc.c +++ b/src/helpers/rpc.c @@ -26,6 +26,7 @@ #include <errno.h> +#include <rpc/clnt.h> #include <rpc/rpc_msg.h> #include <rpc/pmap_prot.h> #define _GNU_SOURCE @@ -34,26 +35,18 @@ #include <libmnl/libmnl.h> #include <libnetfilter_conntrack/libnetfilter_conntrack.h> +#include <linux/netfilter/nfnetlink_queue.h> #include <libnetfilter_queue/libnetfilter_queue.h> #include <libnetfilter_queue/libnetfilter_queue_tcp.h> #include <libnetfilter_queue/pktbuff.h> #include <linux/netfilter.h> +#include "helpers/rpc.h" + /* RFC 1050: RPC: Remote Procedure Call Protocol Specification Version 2 */ /* RFC 1014: XDR: External Data Representation Standard */ #define SUPPORTED_RPC_VERSION 2 -struct rpc_info { - /* XID */ - uint32_t xid; - /* program */ - uint32_t pm_prog; - /* program version */ - uint32_t pm_vers; - /* transport protocol: TCP|UDP */ - uint32_t pm_prot; -}; - /* So, this packet has hit the connection tracking matching code. Mangle it, and change the expectation to match the new version. */ static unsigned int @@ -114,8 +107,8 @@ nf_nat_rpc(struct pkt_buff *pkt, int dir, struct nf_expect *exp, #define ROUNDUP(n) ((((n) + 3)/4)*4) static int -rpc_call(const uint32_t *data, uint32_t offset, uint32_t datalen, - struct rpc_info *rpc_info) +rpc_parse_call(const uint32_t *data, uint32_t offset, uint32_t datalen, + struct rpc_info *rpc_info) { uint32_t p, r; @@ -393,7 +386,7 @@ rpc_helper_cb(struct pkt_buff *pkt, uint32_t protoff, } if (rm_dir == CALL) { - if (rpc_call(data, offset, datalen, rpc_info) < 0) + if (rpc_parse_call(data, offset, datalen, rpc_info) < 0) goto out; rpc_info->xid = xid; |