[netfilter-cvslog] r4351 - in trunk/nfsim: . core core/ipv4 tools

jk at netfilter.org jk at netfilter.org
Wed Oct 12 14:12:48 CEST 2005


Author: jk at netfilter.org
Date: 2005-10-12 14:12:20 +0200 (Wed, 12 Oct 2005)
New Revision: 4351

Modified:
   trunk/nfsim/.links
   trunk/nfsim/Makefile.in
   trunk/nfsim/core/core.c
   trunk/nfsim/core/core.h
   trunk/nfsim/core/expect.c
   trunk/nfsim/core/fakesockopt.c
   trunk/nfsim/core/field.c
   trunk/nfsim/core/ipv4/ipv4.c
   trunk/nfsim/core/ipv4/ipv4.h
   trunk/nfsim/core/list.h
   trunk/nfsim/core/log.c
   trunk/nfsim/core/message.c
   trunk/nfsim/core/talloc.c
   trunk/nfsim/core/talloc.h
   trunk/nfsim/core/tui.c
   trunk/nfsim/tools/gen_err.c
   trunk/nfsim/tools/gen_ip.c
   trunk/nfsim/tools/gen_ip.h
   trunk/nfsim/tools/hook.c
   trunk/nfsim/tools/ifconfig.c
   trunk/nfsim/tools/info.c
   trunk/nfsim/tools/module.c
   trunk/nfsim/tools/queue.c
   trunk/nfsim/tools/route.c
   trunk/nfsim/tools/tcpsession.c
   trunk/nfsim/tools/time.c
Log:
nfsim whitespace cleanup


Modified: trunk/nfsim/.links
===================================================================
--- trunk/nfsim/.links	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/.links	2005-10-12 12:12:20 UTC (rev 4351)
@@ -69,3 +69,4 @@
 ./linux/mm.h
 ./linux/swap.h
 ./linux/list.h
+./linux/random.h

Modified: trunk/nfsim/Makefile.in
===================================================================
--- trunk/nfsim/Makefile.in	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/Makefile.in	2005-10-12 12:12:20 UTC (rev 4351)
@@ -54,7 +54,7 @@
 tools/config.o: tools/config.c tools/generated_config_string.c
 
 tools/generated_config_string.c: .config
-	echo "static const char config_string[] = " > $@
+	echo "static const char config_string[] =" > $@
 	grep '^CONFIG' $^ | tr -d '"' | sed 's/\(.*\)/"\1\\n"/' >> $@
 	echo ";" >> $@
 
@@ -137,7 +137,7 @@
 	$(COMPILE.c) -o $@ $<; ret=$$?; rm -f `basename $< .c`-help*; exit $$ret
 
 .PHONY: snapshot
-snapshot: clean distclean 
+snapshot: clean distclean
 	(cd ../ && tar --exclude .svn --exclude nfsim/nfsim-*.tar.gz \
 	        --exclude '.*.sw[op]' \
 		-czvf nfsim/nfsim-$(shell date +%Y%m%d).tar.gz nfsim)

Modified: trunk/nfsim/core/core.c
===================================================================
--- trunk/nfsim/core/core.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/core.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -56,13 +56,12 @@
 {
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(nf_retval_str); i++) 
+	for (i = 0; i < ARRAY_SIZE(nf_retval_str); i++)
 		if (streq(name, nf_retval_str[i]))
 			return i;
-	
+
 	return -1;
 }
-	
 
 extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS];
 extern struct list_head nf_sockopts;
@@ -249,7 +248,7 @@
      <title><option>--no-modules</option></title>
      <subtitle>Don't load all available modules on startup</subtitle>
      <para>Usually all netfilter modules are loaded on startup, this option
-     will suppress this behaviour. To load modules after invoking nfsim with 
+     will suppress this behaviour. To load modules after invoking nfsim with
      this argument, use the <command>insmod</command> command</para>
     </section>
 */
@@ -352,7 +351,8 @@
 			barf("Bad argument `%s'", copts[x].opt.name);
 
 		for (y = 0; y < x; y++)
-			if ((copts[x].opt.val && copts[x].opt.val == opts[y].val)
+			if ((copts[x].opt.val && copts[x].opt.val
+						== opts[y].val)
 					|| streq(copts[x].opt.name,
 						opts[y].name))
 				barf("Conflicting arguments %s = %s\n",
@@ -388,7 +388,7 @@
 	}
 	return optstr;
 }
-		
+
 void check_allocations(void)
 {
 	proc_cleanup();
@@ -512,7 +512,7 @@
 #else
 	nf_register_queue_handler(PF_INET, enqueue_packet, NULL);
 #endif
-	
+
 	nfsim_log(LOG_UI, "initialisation done");
 
 	message_init();
@@ -545,12 +545,12 @@
 
 	if (!log_describe_packets())
 		return pbuf;
-	
+
 #if 0
 	ptr += sprintf(ptr, " {");
 
 	switch (htons(skb->protocol)) {
-	
+
 	case ETH_P_IP:
 		ptr += sprintf(ptr, "IPv4 %s", ipv4_describe_packet(skb));
 		break;

Modified: trunk/nfsim/core/core.h
===================================================================
--- trunk/nfsim/core/core.h	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/core.h	2005-10-12 12:12:20 UTC (rev 4351)
@@ -149,7 +149,7 @@
 {
 	/* The ops struct which sent us to userspace. */
 	struct nf_hook_ops *elem;
-	
+
 	/* If we're sent to userspace, this keeps housekeeping info */
 	int pf;
 	unsigned int hook;

Modified: trunk/nfsim/core/expect.c
===================================================================
--- trunk/nfsim/core/expect.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/expect.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -226,7 +226,7 @@
 		return false;
 
 	if (!tui_is_command(argv[1])) {
-		nfsim_log(LOG_ALWAYS, "expect: %s is not a command\n", 
+		nfsim_log(LOG_ALWAYS, "expect: %s is not a command\n",
 			  argv[1]);
 		return false;
 	}
@@ -270,17 +270,18 @@
       <arg choice="req"><replaceable>pattern</replaceable></arg>
      </cmdsynopsis>
      <para><command>expect</command> will set up a set of patterns to expect in
-      logging messages for a particular command. If that command finishes without
-      matching the specified pattern, the simulator will exit with a non-zero
-      return value.  After the command is run, all expectations on that command are deleted.</para>
-     <para><command>expect</command> with no arguments will print out the current
-      list of expectations, as a command and a pattern.</para>
+      logging messages for a particular command. If that command finishes
+      without matching the specified pattern, the simulator will exit with a
+      non-zero return value.  After the command is run, all expectations on that
+      command are deleted.</para>
+     <para><command>expect</command> with no arguments will print out the
+      current list of expectations, as a command and a pattern.</para>
      <para><command>expect <replaceable>command pattern</replaceable></command>
       will expect the specified pattern to occur the next time
-      <replaceable>command</replaceable> is invoked. If an '!' appears before the
-      command, then the expectation is negated - if the pattern appears in the
-      output, then the simulator will exit with an error</para>
-
+      <replaceable>command</replaceable> is invoked. If an '!' appears before
+      the command, then the expectation is negated - if the pattern appears in
+      the output, then the simulator will exit with an error
+     </para>
      <para>The pattern itself is similar to a simple shell wildcard,
       except whitespace is loosely matched.  The * character will
       match any a string of any length.</para>

Modified: trunk/nfsim/core/fakesockopt.c
===================================================================
--- trunk/nfsim/core/fakesockopt.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/fakesockopt.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -82,8 +82,8 @@
 		exit(EXIT_FAILURE); \
 	} \
 	} while (0)
-	
-		
+
+
 /* Called on load */
 void _init(void);
 void _init(void)
@@ -95,7 +95,7 @@
 		fprintf(stderr, "%s\n", dlerror());
 		exit(EXIT_FAILURE);
 	}
-	
+
 	sym(handle, getsockopt);
 	sym(handle, setsockopt);
 	sym(handle, socket);
@@ -199,11 +199,10 @@
 	default:
 		fprintf(stderr, "Invalid kernelop opcode\n");
 		return;
-	
+
 	}
 
