svn commit: r327214 - head/sys/netinet/libalias

Michael Tuexen tuexen at FreeBSD.org
Tue Dec 26 16:33:57 UTC 2017


Author: tuexen
Date: Tue Dec 26 16:33:55 2017
New Revision: 327214
URL: https://svnweb.freebsd.org/changeset/base/327214

Log:
  White cleanups.

Modified:
  head/sys/netinet/libalias/alias_sctp.c

Modified: head/sys/netinet/libalias/alias_sctp.c
==============================================================================
--- head/sys/netinet/libalias/alias_sctp.c	Tue Dec 26 16:29:39 2017	(r327213)
+++ head/sys/netinet/libalias/alias_sctp.c	Tue Dec 26 16:33:55 2017	(r327214)
@@ -27,7 +27,7 @@
  */
 
 /*
- * Alias_sctp forms part of the libalias kernel module to handle 
+ * Alias_sctp forms part of the libalias kernel module to handle
  * Network Address Translation (NAT) for the SCTP protocol.
  *
  *  This software was developed by David A. Hayes and Jason But
@@ -39,13 +39,13 @@
  * proposed by Jason But and Grenville Armitage:
  * http://caia.swin.edu.au/urp/sonata/
  *
- * 
+ *
  * This project has been made possible in part by a grant from
  * the Cisco University Research Program Fund at Community
  * Foundation Silicon Valley.
  *
  */
-/** @mainpage 
+/** @mainpage
  * Alias_sctp is part of the SONATA (http://caia.swin.edu.au/urp/sonata) project
  * to develop and release a BSD licensed implementation of a Network Address
  * Translation (NAT) module that supports the Stream Control Transmission
@@ -176,7 +176,7 @@ static void SctpAliasLog(const char *format, ...);
  *
  * Calls the higher level ShowAliasStats() in alias_db.c which logs all current
  * statistics about the libalias instance - including SCTP statistics
- * 
+ *
  * @param la Pointer to the libalias instance
  */
 void SctpShowAliasStats(struct libalias *la);
