FreeBSD/sys/netinet/sctp_auth.c
/*
 * add a chunk to the required chunks list
 */
add a chunk to the required chunks list
add a chunk to the required chunks list
int
sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t * list)
{
	if (list == NULL)
		return (-1);
	if ((chunk == SCTP_INITIATION) ||
	    (chunk == SCTP_INITIATION_ACK) ||
	    (chunk == SCTP_SHUTDOWN_COMPLETE) ||
	    (chunk == SCTP_AUTHENTICATION)) {
		return (-1);
	}
	if (list->chunks[chunk] == 0) {
		list->chunks[chunk] = 1;
		list->num_chunks++;
		SCTPDBG(SCTP_DEBUG_AUTH1,
		    "SCTP: added chunk %u (0x%02x) to Auth list\n",
		    chunk, chunk);
	}
	return (0);
}
int sctp_auth_add_chunk ( uint8_t chunk , sctp_auth_chklist_t * list ) { if ( list == NULL ) return ( -1 ) ; if ( ( chunk == SCTP_INITIATION ) || ( chunk == SCTP_INITIATION_ACK ) || ( chunk == SCTP_SHUTDOWN_COMPLETE ) || ( chunk == SCTP_AUTHENTICATION ) ) { return ( -1 ) ; } if ( list -> chunks [ chunk ] == 0 ) { list -> chunks [ chunk ] = 1 ; list -> num_chunks ++ ; SCTPDBG ( SCTP_DEBUG_AUTH1 , " \n " , chunk , chunk ) ; } return ( 0 ) ; }
add a chunk to the required chunks list
add a chunk to the required chunks list
/* is chunk restricted? */