-	if (write(sd, reply, m_offset + reply->len) != 
-		m_offset + reply->len) {
+	if (write(sd, reply, m_offset + reply->len) != m_offset + reply->len) {
 		perror("write");
 		exit(EXIT_FAILURE);
 	}
@@ -266,7 +265,7 @@
 				ret = -1;
 			}
 			return ret;
-	
+
 		case UM_KERNELOP:
 			handle_kernelop(sd, reply);
 			break;
@@ -282,7 +281,7 @@
 {
 	int ret;
 	struct nf_userspace_message msg;
-	
+
 	msg.opcode  = SYS_GETSOCKOPT;
 	msg.args[0] = PF_INET;
 	/*msg.args[1] = level;*/
@@ -331,7 +330,7 @@
 
 static int file_is_proc(const char *pathname)
 {
-	if (pathname && strlen(pathname) >= 6 
+	if (pathname && strlen(pathname) >= 6
 	    && !strncmp(pathname, "/proc/", 6))
 		return 1;
 	else
@@ -340,7 +339,7 @@
 
 static char *mangle_alloc_proc_path(const char *pathname)
 {
-	char *fakepath = (char *) malloc(strlen(pathname) 
+	char *fakepath = (char *) malloc(strlen(pathname)
 			 + strlen(proc_prefix));
 	if (!fakepath)
 		return NULL;
@@ -412,7 +411,6 @@
 	return ret;
 }
 
-
 int close(int fd)
 {
 	return (fd == sd) ? 0 : (*__close)(fd);

Modified: trunk/nfsim/core/field.c
===================================================================
--- trunk/nfsim/core/field.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/field.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -44,7 +44,7 @@
 	return 0;
 }
 
-static void __field_attach(void *ctx, const void *strct, 
+static void __field_attach(void *ctx, const void *strct,
 			   const char *name, void *val)
 {
 	struct field *field = talloc(ctx, struct field);

Modified: trunk/nfsim/core/ipv4/ipv4.c
===================================================================
--- trunk/nfsim/core/ipv4/ipv4.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/ipv4/ipv4.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -49,7 +49,8 @@
 	route = talloc(indev, struct ipv4_route);
 	talloc_set_destructor(route, destroy_route);
 	route->netmask = indev->ifa_list->ifa_mask;
-	route->network = indev->ifa_list->ifa_address & indev->ifa_list->ifa_mask;
+	route->network = indev->ifa_list->ifa_address
+		& indev->ifa_list->ifa_mask;
 	route->interface = indev->dev;
 	route->gateway = indev->ifa_list->ifa_address;
 	list_add_tail(&route->entry, &routes);
@@ -110,7 +111,7 @@
 		kfree_skb(skb);
 		return -1;
 	}
-		
+
 	return dst_input(skb);
 }
 
@@ -145,7 +146,7 @@
 
 
 	memset(&fl, 0, sizeof(fl));
-	
+
 	fl.fl4_dst    = skb->nh.iph->daddr;
 	fl.fl4_src    = skb->nh.iph->saddr;
 	fl.fl4_tos    = skb->nh.iph->tos;
@@ -158,7 +159,7 @@
 		kfree_skb(skb);
 		return 1;
 	}
-	
+
 	skb->dst = (struct dst_entry *)rt;
 	dst_hold(skb_dst);
 routed:
@@ -174,7 +175,7 @@
 int ip_finish_output(struct sk_buff *skb)
 {
 	struct net_device *dev = skb->dst->dev;
-	
+
 	skb->dev = dev;
 	skb->protocol = htons(ETH_P_IP);
 	/*
@@ -218,7 +219,7 @@
 		    rth->fl.fl4_fwmark == flp->fl4_fwmark &&
 #endif
 		    rth->fl.fl4_tos == flp->fl4_tos) {
-		    	dst_hold(&rth->u.dst)
+			dst_hold(&rth->u.dst)
 			*rp = rth;
 			return 0;
 		}
@@ -226,7 +227,7 @@
 
 	list_for_each_entry(dev, &interfaces, entry) {
 		struct in_ifaddr *ifaddr;
-		
+
 		if (!dev->ip_ptr)
 			continue;
 
@@ -262,7 +263,7 @@
 			}
 			ifaddr = ifaddr->ifa_next;
 		}
-		
+
 	}
 
 	/* otherwise, find the appropriate route & create an rcache entry */
@@ -303,7 +304,6 @@
 	}
 
 	return 1;
-	
 }
 
 
@@ -389,7 +389,7 @@
 	/* is this a local packet ? */
 	list_for_each_entry(dev, &interfaces, entry) {
 		struct in_ifaddr *ifaddr;
-		
+
 		if (!dev->ip_ptr)
 			continue;
 
@@ -398,7 +398,7 @@
 			if (skb->nh.iph->daddr == ifaddr->ifa_local) {
 				log_route(skb,
 					"route:local packet (%s)",
-			 		dev->name);
+					dev->name);
 				rth = talloc_zero(dev->ip_ptr, struct rtable);
 				talloc_set_destructor(rth, destroy_rtable);
 
@@ -423,7 +423,7 @@
 			}
 			ifaddr = ifaddr->ifa_next;
 		}
-		
+
 	}
 
 	/* otherwise, find the appropriate route & create an rcache entry */
@@ -453,7 +453,7 @@
 			/* add to rcache list */
 			rth->u.rt_next = rcache;
 			rcache = rth;
-			
+
 			skb->dst = &rth->u.dst;
 
 			return 0;
@@ -509,7 +509,7 @@
 		}
 
 		off = (ntohs(f->frags[i]->nh.iph->frag_off) & IP_OFFSET)*8;
-		len = ntohs(f->frags[i]->nh.iph->tot_len) 
+		len = ntohs(f->frags[i]->nh.iph->tot_len)
 			- f->frags[i]->nh.iph->ihl * 4;
 		if (len + off > max)
 			max = len + off;
@@ -720,10 +720,10 @@
 	icmph = nskb->h.icmph
 		= (struct icmphdr *)skb_put(nskb, sizeof(struct icmphdr));
 	icmph->type = type;
-	icmph->code = code;	
+	icmph->code = code;
 	icmph->un.gateway = 0;
 	icmph->checksum = 0;
-	
+
 	/* Copy as much of original packet as will fit */
 	data = skb_put(nskb,
 		       length - sizeof(struct iphdr) - sizeof(struct icmphdr));