@@ -261,7 +261,7 @@ static MALLOC_DEFINE(M_SCTPNAT, "sctpnat", "sctp nat d
  * Define various log levels and a macro to call specified log functions only if
  * the current log level (sysctl_log_level) matches the specified level @{
  */
-#define	SN_LOG_LOW	  0	
+#define	SN_LOG_LOW	  0
 #define SN_LOG_EVENT      1
 #define	SN_LOG_INFO	  2
 #define	SN_LOG_DETAIL	  3
@@ -422,8 +422,8 @@ int sysctl_chg_loglevel(SYSCTL_HANDLER_ARGS)
 	error = sysctl_handle_int(oidp, &level, 0, req);
 	if (error) return (error);
 
-	level = (level > SN_LOG_DEBUG_MAX)?(SN_LOG_DEBUG_MAX):(level);
-	level = (level < SN_LOG_LOW)?(SN_LOG_LOW):(level);
+	level = (level > SN_LOG_DEBUG_MAX) ? (SN_LOG_DEBUG_MAX) : (level);
+	level = (level < SN_LOG_LOW) ? (SN_LOG_LOW) : (level);
 	sysctl_log_level = level;
 	return (0);
 }
@@ -443,12 +443,11 @@ int sysctl_chg_timer(SYSCTL_HANDLER_ARGS)
 	error = sysctl_handle_int(oidp, &timer, 0, req);
 	if (error) return (error);
 
-	timer = (timer > SN_MAX_TIMER)?(SN_MAX_TIMER):(timer);
+	timer = (timer > SN_MAX_TIMER) ? (SN_MAX_TIMER) : (timer);
 
-	if (((u_int *)arg1) != &sysctl_holddown_timer)
-	    {
-		    timer = (timer < SN_MIN_TIMER)?(SN_MIN_TIMER):(timer);
-	    }
+	if (((u_int *)arg1) != &sysctl_holddown_timer) {
+		timer = (timer < SN_MIN_TIMER) ? (SN_MIN_TIMER) : (timer);
+	}
 
 	*(u_int *)arg1 = timer;
 
@@ -472,11 +471,11 @@ int sysctl_chg_hashtable_size(SYSCTL_HANDLER_ARGS)
 	error = sysctl_handle_int(oidp, &size, 0, req);
 	if (error) return (error);
 
-	size = (size < SN_MIN_HASH_SIZE)?(SN_MIN_HASH_SIZE):((size > SN_MAX_HASH_SIZE)?(SN_MAX_HASH_SIZE):(size));
+	size = (size < SN_MIN_HASH_SIZE) ? (SN_MIN_HASH_SIZE) : ((size > SN_MAX_HASH_SIZE) ? (SN_MAX_HASH_SIZE) : (size));
 
 	size |= 0x00000001; /* make odd */
 
-	for(;(((size % 3) == 0) || ((size % 5) == 0) || ((size % 7) == 0) || ((size % 11) == 0)); size+=2);
+	for (;(((size % 3) == 0) || ((size % 5) == 0) || ((size % 7) == 0) || ((size % 11) == 0)); size+=2);
 	sysctl_hashtable_size = size;
 
 	return (0);
@@ -485,7 +484,7 @@ int sysctl_chg_hashtable_size(SYSCTL_HANDLER_ARGS)
 /** @ingroup sysctl
  * @brief sysctl callback for changing net.inet.ip.alias.sctp.error_on_ootb
  *
- * Updates the error_on_clash sysctl variable. 
+ * Updates the error_on_clash sysctl variable.
  * If set to 0, no ErrorM will be sent if there is a look up table clash
  * If set to 1, an ErrorM is sent only to the local side
  * If set to 2, an ErrorM is sent to the local side and global side if there is
@@ -540,16 +539,16 @@ int sysctl_chg_initialising_chunk_proc_limit(SYSCTL_HA
 	if (error) return (error);
 
 	sysctl_initialising_chunk_proc_limit = (proclimit < 1) ? 1: proclimit;
-	sysctl_chunk_proc_limit = 
+	sysctl_chunk_proc_limit =
 		(sysctl_chunk_proc_limit < sysctl_initialising_chunk_proc_limit) ? sysctl_initialising_chunk_proc_limit : sysctl_chunk_proc_limit;
- 
+
 	return (0);
 }
 
 /** @ingroup sysctl
  * @brief sysctl callback for changing net.inet.ip.alias.sctp.chunk_proc_limit
  *
- * Updates the chunk_proc_limit sysctl variable. 
+ * Updates the chunk_proc_limit sysctl variable.
  * Number of chunks that should be processed to find key chunk:
  *  >= initialising_chunk_proc_limit (A high value is a DoS risk)
  */
@@ -561,7 +560,7 @@ int sysctl_chg_chunk_proc_limit(SYSCTL_HANDLER_ARGS)
 	error = sysctl_handle_int(oidp, &proclimit, 0, req);
 	if (error) return (error);
 
-	sysctl_chunk_proc_limit = 
+	sysctl_chunk_proc_limit =
 		(proclimit < sysctl_initialising_chunk_proc_limit) ? sysctl_initialising_chunk_proc_limit : proclimit;
 
 	return (0);
@@ -571,7 +570,7 @@ int sysctl_chg_chunk_proc_limit(SYSCTL_HANDLER_ARGS)
 /** @ingroup sysctl
  * @brief sysctl callback for changing net.inet.ip.alias.sctp.param_proc_limit
  *
- * Updates the param_proc_limit sysctl variable. 
+ * Updates the param_proc_limit sysctl variable.
  * Number of parameters that should be processed to find key parameters:
  *  > 1 (A high value is a DoS risk)
  */
@@ -583,7 +582,7 @@ int sysctl_chg_param_proc_limit(SYSCTL_HANDLER_ARGS)
 	error = sysctl_handle_int(oidp, &proclimit, 0, req);
 	if (error) return (error);
 
-	sysctl_param_proc_limit = 
+	sysctl_param_proc_limit =
 		(proclimit < 2) ? 2 : proclimit;
 
 	return (0);
@@ -614,9 +613,9 @@ int sysctl_chg_track_global_addresses(SYSCTL_HANDLER_A
  *                            CODE BEGINS HERE
  * ----------------------------------------------------------------------
  */
-/** 
+/**
  * @brief Initialises the SCTP NAT Implementation
- * 
+ *
  * Creates the look-up tables and the timer queue and initialises all state
  * variables
  *
@@ -650,7 +649,7 @@ void AliasSctpInit(struct libalias *la)
 	la->sctpLinkCount = 0;
 }
 
-/** 
+/**
  * @brief Cleans-up the SCTP NAT Implementation prior to unloading
  *
  * Removes all entries from the timer queue, freeing associations as it goes.
@@ -705,7 +704,7 @@ void AliasSctpTerm(struct libalias *la)
  * @param la Pointer to the relevant libalias instance
  * @param pip Pointer to IP packet to process
  * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
- * 
+ *
  * @return  PKT_ALIAS_OK | PKT_ALIAS_IGNORE | PKT_ALIAS_ERROR
  */
 int
@@ -717,10 +716,10 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir
 
 	if ((direction != SN_TO_LOCAL) && (direction != SN_TO_GLOBAL)) {
 		SctpAliasLog("ERROR: Invalid direction\n");
-		return(PKT_ALIAS_ERROR);
+		return (PKT_ALIAS_ERROR);
 	}
 
-	sctp_CheckTimers(la); /* Check timers */ 
+	sctp_CheckTimers(la); /* Check timers */
 
 	/* Parse the packet */
 	rtnval = sctp_PktParser(la, direction, pip, &msg, &assoc); //using *char (change to mbuf when get code from paolo)
@@ -735,24 +734,24 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir
 		}
 		SN_LOG(SN_LOG_EVENT,
 		    logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
-		return(PKT_ALIAS_ERROR);
+		return (PKT_ALIAS_ERROR);
 	case SN_PARSE_ERROR_PARTIALLOOKUP:
 		if (sysctl_error_on_ootb > SN_LOCALandPARTIAL_ERROR_ON_OOTB) {
 			SN_LOG(SN_LOG_EVENT,
 			    logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
-			return(PKT_ALIAS_ERROR);
+			return (PKT_ALIAS_ERROR);
 		}
 	case SN_PARSE_ERROR_LOOKUP:
 		if (sysctl_error_on_ootb == SN_ERROR_ON_OOTB ||
 		    (sysctl_error_on_ootb == SN_LOCALandPARTIAL_ERROR_ON_OOTB && direction == SN_TO_LOCAL) ||
 		    (sysctl_error_on_ootb == SN_LOCAL_ERROR_ON_OOTB && direction == SN_TO_GLOBAL)) {
 			TxAbortErrorM(la, &msg, assoc, SN_REFLECT_ERROR, direction); /*NB assoc=NULL */
-			return(PKT_ALIAS_RESPOND);
+			return (PKT_ALIAS_RESPOND);
 		}
 	default:
 		SN_LOG(SN_LOG_EVENT,
 		    logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
-		return(PKT_ALIAS_ERROR);
+		return (PKT_ALIAS_ERROR);
 	}
 
 	SN_LOG(SN_LOG_DETAIL,
@@ -770,9 +769,9 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir
 		);
 	SN_LOG(SN_LOG_DEBUG, logTimerQ(la));
 
-	switch(rtnval){
+	switch (rtnval) {
 	case SN_NAT_PKT:
-		switch(direction) {
+		switch (direction) {
 		case SN_TO_LOCAL:
 			DifferentialChecksum(&(msg.ip_hdr->ip_sum),
 			    &(assoc->l_addr), &(msg.ip_hdr->ip_dst), 2);
@@ -794,7 +793,7 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir
 		break;
 	case SN_REPLY_ABORT:
 	case SN_REPLY_ERROR:
-	case SN_SEND_ABORT: 
+	case SN_SEND_ABORT:
 		TxAbortErrorM(la, &msg, assoc, rtnval, direction);
 		break;
 	default:
@@ -814,22 +813,22 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir
 		freeGlobalAddressList(assoc);
 		sn_free(assoc);
 	}
-	switch(rtnval) {
+	switch (rtnval) {
 	case SN_NAT_PKT:
-		return(PKT_ALIAS_OK);
+		return (PKT_ALIAS_OK);
 	case SN_SEND_ABORT:
-		return(PKT_ALIAS_OK);
+		return (PKT_ALIAS_OK);
 	case SN_REPLY_ABORT:
 	case SN_REPLY_ERROR:
 	case SN_REFLECT_ERROR:
-		return(PKT_ALIAS_RESPOND);
+		return (PKT_ALIAS_RESPOND);
 	case SN_DROP_PKT:
 	default:
-		return(PKT_ALIAS_ERROR);
+		return (PKT_ALIAS_ERROR);
 	}
 }
 
-/** 
+/**
  * @brief Send an AbortM or ErrorM
  *
  * We construct the new SCTP packet to send in place of the existing packet we
@@ -865,7 +864,7 @@ SctpAlias(struct libalias *la, struct ip *pip, int dir
 static uint32_t
 local_sctp_finalize_crc32(uint32_t crc32c)
 {
-	/* This routine is duplicated from SCTP 
+	/* This routine is duplicated from SCTP
 	 * we need to do that since it MAY be that SCTP
 	 * is NOT compiled into the kernel. The CRC32C routines
 	 * however are always available in libkern.
@@ -924,7 +923,7 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg
 	ip->ip_hl = 5; /* 5*32 bit words */
 	ip->ip_tos = 0;
 	ip->ip_len = htons(ip_size);
-	ip->ip_id =  sm->ip_hdr->ip_id;
+	ip->ip_id = sm->ip_hdr->ip_id;
 	ip->ip_off = 0;
 	ip->ip_ttl = 255;
 	ip->ip_p = IPPROTO_SCTP;
@@ -937,7 +936,7 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg
 	chunk_hdr->chunk_type = (sndrply & SN_TX_ABORT) ? SCTP_ABORT_ASSOCIATION : SCTP_OPERATION_ERROR;
 	chunk_hdr->chunk_flags = SCTP_MIDDLEBOX_FLAG;
 	if (include_error_cause) {
-		error_cause->code = htons((sndrply & SN_REFLECT_ERROR) ? SCTP_MISSING_NAT :  SCTP_NAT_TABLE_COLLISION);
+		error_cause->code = htons((sndrply & SN_REFLECT_ERROR) ? SCTP_MISSING_NAT : SCTP_NAT_TABLE_COLLISION);
 		error_cause->length = htons(sizeof(struct sctp_error_cause));
 		chunk_hdr->chunk_length = htons(sizeof(*chunk_hdr) + sizeof(struct sctp_error_cause));
 	} else {
@@ -945,22 +944,22 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg
 	}
 
 	/* set specific values */
-	switch(sndrply) {
+	switch (sndrply) {
 	case SN_REFLECT_ERROR:
 		chunk_hdr->chunk_flags |= SCTP_HAD_NO_TCB; /* set Tbit */
-		sctp_hdr->v_tag =  sm->sctp_hdr->v_tag;
+		sctp_hdr->v_tag = sm->sctp_hdr->v_tag;
 		break;
 	case SN_REPLY_ERROR:
-		sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag :  assoc->l_vtag ;
+		sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag : assoc->l_vtag ;
 		break;
 	case SN_SEND_ABORT:
-		sctp_hdr->v_tag =  sm->sctp_hdr->v_tag;
+		sctp_hdr->v_tag = sm->sctp_hdr->v_tag;
 		break;
 	case SN_REPLY_ABORT:
 		sctp_hdr->v_tag = sm->sctpchnk.Init->initiate_tag;
 		break;
 	}
-  
+
 	/* Set send/reply values */
 	if (sndrply == SN_SEND_ABORT) { /*pass through NAT */
 		ip->ip_src = (direction == SN_TO_LOCAL) ? sm->ip_hdr->ip_src : assoc->a_addr;
@@ -973,10 +972,10 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg
 		sctp_hdr->src_port = sm->sctp_hdr->dest_port;
 		sctp_hdr->dest_port = sm->sctp_hdr->src_port;
 	}
-  
+
 	/* Calculate IP header checksum */
 	ip->ip_sum = in_cksum_hdr(ip);
-  
+
 	/* calculate SCTP header CRC32 */
 	sctp_hdr->checksum = 0;
 	sctp_hdr->checksum = local_sctp_finalize_crc32(calculate_crc32c(0xffffffff, (unsigned char *) sctp_hdr, sctp_size));
@@ -1003,18 +1002,18 @@ TxAbortErrorM(struct libalias *la, struct sctp_nat_msg
  */
 /** @ingroup packet_parser
  * @brief Parses SCTP packets for the key SCTP chunk that will be processed
- * 
+ *
  * This module parses SCTP packets for the key SCTP chunk that will be processed
  * The module completes the sctp_nat_msg structure and either retrieves the
  * relevant (existing) stored association from the Hash Tables or creates a new
  * association entity with state SN_ID
  *
  * @param la Pointer to the relevant libalias instance
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
- * @param pip 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
+ * @param pip
  * @param sm Pointer to sctp message information
  * @param passoc Pointer to the association this SCTP Message belongs to
- * 
+ *
  * @return SN_PARSE_OK | SN_PARSE_ERROR_*
  */
 static int
@@ -1049,26 +1048,26 @@ sctp_PktParser(struct libalias *la, int direction, str
 	/* Check SCTP header length and move to first chunk */
 	if (bytes_left < sizeof(struct sctphdr)) {
 		sm->sctp_hdr = NULL;
-		return(SN_PARSE_ERROR_IPSHL); /* packet not long enough*/
+		return (SN_PARSE_ERROR_IPSHL); /* packet not long enough*/
 	}
 
 	sm->sctp_hdr = sctp_hdr = (struct sctphdr *) ip_next(pip);
 	bytes_left -= sizeof(struct sctphdr);
-  
+
 	/* Check for valid ports (zero valued ports would find partially initialised associations */
 	if (sctp_hdr->src_port == 0 || sctp_hdr->dest_port == 0)
-		return(SN_PARSE_ERROR_PORT);
+		return (SN_PARSE_ERROR_PORT);
 
 	/* Check length of first chunk */
 	if (bytes_left < SN_MIN_CHUNK_SIZE) /* malformed chunk - could cause endless loop*/
-		return(SN_PARSE_ERROR_CHHL); /* packet not long enough for this chunk */
-  
+		return (SN_PARSE_ERROR_CHHL); /* packet not long enough for this chunk */
+
 	/* First chunk */
 	chunk_hdr = SN_SCTP_FIRSTCHUNK(sctp_hdr);
-  
+
 	chunk_length = SCTP_SIZE32(ntohs(chunk_hdr->chunk_length));
 	if ((chunk_length < SN_MIN_CHUNK_SIZE) || (chunk_length > bytes_left)) /* malformed chunk - could cause endless loop*/
-		return(SN_PARSE_ERROR_CHHL);
+		return (SN_PARSE_ERROR_CHHL);
 
 	if ((chunk_hdr->chunk_flags & SCTP_HAD_NO_TCB) &&
 	    ((chunk_hdr->chunk_type == SCTP_ABORT_ASSOCIATION) ||
@@ -1091,43 +1090,43 @@ sctp_PktParser(struct libalias *la, int direction, str
 	sm->msg = SN_SCTP_OTHER;/* Initialise to largest value*/
 	sm->chunk_length = 0; /* only care about length for key chunks */
 	while (IS_SCTP_CONTROL(chunk_hdr)) {
-		switch(chunk_hdr->chunk_type) {
+		switch (chunk_hdr->chunk_type) {
 		case SCTP_INITIATION:
 			if (chunk_length < sizeof(struct sctp_init_chunk)) /* malformed chunk*/
-				return(SN_PARSE_ERROR_CHHL);
+				return (SN_PARSE_ERROR_CHHL);
 			sm->msg = SN_SCTP_INIT;
 			sm->sctpchnk.Init = (struct sctp_init *) ((char *) chunk_hdr + sizeof(struct sctp_chunkhdr));
 			sm->chunk_length = chunk_length;
 			/* if no existing association, create a new one */
 			if (*passoc == NULL) {
-				if (sctp_hdr->v_tag == 0){ //Init requires vtag=0
+				if (sctp_hdr->v_tag == 0) { //Init requires vtag=0
 					*passoc = (struct sctp_nat_assoc *) sn_malloc(sizeof(struct sctp_nat_assoc));
-					if (*passoc == NULL) {/* out of resources */ 
-						return(SN_PARSE_ERROR_AS_MALLOC);
+					if (*passoc == NULL) {/* out of resources */
+						return (SN_PARSE_ERROR_AS_MALLOC);
 					}
 					/* Initialise association - malloc initialises memory to zeros */
 					(*passoc)->state = SN_ID;
 					LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */
 					(*passoc)->TableRegister = SN_NULL_TBL;
-					return(SN_PARSE_OK);
+					return (SN_PARSE_OK);
 				}
-				return(SN_PARSE_ERROR_VTAG);
+				return (SN_PARSE_ERROR_VTAG);
 			}
-			return(SN_PARSE_ERROR_LOOKUP);
+			return (SN_PARSE_ERROR_LOOKUP);
 		case SCTP_INITIATION_ACK:
 			if (chunk_length < sizeof(struct sctp_init_ack_chunk)) /* malformed chunk*/
-				return(SN_PARSE_ERROR_CHHL);
+				return (SN_PARSE_ERROR_CHHL);
 			sm->msg = SN_SCTP_INITACK;
 			sm->sctpchnk.InitAck = (struct sctp_init_ack *) ((char *) chunk_hdr + sizeof(struct sctp_chunkhdr));
 			sm->chunk_length = chunk_length;
-			return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK));
+			return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK));
 		case SCTP_ABORT_ASSOCIATION: /* access only minimum sized chunk */
 			sm->msg = SN_SCTP_ABORT;
 			sm->chunk_length = chunk_length;
-			return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP_ABORT):(SN_PARSE_OK));
+			return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP_ABORT) : (SN_PARSE_OK));
 		case SCTP_SHUTDOWN_ACK:
 			if (chunk_length < sizeof(struct sctp_shutdown_ack_chunk)) /* malformed chunk*/
-				return(SN_PARSE_ERROR_CHHL);
+				return (SN_PARSE_ERROR_CHHL);
 			if (sm->msg > SN_SCTP_SHUTACK) {
 				sm->msg = SN_SCTP_SHUTACK;
 				sm->chunk_length = chunk_length;
@@ -1138,11 +1137,11 @@ sctp_PktParser(struct libalias *la, int direction, str
 				sm->msg = SN_SCTP_SHUTCOMP;
 				sm->chunk_length = chunk_length;
 			}
-			return ((*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK));
+			return ((*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK));
 		case SCTP_ASCONF:
 			if (sm->msg > SN_SCTP_ASCONF) {
 				if (chunk_length < (sizeof(struct  sctp_asconf_chunk) + sizeof(struct  sctp_ipv4addr_param))) /* malformed chunk*/
-					return(SN_PARSE_ERROR_CHHL);
+					return (SN_PARSE_ERROR_CHHL);
 				//leave parameter searching to later, if required
 				param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr + sizeof(struct sctp_asconf_chunk)); /*compulsory IP parameter*/
 				if (ntohs(param_hdr->param_type) == SCTP_IPV4_ADDRESS) {
@@ -1151,38 +1150,38 @@ sctp_PktParser(struct libalias *la, int direction, str
 						ipv4addr.s_addr = ((struct sctp_ipv4addr_param *) param_hdr)->addr;
 						*passoc = FindSctpGlobal(la, ipv4addr, sctp_hdr->v_tag, sctp_hdr->src_port, sctp_hdr->dest_port, &partial_match);
 					}
-					param_hdr = (struct sctp_paramhdr *) 
+					param_hdr = (struct sctp_paramhdr *)
 						((char *) param_hdr + sizeof(struct sctp_ipv4addr_param)); /*asconf's compulsory address parameter */
 					sm->chunk_length = chunk_length - sizeof(struct  sctp_asconf_chunk) - sizeof(struct  sctp_ipv4addr_param); /* rest of chunk */
 				} else {
 					if (chunk_length < (sizeof(struct  sctp_asconf_chunk) + sizeof(struct  sctp_ipv6addr_param))) /* malformed chunk*/
-						return(SN_PARSE_ERROR_CHHL);
-					param_hdr = (struct sctp_paramhdr *) 
-						((char *) param_hdr + sizeof(struct sctp_ipv6addr_param)); /*asconf's compulsory address parameter */	  
+						return (SN_PARSE_ERROR_CHHL);
+					param_hdr = (struct sctp_paramhdr *)
+						((char *) param_hdr + sizeof(struct sctp_ipv6addr_param)); /*asconf's compulsory address parameter */
 					sm->chunk_length = chunk_length - sizeof(struct  sctp_asconf_chunk) - sizeof(struct  sctp_ipv6addr_param); /* rest of chunk */
 				}
 				sm->msg = SN_SCTP_ASCONF;
 				sm->sctpchnk.Asconf = param_hdr;
-	
+
 				if (*passoc == NULL) { /* AddIP with no association */
 					*passoc = (struct sctp_nat_assoc *) sn_malloc(sizeof(struct sctp_nat_assoc));
-					if (*passoc == NULL) {/* out of resources */ 
-						return(SN_PARSE_ERROR_AS_MALLOC);
+					if (*passoc == NULL) {/* out of resources */
+						return (SN_PARSE_ERROR_AS_MALLOC);
 					}
 					/* Initialise association  - malloc initialises memory to zeros */
 					(*passoc)->state = SN_ID;
 					LIST_INIT(&((*passoc)->Gaddr)); /* always initialise to avoid memory problems */
 					(*passoc)->TableRegister = SN_NULL_TBL;
-					return(SN_PARSE_OK);
+					return (SN_PARSE_OK);
 				}
 			}
 			break;
 		case SCTP_ASCONF_ACK:
 			if (sm->msg > SN_SCTP_ASCONFACK) {
 				if (chunk_length < sizeof(struct  sctp_asconf_ack_chunk)) /* malformed chunk*/
-					return(SN_PARSE_ERROR_CHHL);
+					return (SN_PARSE_ERROR_CHHL);
 				//leave parameter searching to later, if required
-				param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr 
+				param_hdr = (struct sctp_paramhdr *) ((char *) chunk_hdr
 				    + sizeof(struct sctp_asconf_ack_chunk));
 				sm->msg = SN_SCTP_ASCONFACK;
 				sm->sctpchnk.Asconf = param_hdr;
@@ -1195,33 +1194,33 @@ sctp_PktParser(struct libalias *la, int direction, str
 
 		/* if no association is found exit - we need to find an Init or AddIP within sysctl_initialising_chunk_proc_limit */
 		if ((*passoc == NULL) && (chunk_count >= sysctl_initialising_chunk_proc_limit))
-			return(SN_PARSE_ERROR_LOOKUP);
+			return (SN_PARSE_ERROR_LOOKUP);
 
 		/* finished with this chunk, on to the next chunk*/
 		bytes_left-= chunk_length;
 
 		/* Is this the end of the packet ? */
 		if (bytes_left == 0)
-			return (*passoc == NULL)?(SN_PARSE_ERROR_LOOKUP):(SN_PARSE_OK);
+			return (*passoc == NULL) ? (SN_PARSE_ERROR_LOOKUP) : (SN_PARSE_OK);
 
 		/* Are there enough bytes in packet to at least retrieve length of next chunk ? */
 		if (bytes_left < SN_MIN_CHUNK_SIZE)
-			return(SN_PARSE_ERROR_CHHL);
+			return (SN_PARSE_ERROR_CHHL);
 
 		chunk_hdr = SN_SCTP_NEXTCHUNK(chunk_hdr);
 
 		/* Is the chunk long enough to not cause endless look and are there enough bytes in packet to read the chunk ? */
 		chunk_length = SCTP_SIZE32(ntohs(chunk_hdr->chunk_length));
 		if ((chunk_length < SN_MIN_CHUNK_SIZE) || (chunk_length > bytes_left))
-			return(SN_PARSE_ERROR_CHHL);
-		if(++chunk_count > sysctl_chunk_proc_limit)
-			return(SN_PARSE_OK); /* limit for processing chunks, take what we get */
+			return (SN_PARSE_ERROR_CHHL);
+		if (++chunk_count > sysctl_chunk_proc_limit)
+			return (SN_PARSE_OK); /* limit for processing chunks, take what we get */
 	}
 
 	if (*passoc == NULL)
-		return (partial_match)?(SN_PARSE_ERROR_PARTIALLOOKUP):(SN_PARSE_ERROR_LOOKUP);
+		return (partial_match) ? (SN_PARSE_ERROR_PARTIALLOOKUP) : (SN_PARSE_ERROR_LOOKUP);
 	else
-		return(SN_PARSE_OK);
+		return (SN_PARSE_OK);
 }
 
 /** @ingroup packet_parser
@@ -1229,7 +1228,7 @@ sctp_PktParser(struct libalias *la, int direction, str
  *
  * GetAsconfVtags scans an Asconf Chunk for the vtags parameter, and then
  * extracts the vtags.
- * 
+ *
  * GetAsconfVtags is not called from within sctp_PktParser. It is called only
  * from within ID_process when an AddIP has been received.
  *
@@ -1237,9 +1236,9 @@ sctp_PktParser(struct libalias *la, int direction, str
  * @param sm Pointer to sctp message information
  * @param l_vtag Pointer to the local vtag in the association this SCTP Message belongs to
  * @param g_vtag Pointer to the local vtag in the association this SCTP Message belongs to
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
- * 
- * @return 1 - success | 0 - fail 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
+ *
+ * @return 1 - success | 0 - fail
  */
 static int
 GetAsconfVtags(struct libalias *la, struct sctp_nat_msg *sm, uint32_t *l_vtag, uint32_t *g_vtag, int direction)
@@ -1251,7 +1250,7 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms
 		uint32_t local_vtag;
 		uint32_t remote_vtag;
 	}                    __attribute__((packed));
-  
+
 	struct sctp_vtag_param *vtag_param;
 	struct sctp_paramhdr *param;
 	int bytes_left;
@@ -1266,7 +1265,7 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms
 	while((bytes_left >= param_size) && (bytes_left >= SN_VTAG_PARAM_SIZE)) {
 		if (ntohs(param->param_type) == SCTP_VTAG_PARAM) {
 			vtag_param = (struct sctp_vtag_param *) param;
-			switch(direction) {
+			switch (direction) {
 				/* The Internet draft is a little ambigious as to order of these vtags.
 				   We think it is this way around. If we are wrong, the order will need
 				   to be changed. */
@@ -1279,11 +1278,11 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms
 				*l_vtag = vtag_param->local_vtag;
 				break;
 			}
-			return(1); /* found */
+			return (1); /* found */
 		}
 
 		bytes_left -= param_size;
-		if (bytes_left < SN_MIN_PARAM_SIZE) return(0);
+		if (bytes_left < SN_MIN_PARAM_SIZE) return (0);
 
 		param = SN_SCTP_NEXTPARAM(param);
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
@@ -1291,22 +1290,22 @@ GetAsconfVtags(struct libalias *la, struct sctp_nat_ms
 			SN_LOG(SN_LOG_EVENT,
 			    logsctperror("Parameter parse limit exceeded (GetAsconfVtags)",
 				sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
-			return(0); /* not found limit exceeded*/
+			return (0); /* not found limit exceeded*/
 		}
 	}
-	return(0); /* not found */
+	return (0); /* not found */
 }
 
 /** @ingroup packet_parser
  * @brief AddGlobalIPAddresses from Init,InitAck,or AddIP packets
- * 
+ *
  * AddGlobalIPAddresses scans an SCTP chunk (in sm) for Global IP addresses, and
  * adds them.
  *
  * @param sm Pointer to sctp message information
  * @param assoc Pointer to the association this SCTP Message belongs to
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
- * 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
+ *
  */
 static void
 AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction)
@@ -1319,7 +1318,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 	int param_size;
 	int param_count, addr_param_count = 0;
 
-	switch(direction) {
+	switch (direction) {
 	case SN_TO_GLOBAL: /* does not contain global addresses */
 		g_addr = sm->ip_hdr->ip_dst;
 		bytes_left = 0; /* force exit */
@@ -1327,7 +1326,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 	case SN_TO_LOCAL:
 		g_addr = sm->ip_hdr->ip_src;
 		param_count = 1;
-		switch(sm->msg) {
+		switch (sm->msg) {
 		case SN_SCTP_INIT:
 			bytes_left = sm->chunk_length - sizeof(struct sctp_init_chunk);
 			param = (struct sctp_paramhdr *)((char *)sm->sctpchnk.Init + sizeof(struct sctp_init));
@@ -1342,16 +1341,16 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 			break;
 		}
 	}
-	if (bytes_left >= SN_MIN_PARAM_SIZE)	
+	if (bytes_left >= SN_MIN_PARAM_SIZE)
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
 	else
 		param_size = bytes_left+1; /* force skip loop */
-  
-	if ((assoc->state == SN_ID) && ((sm->msg == SN_SCTP_INIT) || (bytes_left < SN_MIN_PARAM_SIZE))) {/* add pkt address */ 
+
+	if ((assoc->state == SN_ID) && ((sm->msg == SN_SCTP_INIT) || (bytes_left < SN_MIN_PARAM_SIZE))) {/* add pkt address */
 		G_Addr = (struct sctp_GlobalAddress *) sn_malloc(sizeof(struct sctp_GlobalAddress));
-		if (G_Addr == NULL) {/* out of resources */ 
+		if (G_Addr == NULL) {/* out of resources */
 			SN_LOG(SN_LOG_EVENT,
-			    logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", 
+			    logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking",
 				sm->sctp_hdr->v_tag,  0, direction));
 			assoc->num_Gaddr = 0; /* don't track any more for this assoc*/
 			sysctl_track_global_addresses=0;
@@ -1360,7 +1359,7 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 		G_Addr->g_addr = g_addr;
 		if (!Add_Global_Address_to_List(assoc, G_Addr))
 			SN_LOG(SN_LOG_EVENT,
-			    logsctperror("AddGlobalIPAddress: Address already in list", 
+			    logsctperror("AddGlobalIPAddress: Address already in list",
 				sm->sctp_hdr->v_tag,  assoc->num_Gaddr, direction));
 	}
 
@@ -1368,11 +1367,11 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 	while((bytes_left >= param_size) && (bytes_left >= sizeof(struct sctp_ipv4addr_param))) {
 		if (assoc->num_Gaddr >= sysctl_track_global_addresses) {
 			SN_LOG(SN_LOG_EVENT,
-			    logsctperror("AddGlobalIPAddress: Maximum Number of addresses reached", 
+			    logsctperror("AddGlobalIPAddress: Maximum Number of addresses reached",
 				sm->sctp_hdr->v_tag,  sysctl_track_global_addresses, direction));
 			return;
 		}
-		switch(ntohs(param->param_type)) {
+		switch (ntohs(param->param_type)) {
 		case SCTP_ADD_IP_ADDRESS:
 			/* skip to address parameter - leave param_size so bytes left will be calculated properly*/
 			param = (struct sctp_paramhdr *) &((struct sctp_asconf_addrv4_param *) param)->addrp;
@@ -1381,9 +1380,9 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 			ipv4_param = (struct sctp_ipv4addr_param *) param;
 			/* add addresses to association */
 			G_Addr = (struct sctp_GlobalAddress *) sn_malloc(sizeof(struct sctp_GlobalAddress));
-			if (G_Addr == NULL) {/* out of resources */ 
+			if (G_Addr == NULL) {/* out of resources */
 				SN_LOG(SN_LOG_EVENT,
-				    logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking", 
+				    logsctperror("AddGlobalIPAddress: No resources for adding global address - revert to no tracking",
 					sm->sctp_hdr->v_tag,  0, direction));
 				assoc->num_Gaddr = 0; /* don't track any more for this assoc*/
 				sysctl_track_global_addresses=0;
@@ -1395,22 +1394,22 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 				G_Addr->g_addr = g_addr;
 				if (!Add_Global_Address_to_List(assoc, G_Addr))
 					SN_LOG(SN_LOG_EVENT,
-					    logsctperror("AddGlobalIPAddress: Address already in list", 
+					    logsctperror("AddGlobalIPAddress: Address already in list",
 						sm->sctp_hdr->v_tag,  assoc->num_Gaddr, direction));
 				return; /*shouldn't be any other addresses if the zero address is given*/
 			} else {
 				G_Addr->g_addr.s_addr = ipv4_param->addr;
 				if (!Add_Global_Address_to_List(assoc, G_Addr))
 					SN_LOG(SN_LOG_EVENT,
-					    logsctperror("AddGlobalIPAddress: Address already in list", 
+					    logsctperror("AddGlobalIPAddress: Address already in list",
 						sm->sctp_hdr->v_tag,  assoc->num_Gaddr, direction));
 			}
-		} 
-    
+		}
+
 		bytes_left -= param_size;
 		if (bytes_left < SN_MIN_PARAM_SIZE)
 			break;
-    
+
 		param = SN_SCTP_NEXTPARAM(param);
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
 		if (++param_count > sysctl_param_proc_limit) {
@@ -1422,39 +1421,39 @@ AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct s
 	}
 	if (addr_param_count == 0) {
 		SN_LOG(SN_LOG_DETAIL,
-		    logsctperror("AddGlobalIPAddress: no address parameters to add", 
+		    logsctperror("AddGlobalIPAddress: no address parameters to add",
 			sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
 	}
 }
 
-/** 
+/**
  * @brief Add_Global_Address_to_List
  *
  * Adds a global IP address to an associations address list, if it is not
  * already there.  The first address added us usually the packet's address, and
  * is most likely to be used, so it is added at the beginning. Subsequent
  * addresses are added after this one.
- * 
+ *
  * @param assoc Pointer to the association this SCTP Message belongs to
  * @param G_addr Pointer to the global address to add
  *
- * @return 1 - success | 0 - fail 
+ * @return 1 - success | 0 - fail
  */
 static int  Add_Global_Address_to_List(struct sctp_nat_assoc *assoc,  struct sctp_GlobalAddress *G_addr)
 {
-	struct sctp_GlobalAddress *iter_G_Addr = NULL, *first_G_Addr = NULL;     
-	first_G_Addr = LIST_FIRST(&(assoc->Gaddr));  
+	struct sctp_GlobalAddress *iter_G_Addr = NULL, *first_G_Addr = NULL;
+	first_G_Addr = LIST_FIRST(&(assoc->Gaddr));
 	if (first_G_Addr == NULL) {
 		LIST_INSERT_HEAD(&(assoc->Gaddr), G_addr, list_Gaddr); /* add new address to beginning of list*/
 	} else {
 		LIST_FOREACH(iter_G_Addr, &(assoc->Gaddr), list_Gaddr) {
 			if (G_addr->g_addr.s_addr == iter_G_Addr->g_addr.s_addr)
-				return(0); /* already exists, so don't add */
+				return (0); /* already exists, so don't add */
 		}
 		LIST_INSERT_AFTER(first_G_Addr, G_addr, list_Gaddr); /* add address to end of list*/
 	}
-	assoc->num_Gaddr++;	  
-	return(1); /* success */   
+	assoc->num_Gaddr++;
+	return (1); /* success */
 }
 
 /** @ingroup packet_parser
@@ -1467,8 +1466,8 @@ static int  Add_Global_Address_to_List(struct sctp_nat
  *
  * @param sm Pointer to sctp message information
  * @param assoc Pointer to the association this SCTP Message belongs to
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
- * 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
+ *
  */
 static void
 RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction)
@@ -1481,7 +1480,7 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc
 	int param_size;
 	int param_count;
 
-	if(direction == SN_TO_GLOBAL)
+	if (direction == SN_TO_GLOBAL)
 		g_addr = sm->ip_hdr->ip_dst;
 	else
 		g_addr = sm->ip_hdr->ip_src;
@@ -1489,29 +1488,29 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc
 	bytes_left = sm->chunk_length;
 	param_count = 1;
 	param = sm->sctpchnk.Asconf;
-	if (bytes_left >= SN_MIN_PARAM_SIZE) {		
+	if (bytes_left >= SN_MIN_PARAM_SIZE) {
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
 	} else {
 		SN_LOG(SN_LOG_EVENT,
-		    logsctperror("RmGlobalIPAddress: truncated packet - cannot remove IP addresses", 
+		    logsctperror("RmGlobalIPAddress: truncated packet - cannot remove IP addresses",
 			sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
 		return;
 	}
- 
+
 	/* step through Asconf parameters */
 	while((bytes_left >= param_size) && (bytes_left >= sizeof(struct sctp_ipv4addr_param))) {
 		if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) {
 			asconf_ipv4_param = (struct sctp_asconf_addrv4_param *) param;
 			if (asconf_ipv4_param->addrp.addr == INADDR_ANY) { /* remove all bar pkt address */
 				LIST_FOREACH_SAFE(G_Addr, &(assoc->Gaddr), list_Gaddr, G_Addr_tmp) {
-					if(G_Addr->g_addr.s_addr != sm->ip_hdr->ip_src.s_addr) {
+					if (G_Addr->g_addr.s_addr != sm->ip_hdr->ip_src.s_addr) {
 						if (assoc->num_Gaddr > 1) { /* only delete if more than one */
 							LIST_REMOVE(G_Addr, list_Gaddr);
 							sn_free(G_Addr);
 							assoc->num_Gaddr--;
 						} else {
 							SN_LOG(SN_LOG_EVENT,
-							    logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", 
+							    logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)",
 								sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
 						}
 					}
@@ -1519,7 +1518,7 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc
 				return; /*shouldn't be any other addresses if the zero address is given*/
 			} else {
 				LIST_FOREACH_SAFE(G_Addr, &(assoc->Gaddr), list_Gaddr, G_Addr_tmp) {
-					if(G_Addr->g_addr.s_addr == asconf_ipv4_param->addrp.addr) {
+					if (G_Addr->g_addr.s_addr == asconf_ipv4_param->addrp.addr) {
 						if (assoc->num_Gaddr > 1) { /* only delete if more than one */
 							LIST_REMOVE(G_Addr, list_Gaddr);
 							sn_free(G_Addr);
@@ -1527,22 +1526,22 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc
 							break; /* Since add only adds new addresses, there should be no double entries */
 						} else {
 							SN_LOG(SN_LOG_EVENT,
-							    logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)", 
+							    logsctperror("RmGlobalIPAddress: Request to remove last IP address (didn't)",
 								sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
 						}
 					}
 				}
 			}
-		}      
+		}
 		bytes_left -= param_size;
 		if (bytes_left == 0) return;
 		else if (bytes_left < SN_MIN_PARAM_SIZE) {
 			SN_LOG(SN_LOG_EVENT,
-			    logsctperror("RmGlobalIPAddress: truncated packet - may not have removed all IP addresses", 
+			    logsctperror("RmGlobalIPAddress: truncated packet - may not have removed all IP addresses",
 				sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
 			return;
 		}
-    
+
 		param = SN_SCTP_NEXTPARAM(param);
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
 		if (++param_count > sysctl_param_proc_limit) {
@@ -1569,11 +1568,11 @@ RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sc
  * Since there is currently no connection on this path, there should be no other
  * ASCONF configuration parameters outstanding, so we presume that if there is
  * an ACK that it is responding to the AddIP and activate the new association.
- * 
+ *
  * @param la Pointer to the relevant libalias instance
  * @param sm Pointer to sctp message information
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
- * 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
+ *
  * @return 1 - success | 0 - fail
  */
 static int
@@ -1588,45 +1587,45 @@ IsASCONFack(struct libalias *la, struct sctp_nat_msg *
 	param = sm->sctpchnk.Asconf;
 	param_size = SCTP_SIZE32(ntohs(param->param_length));
 	if (param_size == 8)
-		return(1); /*success - default acknowledgement of everything */
+		return (1); /*success - default acknowledgement of everything */
 
 	bytes_left = sm->chunk_length;
 	if (bytes_left < param_size)
-		return(0); /* not found */
+		return (0); /* not found */
 	/* step through Asconf parameters */
 	while(bytes_left >= SN_ASCONFACK_PARAM_SIZE) {
 		if (ntohs(param->param_type) == SCTP_SUCCESS_REPORT)
-			return(1); /* success - but can't match correlation IDs - should only be one */
+			return (1); /* success - but can't match correlation IDs - should only be one */
 		/* check others just in case */
 		bytes_left -= param_size;
 		if (bytes_left >= SN_MIN_PARAM_SIZE) {
 			param = SN_SCTP_NEXTPARAM(param);
 		} else {
-			return(0);
+			return (0);
 		}
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
-		if (bytes_left < param_size) return(0);
+		if (bytes_left < param_size) return (0);
 
 		if (++param_count > sysctl_param_proc_limit) {
 			SN_LOG(SN_LOG_EVENT,
-			    logsctperror("Parameter parse limit exceeded (IsASCONFack)", 
+			    logsctperror("Parameter parse limit exceeded (IsASCONFack)",
 				sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
-			return(0); /* not found limit exceeded*/
+			return (0); /* not found limit exceeded*/
 		}
 	}
-	return(0); /* not success */
+	return (0); /* not success */
 }
 
 /**  @ingroup packet_parser
- * @brief Check to see if ASCONF contains an Add IP or Del IP parameter 
- * 
+ * @brief Check to see if ASCONF contains an Add IP or Del IP parameter
+ *
  * IsADDorDEL scans an ASCONF packet to see if it contains an AddIP or DelIP
  * parameter
  *
  * @param la Pointer to the relevant libalias instance
  * @param sm Pointer to sctp message information
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
- * 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
+ *
  * @return SCTP_ADD_IP_ADDRESS | SCTP_DEL_IP_ADDRESS | 0 - fail
  */
 static int
@@ -1643,31 +1642,31 @@ IsADDorDEL(struct libalias *la, struct sctp_nat_msg *s
 
 	bytes_left = sm->chunk_length;
 	if (bytes_left < param_size)
-		return(0); /* not found */
+		return (0); /* not found */
 	/* step through Asconf parameters */
 	while(bytes_left >= SN_ASCONFACK_PARAM_SIZE) {
 		if (ntohs(param->param_type) == SCTP_ADD_IP_ADDRESS)
-			return(SCTP_ADD_IP_ADDRESS);
-		else if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS) 
-			return(SCTP_DEL_IP_ADDRESS);
+			return (SCTP_ADD_IP_ADDRESS);
+		else if (ntohs(param->param_type) == SCTP_DEL_IP_ADDRESS)
+			return (SCTP_DEL_IP_ADDRESS);
 		/* check others just in case */
 		bytes_left -= param_size;
 		if (bytes_left >= SN_MIN_PARAM_SIZE) {
 			param = SN_SCTP_NEXTPARAM(param);
 		} else {
-			return(0); /*Neither found */
+			return (0); /*Neither found */
 		}
 		param_size = SCTP_SIZE32(ntohs(param->param_length));
-		if (bytes_left < param_size) return(0);
+		if (bytes_left < param_size) return (0);
 
 		if (++param_count > sysctl_param_proc_limit) {
 			SN_LOG(SN_LOG_EVENT,
-			    logsctperror("Parameter parse limit exceeded IsADDorDEL)", 
+			    logsctperror("Parameter parse limit exceeded IsADDorDEL)",
 				sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
-			return(0); /* not found limit exceeded*/
+			return (0); /* not found limit exceeded*/
 		}
 	}
-	return(0);  /*Neither found */
+	return (0);  /*Neither found */
 }
 
 /* ----------------------------------------------------------------------
@@ -1690,7 +1689,7 @@ IsADDorDEL(struct libalias *la, struct sctp_nat_msg *s
  * each state.
  *
  * @param la Pointer to the relevant libalias instance
- * @param direction SN_TO_LOCAL | SN_TO_GLOBAL 
+ * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
  * @param sm Pointer to sctp message information
  * @param assoc Pointer to the association this SCTP Message belongs to
  *
@@ -1707,17 +1706,17 @@ ProcessSctpMsg(struct libalias *la, int direction, str

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-head mailing list