From acf1808fe57fe8a8bfc8410b475728e39e080721 Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=pablo/emailAddress=pablo@netfilter.org" Date: Sat, 23 Dec 2006 15:41:38 +0000 Subject: - replace ntohs by htons in the example file (reported by Victor Stinner) - introduce NFCT_O_PLAIN flag: NFCT_O_DEFAULT points to NFCT_O_PLAIN - remove commented line in nfct_new() --- utils/new_api_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'utils/new_api_test.c') diff --git a/utils/new_api_test.c b/utils/new_api_test.c index 2bc26b1..aad2f52 100644 --- a/utils/new_api_test.c +++ b/utils/new_api_test.c @@ -54,16 +54,16 @@ int main() nfct_set_attr_u32(ct, ATTR_ORIG_IPV4_DST, inet_addr("2.2.2.2")); nfct_set_attr_u8(ct, ATTR_ORIG_L4PROTO, IPPROTO_TCP); - nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, ntohs(20)); - nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, ntohs(10)); + nfct_set_attr_u16(ct, ATTR_ORIG_PORT_SRC, htons(20)); + nfct_set_attr_u16(ct, ATTR_ORIG_PORT_DST, htons(10)); nfct_set_attr_u8(ct, ATTR_REPL_L3PROTO, AF_INET); nfct_set_attr_u32(ct, ATTR_REPL_IPV4_SRC, inet_addr("2.2.2.2")); nfct_set_attr_u32(ct, ATTR_REPL_IPV4_DST, inet_addr("1.1.1.1")); nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_TCP); - nfct_set_attr_u16(ct, ATTR_REPL_PORT_SRC, ntohs(10)); - nfct_set_attr_u16(ct, ATTR_REPL_PORT_DST, ntohs(20)); + nfct_set_attr_u16(ct, ATTR_REPL_PORT_SRC, htons(10)); + nfct_set_attr_u16(ct, ATTR_REPL_PORT_DST, htons(20)); nfct_set_attr_u8(ct, ATTR_TCP_STATE, TCP_CONNTRACK_LISTEN); nfct_set_attr_u32(ct, ATTR_TIMEOUT, 100); -- cgit v1.2.3