@@ -871,11 +871,10 @@
 
 	list_for_each_entry(dev, &interfaces, entry) {
 		struct in_ifaddr *ifaddr;
-		
+
 		if (!dev->ip_ptr)
 			continue;
 
-		
 		for (ifaddr = ((struct in_device *)(dev->ip_ptr))->ifa_list;
 				ifaddr; ifaddr = ifaddr->ifa_next)
 			if (ifaddr->ifa_local == addr)
@@ -1000,10 +999,10 @@
 
 	if (ntohs(iph->frag_off) & IP_OFFSET)
 		goto out;
-	
+
 	iplen = htons(iph->tot_len) - sizeof(struct iphdr);
 	len -= sizeof(struct iphdr);
-	
+
 	switch (iph->protocol) {
 	case IPPROTO_ICMP:
 		icmph = (struct icmphdr *)(iph + 1);
@@ -1025,7 +1024,6 @@
 		    && csum_partial((char *)icmph, iplen, 0) != 0xFFFF) {
 				ptr += sprintf(ptr, "-BAD ICMP CSUM-");
 				goto out;
-				
 		}
 
 		if (icmph->type == 0 || icmph->type == 8) {
@@ -1063,9 +1061,9 @@
 		if (!(ntohs(iph->frag_off) & IP_MF)
 		    && udph->check
 		    && csum_tcpudp_magic(iph->saddr, iph->daddr,
-					 iplen, IPPROTO_UDP, 
+					 iplen, IPPROTO_UDP,
 					 csum_partial(udph, iplen, 0))) {
-			ptr += sprintf(ptr, "-BAD UDP CSUM- (%04x)", 
+			ptr += sprintf(ptr, "-BAD UDP CSUM- (%04x)",
 				       udph->check);
 			goto out;
 		}
@@ -1141,7 +1139,7 @@
 
 		if (!(ntohs(iph->frag_off) & IP_MF)
 		    && csum_tcpudp_magic(iph->saddr, iph->daddr,
-					 iplen, IPPROTO_TCP, 
+					 iplen, IPPROTO_TCP,
 					 csum_partial(tcph, iplen, 0))) {
 			ptr += sprintf(ptr, "-BAD TCP CSUM- (%04x)",
 				       tcph->check);
@@ -1152,7 +1150,7 @@
 			ptr = print_data(ptr, (char *)tcph + tcph->doff*4,
 					 iplen - tcph->doff*4);
 		break;
-			
+
 	default:
 		ptr += sprintf(ptr, "%u %u", iplen, iph->protocol);
 		if (len < iplen) {

Modified: trunk/nfsim/core/ipv4/ipv4.h
===================================================================
--- trunk/nfsim/core/ipv4/ipv4.h	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/ipv4/ipv4.h	2005-10-12 12:12:20 UTC (rev 4351)
@@ -94,7 +94,7 @@
 		version:4;
 #elif defined (__BIG_ENDIAN_BITFIELD)
 	__u8	version:4,
-  		ihl:4;
+		ihl:4;
 #else
 #error	"Please fix <asm/byteorder.h>"
 #endif
@@ -190,30 +190,30 @@
 		fin:1;
 #else
 #error	"Adjust your <asm/byteorder.h> defines"
-#endif	
+#endif
 	__u16	window;
 	__u16	check;
 	__u16	urg_ptr;
 };
 
-union tcp_word_hdr { 
+union tcp_word_hdr {
 	struct tcphdr hdr;
-	__u32 		  words[5];
-}; 
+	__u32		  words[5];
+};
 
-#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
-enum { 
-	TCP_FLAG_CWR = __constant_htonl(0x00800000), 
-	TCP_FLAG_ECE = __constant_htonl(0x00400000), 
-	TCP_FLAG_URG = __constant_htonl(0x00200000), 
-	TCP_FLAG_ACK = __constant_htonl(0x00100000), 
-	TCP_FLAG_PSH = __constant_htonl(0x00080000), 
-	TCP_FLAG_RST = __constant_htonl(0x00040000), 
-	TCP_FLAG_SYN = __constant_htonl(0x00020000), 
+#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
+enum {
+	TCP_FLAG_CWR = __constant_htonl(0x00800000),
+	TCP_FLAG_ECE = __constant_htonl(0x00400000),
+	TCP_FLAG_URG = __constant_htonl(0x00200000),
+	TCP_FLAG_ACK = __constant_htonl(0x00100000),
+	TCP_FLAG_PSH = __constant_htonl(0x00080000),
+	TCP_FLAG_RST = __constant_htonl(0x00040000),
+	TCP_FLAG_SYN = __constant_htonl(0x00020000),
 	TCP_FLAG_FIN = __constant_htonl(0x00010000),
 	TCP_RESERVED_BITS = __constant_htonl(0x0F000000),
 	TCP_DATA_OFFSET = __constant_htonl(0xF0000000)
-}; 
+};
 
 
 
@@ -358,7 +358,7 @@
 			__u8			scope;
 		} ip4_u;
 
-#if 0		
+#if 0
 		struct {
 			struct in6_addr		daddr;
 			struct in6_addr		saddr;
@@ -498,7 +498,7 @@
 	struct in_ifaddr	*ifa_next;
 
 	struct in_device	*ifa_dev;
-	
+
 	u32			ifa_local;
 	u32			ifa_address;
 	u32			ifa_mask;
@@ -549,7 +549,7 @@
 	inaddr.s_addr = addr;
 	return inet_ntoa(inaddr);
 }
-	
+
 int register_inetaddr_notifier(struct notifier_block *nb);
 int unregister_inetaddr_notifier(struct notifier_block *nb);
 int __call_inetaddr_notifier(unsigned long, struct in_ifaddr *ifa);
@@ -626,7 +626,7 @@
 
 /* routing */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-struct rt_key 
+struct rt_key
 {
 	__u32 src, dst;
 	__u8 tos;

Modified: trunk/nfsim/core/list.h
===================================================================
--- trunk/nfsim/core/list.h	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/list.h	2005-10-12 12:12:20 UTC (rev 4351)
@@ -35,7 +35,7 @@
 } while (0)
 
 /*
- * Insert a new entry between two known consecutive entries. 
+ * Insert a new entry between two known consecutive entries.
  *
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
@@ -77,7 +77,7 @@
 }
 
 /*
- * Insert a new entry between two known consecutive entries. 
+ * Insert a new entry between two known consecutive entries.
  *
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
@@ -148,11 +148,11 @@
  * list_del_rcu - deletes entry from list without re-initialization
  * @entry: the element to delete from the list.
  *
- * Note: list_empty on entry does not return true after this, 
+ * Note: list_empty on entry does not return true after this,
  * the entry is in an undefined state. It is useful for RCU based
  * lockfree traversal.
  *
- * In particular, it means that we can not poison the forward 
+ * In particular, it means that we can not poison the forward
  * pointers that may still be used for walking the list.
  */
 static inline void list_del_rcu(struct list_head *entry)
@@ -168,7 +168,7 @@
 static inline void list_del_init(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
-	INIT_LIST_HEAD(entry); 
+	INIT_LIST_HEAD(entry);
 }
 
 /**
@@ -268,7 +268,7 @@
  */
 #define list_for_each_prev(pos, head) \
 	for (pos = (head)->prev; pos != (head); pos = pos->prev)
-        	
+
 /**
  * list_for_each_safe	-	iterate over a list safe against removal of list entry
  * @pos:	the &struct list_head to use as a loop counter.
@@ -287,7 +287,7 @@
  */
 #define list_for_each_entry(pos, head, member)				\
 	for (pos = list_entry((head)->next, typeof(*pos), member);	\
-	     &pos->member != (head); 					\
+	     &pos->member != (head);					\
 	     pos = list_entry(pos->member.next, typeof(*pos), member))
 
 /**
@@ -298,7 +298,7 @@
  */
 #define list_for_each_entry_reverse(pos, head, member)			\
 	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
-	     &pos->member != (head); 					\
+	     &pos->member != (head);					\
 	     pos = list_entry(pos->member.prev, typeof(*pos), member))
 
 
@@ -312,48 +312,48 @@
 #define list_for_each_entry_safe(pos, n, head, member)			\
 	for (pos = list_entry((head)->next, typeof(*pos), member),	\
 		n = list_entry(pos->member.next, typeof(*pos), member);	\
-	     &pos->member != (head); 					\
+	     &pos->member != (head);					\
 	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
 
 
-/* 
- * Double linked lists with a single pointer list head. 
- * Mostly useful for hash tables where the two pointer list head is 
+/*
+ * Double linked lists with a single pointer list head.
+ * Mostly useful for hash tables where the two pointer list head is
  * too wasteful.
  * You lose the ability to access the tail in O(1).
- */ 
+ */
 
-struct hlist_head { 
-	struct hlist_node *first; 
-}; 
+struct hlist_head {
+	struct hlist_node *first;
+};
 
-struct hlist_node { 
-	struct hlist_node *next, **pprev; 
-}; 
+struct hlist_node {
+	struct hlist_node *next, **pprev;
+};
 
-#define HLIST_HEAD_INIT { .first = NULL } 
+#define HLIST_HEAD_INIT { .first = NULL }
 #define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
-#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) 
+#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
 #define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL)
 
-static __inline__ int hlist_unhashed(struct hlist_node *h) 
-{ 
+static __inline__ int hlist_unhashed(struct hlist_node *h)
+{
 	return !h->pprev;
-} 
+}
 
-static __inline__ int hlist_empty(const struct hlist_head *h) 
-{ 
+static __inline__ int hlist_empty(const struct hlist_head *h)
+{
 	return !h->first;
-} 
+}
 
-static __inline__ void __hlist_del(struct hlist_node *n) 
+static __inline__ void __hlist_del(struct hlist_node *n)
 {
 	struct hlist_node *next = n->next;
 	struct hlist_node **pprev = n->pprev;
-	*pprev = next;  
-	if (next) 
+	*pprev = next;
+	if (next)
 		next->pprev = pprev;
-}  
+}
 
 static __inline__ void hlist_del(struct hlist_node *n)
 {
@@ -366,12 +366,11 @@
  * hlist_del_rcu - deletes entry from hash list without re-initialization
  * @entry: the element to delete from the hash list.
  *
- * Note: list_unhashed() on entry does not return true after this, 
- * the entry is in an undefined state. It is useful for RCU based
- * lockfree traversal.
+ * Note: list_unhashed() on entry does not return true after this, the entry is
+ * in an undefined state. It is useful for RCU based lockfree traversal.
  *
- * In particular, it means that we can not poison the forward
- * pointers that may still be used for walking the hash list.
+ * In particular, it means that we can not poison the forward pointers that may
+ * still be used for walking the hash list.
  */
 static inline void hlist_del_rcu(struct hlist_node *n)
 {
@@ -379,42 +378,45 @@
 	n->pprev = LIST_POISON2;
 }
 
-static __inline__ void hlist_del_init(struct hlist_node *n) 
+static __inline__ void hlist_del_init(struct hlist_node *n)
 {
 	if (n->pprev)  {
 		__hlist_del(n);
 		INIT_HLIST_NODE(n);
 	}
-}  
+}
 
 #define hlist_del_rcu_init hlist_del_init
 
-static __inline__ void hlist_add_head(struct hlist_node *n, struct hlist_head *h) 
-{ 
+static __inline__ void hlist_add_head(struct hlist_node *n,
+		struct hlist_head *h)
+{
 	struct hlist_node *first = h->first;
-	n->next = first; 
-	if (first) 
+	n->next = first;
+	if (first)
 		first->pprev = &n->next;
-	h->first = n; 
-	n->pprev = &h->first; 
-} 
+	h->first = n;
+	n->pprev = &h->first;
+}
 
-static __inline__ void hlist_add_head_rcu(struct hlist_node *n, struct hlist_head *h) 
-{ 
+static __inline__ void hlist_add_head_rcu(struct hlist_node *n,
+		struct hlist_head *h)
+{
 	struct hlist_node *first = h->first;
 	n->next = first;
-	n->pprev = &h->first; 
-	if (first) 
+	n->pprev = &h->first;
+	if (first)
 		first->pprev = &n->next;
-	h->first = n; 
-} 
+	h->first = n;
+}
 
 /* next must be != NULL */
-static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node *next)
+static __inline__ void hlist_add_before(struct hlist_node *n,
+		struct hlist_node *next)
 {
 	n->pprev = next->pprev;
-	n->next = next; 
-	next->pprev = &n->next; 
+	n->next = next;
+	next->pprev = &n->next;
 	*(n->pprev) = n;
 }
 
@@ -430,7 +432,7 @@
 
 /* Cannot easily do prefetch unfortunately */
 #define hlist_for_each(pos, head) \
-	for (pos = (head)->first; pos; pos = pos->next) 
+	for (pos = (head)->first; pos; pos = pos->next)
 
 #define hlist_for_each_safe(pos, n, head) \
 	for (pos = (head)->first; n = pos ? pos->next : 0, pos; \

Modified: trunk/nfsim/core/log.c
===================================================================
--- trunk/nfsim/core/log.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/log.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -28,7 +28,7 @@
 #include <list.h>
 
 static struct {
-	enum log_type	type; 
+	enum log_type	type;
 	char *		name;
 } log_names[] = {
 	{ LOG_KERNEL,	"kernel" },
@@ -137,11 +137,12 @@
 	if (argc == 1) {
 
 		nfsim_log(LOG_ALWAYS, "current log types:", typemask);
-	
+
 		i = 0;
 		while ((logname = log_names[i].name)) {
 			if (typemask & log_names[i].type)
-				nfsim_log(LOG_ALWAYS, "\t%s", log_names[i].name);
+				nfsim_log(LOG_ALWAYS, "\t%s",
+						log_names[i].name);
 			i++;
 		}
 		return true;
@@ -168,9 +169,10 @@
 		int newtypemask = 0;
 		for (i = 2; i < argc; i++) {
 			int type;
-			
+
 			if (!(type = parsetype(argv[i]))) {
-				nfsim_log(LOG_ALWAYS, "no such type %s", argv[i]);
+				nfsim_log(LOG_ALWAYS, "no such type %s",
+						argv[i]);
 				return false;
 			}
 			newtypemask |= type;
@@ -191,7 +193,7 @@
 			nfsim_log(LOG_ALWAYS, "unknown modifer: %c", *argv[1]);
 			return false;
 		}
-		
+
 		return true;
 	}
 
@@ -199,9 +201,6 @@
 	nfsim_log(LOG_ALWAYS, "meep");
 
 	return 1;
-			
-		
-
 }
 
 static void log_admin_help(int agc, char **argv)
@@ -222,7 +221,7 @@
      </cmdsynopsis>
      <para>Each log message is classified into one of the following
      types:</para>
-     <variablelist> 
+     <variablelist>
       <varlistentry>
        <term>KERNEL</term>
        <listitem>
@@ -276,7 +275,7 @@
 		typemask = -1;
 	describe_packets = 1;
 	memset(printk_buf, 0, PRINTK_BUFSIZ);
-	
+
 	tui_register_command("log", log_admin, log_admin_help);
 }
 

Modified: trunk/nfsim/core/message.c
===================================================================
--- trunk/nfsim/core/message.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/message.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -61,7 +61,7 @@
 	*(int*)CMSG_DATA(cmsg) = fd;
 
 	msg.msg_controllen = CMSG_SPACE(sizeof(fd));
- 
+
 	if (sendmsg(dest_fd, &msg, 0) < 0)
 		barf_perror("sendfd failed");
 }
@@ -391,9 +391,10 @@
 	/* Keep valgrind happy.*/
 	msg.args[3] = 0;
 	msg.retval = 0;
-	
+
 	if (strace)
-		nfsim_log(LOG_USERSPACE, "        copy_from_user(%p,%i)", to, n);
+		nfsim_log(LOG_USERSPACE,
+				"        copy_from_user(%p,%i)", to, n);
 	send_userspace_message(&msg);
 
 	return 0;

Modified: trunk/nfsim/core/talloc.c
===================================================================
--- trunk/nfsim/core/talloc.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/talloc.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -1,4 +1,4 @@
-/* 
+/*
    Samba Unix SMB/CIFS implementation.
 
    Samba trivial allocation library - new interface
@@ -6,17 +6,17 @@
    NOTE: Please read talloc_guide.txt for full documentation
 
    Copyright (C) Andrew Tridgell 2004
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -70,8 +70,8 @@
 #define TALLOC_MAGIC_FREE 0x7faebef3
 #define TALLOC_MAGIC_REFERENCE ((const char *)1)
 
-/* by default we abort when given a bad pointer (such as when talloc_free() is called 
-   on a pointer that came from malloc() */
+/* by default we abort when given a bad pointer (such as when talloc_free() is
+ * called on a pointer that came from malloc() */
 #ifndef TALLOC_ABORT
 #define TALLOC_ABORT(reason) abort()
 #endif
@@ -116,11 +116,11 @@
 static struct talloc_chunk *talloc_chunk_from_ptr(const void *ptr)
 {
 	struct talloc_chunk *tc = discard_const_p(struct talloc_chunk, ptr)-1;
-	if (tc->u.magic != TALLOC_MAGIC) { 
+	if (tc->u.magic != TALLOC_MAGIC) {
 		if (tc->u.magic == TALLOC_MAGIC_FREE) {
-			TALLOC_ABORT("Bad talloc magic value - double free"); 
+			TALLOC_ABORT("Bad talloc magic value - double free");
 		} else {
-			TALLOC_ABORT("Bad talloc magic value - unknown value"); 
+			TALLOC_ABORT("Bad talloc magic value - unknown value");
 		}
 	}
 
@@ -171,7 +171,7 @@
 	return (void *)(tc+1);
 }
 
-/* 
+/*
    Allocate a bit of memory as a child of an existing pointer
 */
 void *_talloc(const void *context, size_t size)
@@ -227,7 +227,7 @@
 }
 
 /*
-  increase the reference count on a piece of memory. 
+  increase the reference count on a piece of memory.
 */
 void talloc_increase_ref_count(const void *ptr)
 {
@@ -254,10 +254,10 @@
   make a secondary reference to a pointer, hanging off the given context.
   the pointer remains valid until both the original caller and this given
   context are freed.
-  
-  the major use for this is when two different structures need to reference the 
-  same underlying data, and you want to be able to free the two instances separately,
-  and in either order
+
+  the major use for this is when two different structures need to reference the
+  same underlying data, and you want to be able to free the two instances
+  separately, and in either order
 */
 void *talloc_reference(const void *context, const void *ptr)
 {
@@ -266,7 +266,8 @@
 	if (ptr == NULL) return NULL;
 
 	tc = talloc_chunk_from_ptr(ptr);
-	handle = talloc_named_const(context, sizeof(*handle), TALLOC_MAGIC_REFERENCE);
+	handle = talloc_named_const(context, sizeof(*handle),
+			TALLOC_MAGIC_REFERENCE);
 
 	if (handle == NULL) return NULL;
 
@@ -333,11 +334,12 @@
 			return -1;
 		}
 	} else {
-		if (talloc_chunk_from_ptr(context) != talloc_parent_chunk(ptr)) {
+		if (talloc_chunk_from_ptr(context)
+				!= talloc_parent_chunk(ptr)) {
 			return -1;
 		}
 	}
-	
+
 	tc_p = talloc_chunk_from_ptr(ptr);
 
 	if (tc_p->refs == NULL) {
@@ -363,7 +365,8 @@
 /*
   add a name to an existing pointer - va_list version
 */
-static void talloc_set_name_v(const void *ptr, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
+static void talloc_set_name_v(const void *ptr, const char *fmt, va_list ap)
+	PRINTF_ATTRIBUTE(2,0);
 
 static void talloc_set_name_v(const void *ptr, const char *fmt, va_list ap)
 {
@@ -386,7 +389,7 @@
 }
 
 /*
-   more efficient way to add a name to a pointer - the name must point to a 
+   more efficient way to add a name to a pointer - the name must point to a
    true string constant
 */
 void talloc_set_name_const(const void *ptr, const char *name)
@@ -508,12 +511,14 @@
 		void *child = tc->child+1;
 		const void *new_parent = null_context;
 		if (tc->child->refs) {
-			struct talloc_chunk *p = talloc_parent_chunk(tc->child->refs);
+			struct talloc_chunk *p =
+				talloc_parent_chunk(tc->child->refs);
 			if (p) new_parent = p+1;
 		}
 		if (talloc_free(child) == -1) {
 			if (new_parent == null_context) {
-				struct talloc_chunk *p = talloc_parent_chunk(ptr);
+				struct talloc_chunk *p =
+					talloc_parent_chunk(ptr);
 				if (p) new_parent = p+1;
 			}
 			talloc_steal(new_parent, child);
@@ -521,8 +526,8 @@
 	}
 }
 
-/* 
-   free a talloc pointer. This also frees all child pointers of this 
+/*
+   free a talloc pointer. This also frees all child pointers of this
    pointer recursively
 
    return 0 if the memory is actually freed, otherwise -1. The memory
@@ -581,7 +586,8 @@
   A talloc version of realloc. The context argument is only used if
   ptr is NULL
 */
-void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *name)
+void *_talloc_realloc(const void *context, void *ptr, size_t size,
+		const char *name)
 {
 	struct talloc_chunk *tc;
 	void *new_ptr;
@@ -620,9 +626,9 @@
 #else
 	new_ptr = realloc(tc, size + sizeof(*tc));
 #endif
-	if (!new_ptr) {	
-		tc->u.magic = TALLOC_MAGIC; 
-		return NULL; 
+	if (!new_ptr) {
+		tc->u.magic = TALLOC_MAGIC;
+		return NULL;
 	}
 
 	tc = new_ptr;
@@ -647,7 +653,7 @@
 	return (void *)(tc+1);
 }
 
-/* 
+/*
    move a lump of memory from one talloc context to another return the
    ptr on success, or NULL if it could not be transferred.
    passing NULL as ptr will always return NULL with no side effects.
@@ -676,7 +682,7 @@
 			if (tc->prev) tc->prev->next = tc->next;
 			if (tc->next) tc->next->prev = tc->prev;
 		}
-		
+
 		tc->parent = tc->next = tc->prev = NULL;
 		return discard_const_p(void, ptr);
 	}
@@ -711,7 +717,7 @@
 {
 	off_t total = 0;
 	struct talloc_chunk *c, *tc;
-	
+
 	if (ptr == NULL) {
 		ptr = null_context;
 	}
@@ -772,9 +778,9 @@
 			fprintf(f, "%*sreference to: %s\n", depth*4, "", name2);
 		} else {
 			const char *name = talloc_get_name(c+1);
-			fprintf(f, "%*s%-30s contains %6lu bytes in %3lu blocks (ref %d)\n", 
-				depth*4, "",
-				name,
+			fprintf(f, "%*s%-30s contains %6lu bytes "
+					"in %3lu blocks (ref %d)\n",
+				depth * 4, "", name,
 				(unsigned long)talloc_total_size(c+1),
 				(unsigned long)talloc_total_blocks(c+1),
 				talloc_reference_count(c+1));
@@ -794,8 +800,9 @@
 	}
 	if (ptr == NULL) return;
 
-	fprintf(f,"full talloc report on '%s' (total %lu bytes in %lu blocks)\n", 
-		talloc_get_name(ptr), 
+	fprintf(f, "full talloc report on '%s' "
+			"(total %lu bytes in %lu blocks)\n",
+		talloc_get_name(ptr),
 		(unsigned long)talloc_total_size(ptr),
 		(unsigned long)talloc_total_blocks(ptr));
 
@@ -814,16 +821,16 @@
 		ptr = null_context;
 	}
 	if (ptr == NULL) return;
-       
-	fprintf(f,"talloc report on '%s' (total %lu bytes in %lu blocks)\n", 
-		talloc_get_name(ptr), 
+
+	fprintf(f, "talloc report on '%s' (total %lu bytes in %lu blocks)\n",
+		talloc_get_name(ptr),
 		(unsigned long)talloc_total_size(ptr),
 		(unsigned long)talloc_total_blocks(ptr));
 
 	tc = talloc_chunk_from_ptr(ptr);
 
 	for (c=tc->child;c;c=c->next) {
-		fprintf(f, "\t%-30s contains %6lu bytes in %3lu blocks\n", 
+		fprintf(f, "\t%-30s contains %6lu bytes in %3lu blocks\n",
 			talloc_get_name(c+1),
 			(unsigned long)talloc_total_size(c+1),
 			(unsigned long)talloc_total_blocks(c+1));
@@ -879,8 +886,8 @@
 	atexit(talloc_report_null_full);
 }
 
-/* 
-   talloc and zero memory. 
+/*
+   talloc and zero memory.
 */
 void *_talloc_zero(const void *ctx, size_t size, const char *name)
 {
@@ -895,7 +902,7 @@
 
 
 /*
-  memdup with a talloc. 
+  memdup with a talloc.
 */
 void *_talloc_memdup(const void *t, const void *p, size_t size, const char *name)
 {
@@ -909,7 +916,7 @@
 }
 
 /*
-  strdup with a talloc 
+  strdup with a talloc
 */
 char *talloc_strdup(const void *t, const char *p)
 {
@@ -925,7 +932,7 @@
 }
 
 /*
-  strndup with a talloc 
+  strndup with a talloc
 */
 char *talloc_strndup(const void *t, const char *p, size_t n)
 {
@@ -953,11 +960,11 @@
 #endif
 
 char *talloc_vasprintf(const void *t, const char *fmt, va_list ap)
-{	
+{
 	int len;
 	char *ret;
 	va_list ap2;
-	
+
 	VA_COPY(ap2, ap);
 
 	len = vsnprintf(NULL, 0, fmt, ap2);
@@ -995,10 +1002,11 @@
  * accumulating output into a string buffer.
  **/
 
-static char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(2,0);
+static char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap)
+	PRINTF_ATTRIBUTE(2,0);
 
 static char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap)
-{	
+{
 	struct talloc_chunk *tc;
 	int len, s_len;
 	va_list ap2;
@@ -1043,7 +1051,8 @@
 /*
   alloc an array, checking for integer overflow in the array size
 */
-void *_talloc_array(const void *ctx, size_t el_size, unsigned count, const char *name)
+void *_talloc_array(const void *ctx, size_t el_size, unsigned count,
+		const char *name)
 {
 	if (count >= MAX_TALLOC_SIZE/el_size) {
 		return NULL;
@@ -1054,7 +1063,8 @@
 /*
   alloc an zero array, checking for integer overflow in the array size
 */
-void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count, const char *name)
+void *_talloc_zero_array(const void *ctx, size_t el_size, unsigned count,
+		const char *name)
 {
 	if (count >= MAX_TALLOC_SIZE/el_size) {
 		return NULL;
@@ -1066,7 +1076,8 @@
 /*
   realloc an array, checking for integer overflow in the array size
 */
-void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size, unsigned count, const char *name)
+void *_talloc_realloc_array(const void *ctx, void *ptr, size_t el_size,
+		unsigned count, const char *name)
 {
 	if (count >= MAX_TALLOC_SIZE/el_size) {
 		return NULL;
@@ -1075,9 +1086,10 @@
 }
 
 /*
-  a function version of talloc_realloc(), so it can be passed as a function pointer
-  to libraries that want a realloc function (a realloc function encapsulates
-  all the basic capabilities of an allocation library, which is why this is useful)
+  a function version of talloc_realloc(), so it can be passed as a function
+  pointer to libraries that want a realloc function (a realloc function
+  encapsulates all the basic capabilities of an allocation library, which is
+  why this is useful)
 */
 void *talloc_realloc_fn(const void *context, void *ptr, size_t size)
 {
@@ -1098,7 +1110,8 @@
 void *talloc_autofree_context(void)
 {
 	if (cleanup_context == NULL) {
-		cleanup_context = talloc_named_const(NULL, 0, "autofree_context");
+		cleanup_context = talloc_named_const(NULL, 0,
+				"autofree_context");
 		atexit(talloc_autofree);
 	}
 	return cleanup_context;

Modified: trunk/nfsim/core/talloc.h
===================================================================
--- trunk/nfsim/core/talloc.h	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/talloc.h	2005-10-12 12:12:20 UTC (rev 4351)
@@ -1,21 +1,21 @@
 #ifndef _TALLOC_H_
 #define _TALLOC_H_
-/* 
+/*
    Unix SMB/CIFS implementation.
    Samba temporary memory allocation functions
 
    Copyright (C) Andrew Tridgell 2004-2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -98,7 +98,7 @@
 int talloc_unlink(const void *context, void *ptr);
 void talloc_set_name(const void *ptr, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 void talloc_set_name_const(const void *ptr, const char *name);
-void *talloc_named(const void *context, size_t size, 
+void *talloc_named(const void *context, size_t size,
 		   const char *fmt, ...) PRINTF_ATTRIBUTE(3,4);
 void *talloc_named_const(const void *context, size_t size, const char *name);
 const char *talloc_get_name(const void *ptr);

Modified: trunk/nfsim/core/tui.c
===================================================================
--- trunk/nfsim/core/tui.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/core/tui.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -65,12 +65,11 @@
 static bool tui_argtest(int argc, char **argv)
 {
 	int i;
-	
+
 	for (i = 0; i < argc; i++)
 		nfsim_log(LOG_ALWAYS, "argv[%d]: \"%s\"", i, argv[i]);
-	
+
 	return true;
-	
 }
 
 static inline struct command *find_command(const char *name)
@@ -202,7 +201,7 @@
 {
 	struct command *cmd;
 	bool ret = true;
-	
+
 	if ((cmd = find_command(argv[0]))) {
 		do_pre_commands(cmd->name);
 		if (!cmd->handler(argc, argv)) {
@@ -376,7 +375,7 @@
 
 static void readline_process_line(char *line)
 {
-	char *talloc_line; 
+	char *talloc_line;
 	if (!line) {
 		stop = true;
 		return;
@@ -449,7 +448,7 @@
 	assert(strlen(command) < TUI_MAX_CMD_LEN);
 
 	cmd = talloc(NULL, struct command);
-	strncpy(cmd->name, command, TUI_MAX_CMD_LEN);	
+	strncpy(cmd->name, command, TUI_MAX_CMD_LEN);
 	cmd->handler = handler;
 	cmd->helpfn  = helpfn;
 

Modified: trunk/nfsim/tools/gen_err.c
===================================================================
--- trunk/nfsim/tools/gen_err.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/gen_err.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -47,7 +47,7 @@
 
 	packet->pad = 0;
 	memset(&packet->ehdr, 0, sizeof(packet->ehdr));
-	packet->ehdr.h_proto = htons(ETH_P_IP);	
+	packet->ehdr.h_proto = htons(ETH_P_IP);
 	packet->iph = ((struct iphdr)
 		      {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -55,8 +55,8 @@
 #else
 			      4, 5,
 #endif
-			      0, htons(len), 0, 0, 255, IPPROTO_ICMP, 0, addr->s_addr,
-			      orig->iph.saddr });
+			      0, htons(len), 0, 0, 255, IPPROTO_ICMP, 0,
+			      addr->s_addr, orig->iph.saddr });
 	packet->iph.check = ~csum_partial(&packet->iph, sizeof(packet->iph), 0);
 
 	if ((type = string_to_number(typestr, 0, 255)) < 0) {
@@ -90,7 +90,8 @@
 /*** XML Help:
     <section id="c:gen_err">
      <title><command>gen_err</command></title>
-     <para>Generate an ICMP error packet and send it through the protocol layers</para>
+     <para>Generate an ICMP error packet and send it through the protocol
+      layers</para>
      <cmdsynopsis>
       <command>gen_err</command>
       <arg choice="opt">IF=<replaceable>interface</replaceable></arg>

Modified: trunk/nfsim/tools/gen_ip.c
===================================================================
--- trunk/nfsim/tools/gen_ip.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/gen_ip.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -86,7 +86,7 @@
 
 	if (proto != -1) return (unsigned short)proto;
 
-#if 0 				/* Messes up valgrind for some reason? */
+#if 0				/* Messes up valgrind for some reason? */
 	pent = getprotobyname(s);
 	if (pent != NULL)
 		return pent->p_proto;
@@ -159,7 +159,7 @@
 			case 't': *dst = '\t'; break;
 			case '0': *dst = '\0'; break;
 			case '\\': *dst = '\\'; break;
-			case 'x': 
+			case 'x':
 				if (!hexchar(dst, str+i+1)) return NULL;
 				i += 2;
 				break;
@@ -303,7 +303,8 @@
 		u_int32_t srcip, dstip;
 		u_int8_t mbz, protocol;
 		u_int16_t proto_len;
-	} pseudo_header = { packet->iph.saddr, packet->iph.daddr, 0, IPPROTO_UDP, htons(udplen) };
+	} pseudo_header = { packet->iph.saddr, packet->iph.daddr,
+		0, IPPROTO_UDP, htons(udplen) };
 
 	if (!args[0] || (spt = string_to_number(args[0], 0, 65535)) < 0) {
 		nfsim_log(LOG_UI, "Bad udp spt: `%s'", args[0]);
@@ -337,7 +338,8 @@
 		return -1;
 	}
 
-	packet->u.udph = (struct udphdr){ htons(spt), htons(dpt), htons(udplen), 0 };
+	packet->u.udph = (struct udphdr){ htons(spt), htons(dpt),
+				htons(udplen), 0 };
 
 	packet->u.udph.check
 		= csum_fold(csum_partial(&packet->u.udph, udplen,
@@ -394,7 +396,7 @@
 	size_t i;
 
 	/* Options are simple comma-separated number list. */
-	for (i = 0, tok=strtok(opts, ","); 
+	for (i = 0, tok=strtok(opts, ",");
 	     tok && i < sizeof(options);
 	     tok=strtok(NULL, ","), i++)
 		options[i] = atol(tok);
@@ -437,7 +439,8 @@
 		u_int32_t srcip, dstip;
 		u_int8_t mbz, protocol;
 		u_int16_t proto_len;
-	} pseudo_header = { packet->iph.saddr, packet->iph.daddr, 0, IPPROTO_TCP };
+	} pseudo_header = { packet->iph.saddr, packet->iph.daddr,
+		0, IPPROTO_TCP };
 
 	packet->u.tcph.seq = packet->u.tcph.ack_seq = window = 0;
 
@@ -557,7 +560,7 @@
 	/* Ethernet header and IPv4 headers are linear for netfilter hooks. */
 	len = offsetof(struct packet, iph) + packet->iph.ihl*4;
 	skb = nfsim_nonlinear_skb(packet, len, (void *)packet + len,
-				  offsetof(struct packet, iph) 
+				  offsetof(struct packet, iph)
 				  + ntohs(packet->iph.tot_len) - len);
 	nfsim_check_packet(skb);
 

Modified: trunk/nfsim/tools/gen_ip.h
===================================================================
--- trunk/nfsim/tools/gen_ip.h	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/gen_ip.h	2005-10-12 12:12:20 UTC (rev 4351)
@@ -5,13 +5,13 @@
 #include <ipv4/ipv4.h>
 
 struct packet {
-	uint16_t pad; 
+	uint16_t pad;
 	struct ethhdr ehdr;
 	struct iphdr iph;
 	union {
 		struct tcphdr tcph;
 		struct udphdr udph;
-		struct icmphdr icmph;	
+		struct icmphdr icmph;
 		unsigned char raw_data[65536];
 	} u;
 };

Modified: trunk/nfsim/tools/hook.c
===================================================================
--- trunk/nfsim/tools/hook.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/hook.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -90,7 +90,7 @@
 		free(l);
 	}
 	return true;
-}	
+}
 
 static bool hook_cmd(int argc, char **argv)
 {

Modified: trunk/nfsim/tools/ifconfig.c
===================================================================
--- trunk/nfsim/tools/ifconfig.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/ifconfig.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -57,12 +57,12 @@
 static bool set_device(struct net_device *dev, int argc, char **argv)
 {
 	struct in_ifaddr *ifaddr;
-	
+
 	assert(dev);
 	ifaddr = ((struct in_device *)(dev->ip_ptr))->ifa_list;
 
 	assert(ifaddr);
-	
+
 	if (argc) {
 		if (!inet_atou32(*argv, &ifaddr->ifa_local)) {
 			nfsim_log(LOG_ALWAYS, "invalid interface address '%s'",
@@ -72,7 +72,7 @@
 		ifaddr->ifa_address = ifaddr->ifa_local;
 		__call_inetaddr_notifier(NETDEV_UP, ifaddr);
 	}
-	
+
 	if (!--argc)
 		return true;
 	argv++;
@@ -149,10 +149,10 @@
 {
 	struct net_device *dev;
 	struct in_device *indev;
-	
+
 	if (argc == 1) {
 		list_for_each_entry(dev, &interfaces, entry)
-		   	ifshow(dev);
+			ifshow(dev);
 		return true;
 	}
 
@@ -240,7 +240,7 @@
 	 <replaceable>netmask_bits</replaceable>
 	</arg>
         <arg choice="req">
-	 <replaceable>ip_addr</replaceable> mask 
+	 <replaceable>ip_addr</replaceable> mask
          <replaceable>netmask</replaceable>
 	</arg>
        </group>
@@ -260,7 +260,7 @@
       This command is equivalent to the previous:
       <screen>ifconfig eth2 10.0.0.1 mask 255.0.0.0 10.255.255.255 up</screen>
      </para>
-     
+
      <para>Interfaces can be brought down with the command
      <cmdsynopsis>
       <command>ifconfig</command>

Modified: trunk/nfsim/tools/info.c
===================================================================
--- trunk/nfsim/tools/info.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/info.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -35,15 +35,16 @@
 	for (i = 0; i < NPROTO; i++)
 		for (j = 0; j < NF_MAX_HOOKS; j++)
 			list_for_each_entry(hook, &nf_hooks[i][j], list)
-			 	nfsim_log(LOG_ALWAYS, "hook(%d, %-18s) to %s", i,
-					nf_hooknames[i][j],
-					hook->owner ? hook->owner->name: "nfsim");
+				nfsim_log(LOG_ALWAYS, "hook(%d, %-18s) to %s",
+					i, nf_hooknames[i][j],
+					hook->owner ?
+						hook->owner->name : "nfsim");
 
 	return true;
 }
 
 static bool sockopts(int argc, char **argv)
-{	
+{
 	struct nf_sockopt_ops *sockopt;
 
 	list_for_each_entry(sockopt, &nf_sockopts, list)
@@ -72,7 +73,7 @@
 static bool timers(int argc, char **argv)
 {
 	struct timer_list *t;
-	
+
 	list_for_each_entry(t, &__timers, entry)
 		nfsim_log(LOG_ALWAYS, "At %9d: %s:%s()", t->expires,
 			t->owner->name, t->ownerfunction);
@@ -124,7 +125,8 @@
       <varlistentry>
        <term>failpoints</term>
        <listitem>
-        <para>show how many failure points have been passed: with --failtest, each of these alternatives would be attempted.</para>
+        <para>show how many failure points have been passed: with --failtest,
+	 each of these alternatives would be attempted.</para>
        </listitem>
       </varlistentry>
      </variablelist>

Modified: trunk/nfsim/tools/module.c
===================================================================
--- trunk/nfsim/tools/module.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/module.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -95,7 +95,7 @@
 	if (!mod)
 		barf("Unknown module inc on %s\n", module->name);
 	mod->use++;
-}	
+}
 
 void __MOD_DEC_USE_COUNT(struct module *module)
 {

Modified: trunk/nfsim/tools/queue.c
===================================================================
--- trunk/nfsim/tools/queue.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/queue.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -62,9 +62,8 @@
 		nf_reinject(i->skb, i->info, verdict);
 		list_del(&i->list);
 		return true;
-		
 	}
-				
+
 	return false;
 }
 

Modified: trunk/nfsim/tools/route.c
===================================================================
--- trunk/nfsim/tools/route.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/route.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -37,7 +37,7 @@
 	 */
 
 	if (argc == 1) {
-		
+
 		if (!(mask = strchr(argv[0], '/'))) {
 			nfsim_log(LOG_UI, "no netmask bits given");
 			return -1;
@@ -46,18 +46,20 @@
 		mask++;
 
 		if (!inet_atou32(argv[0], &route->network)) {
-			nfsim_log(LOG_UI, "can't parse network address %s", argv[0]);
+			nfsim_log(LOG_UI, "can't parse network address %s",
+					argv[0]);
 			return -1;
 		}
-		
+
 		maskbits = atoi(mask);
-		
+
 		if (maskbits < 0 || maskbits > 32) {
 			nfsim_log(LOG_UI, "invalid mask bits: %s", mask);
 			return -1;
 		}
 
-		route->netmask = (maskbits==32) ? htonl(0xffffffff) : htonl(~(0xffffffff >> maskbits));
+		route->netmask = (maskbits==32) ? htonl(0xffffffff)
+					: htonl(~(0xffffffff >> maskbits));
 		route->network &= route->netmask;
 
 		return 0;
@@ -66,24 +68,28 @@
 	if (argc == 3 && !strcmp(argv[1], "mask")) {
 		uint32_t maskaddr;
 		char maxbits;
-		
+
 		if (!inet_atou32(argv[0], &route->network)) {
-			nfsim_log(LOG_UI, "can't parse network address %s", argv[0]);
+			nfsim_log(LOG_UI, "can't parse network address %s",
+					argv[0]);
 			return -1;
 		}
 
 		if (!inet_atou32(argv[2], &maskaddr)) {
-			nfsim_log(LOG_UI, "can't parse netmask address %s", argv[2]);
+			nfsim_log(LOG_UI, "can't parse netmask address %s",
+					argv[2]);
 			return -1;
 		}
 
 		maxbits = 32;
 		maskbits = 0;
-		while (((ntohl(maskaddr) << (maskbits)) & 0x80000000) && maxbits--) {
+		while (((ntohl(maskaddr) << (maskbits)) & 0x80000000)
+				&& maxbits--) {
 			maskbits++;
 		}
 
-		route->netmask = (maskbits==32) ? htonl(0xffffffff) : htonl(~(0xffffffff >> maskbits));
+		route->netmask = (maskbits==32) ? htonl(0xffffffff)
+				: htonl(~(0xffffffff >> maskbits));
 		route->network &= route->netmask;
 
 		return 0;
@@ -113,7 +119,8 @@
 	char netmask[16];
 
 	if (argc == 1 || (argc == 2 && !strcmp(argv[1], "print"))) {
-		nfsim_log(LOG_UI, "%-15s %-15s %-10s", "network", "netmask", "iface");
+		nfsim_log(LOG_UI, "%-15s %-15s %-10s",
+				"network", "netmask", "iface");
 		struct ipv4_route *route;
 		list_for_each_entry(route, &routes, entry) {
 			strncpy(network,inet_u32toa(route->network),16);
@@ -132,12 +139,12 @@
 		struct ipv4_route *route;
 		struct net_device *dev;
 
-		/* 
+		/*
 		   route add 10.0.0.0/24 eth0
 		     -or-
 		   route add 10.0.0.0 mask 255.0.0.0 eth0
 		 */
-		
+
 		if (argc != 4 && argc != 6) {
 			nfsim_log(LOG_UI, "not enough arguments");
 			return false;
@@ -235,7 +242,7 @@
 	 <replaceable>netmask_bits</replaceable>
 	</arg>
         <arg choice="req">
-	 <replaceable>ip_addr</replaceable> mask 
+	 <replaceable>ip_addr</replaceable> mask
          <replaceable>netmask</replaceable>
 	</arg>
        </group>

Modified: trunk/nfsim/tools/tcpsession.c
===================================================================
--- trunk/nfsim/tools/tcpsession.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/tcpsession.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -134,7 +134,7 @@
 	argv[argc++] = talloc_asprintf(ctx, "{IPv4 %s %s %i 6 %s %s %s"
 				       " SEQ=%u ACK=%u*}",
 				       out->dst, out->src,
-				       datalen + curr->lenchange, 
+				       datalen + curr->lenchange,
 				       out->dpt, out->spt, flags,
 				       out->ack, out->seq);
 	argv[argc] = NULL;
@@ -175,9 +175,9 @@
 	return false;
 }
 
-static bool open_session(const char *src, const char *dst, 
-			 const char *spt, const char *dpt, 
-			 const char *reply_src, const char *reply_dst, 
+static bool open_session(const char *src, const char *dst,
+			 const char *spt, const char *dpt,
+			 const char *reply_src, const char *reply_dst,
 			 const char *reply_spt, const char *reply_dpt)
 {
 	curr = talloc(NULL, struct tcpsession);
@@ -221,7 +221,7 @@
 }
 
 static bool send_data(struct tcp_endpoint *in, struct tcp_endpoint *out,
-		      int datanum, char *data[])		      
+		      int datanum, char *data[])
 {
 	int len = gen_ip_data_length(datanum, data);
 

Modified: trunk/nfsim/tools/time.c
===================================================================
--- trunk/nfsim/tools/time.c	2005-10-12 10:34:34 UTC (rev 4350)
+++ trunk/nfsim/tools/time.c	2005-10-12 12:12:20 UTC (rev 4351)
@@ -28,7 +28,7 @@
 
 static int find_last_timer(void)
 {
-       if (list_empty(&__timers)) 
+       if (list_empty(&__timers))
                return 0;
 
        return list_entry(__timers.prev, struct timer_list, entry)->expires;




More information about the netfilter-cvslog mailing list