MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sctp_auth_add_chunk

Function sctp_auth_add_chunk

freebsd/netinet/sctp_auth.c:104–125  ·  view source on GitHub ↗

* add a chunk to the required chunks list */

Source from the content-addressed store, hash-verified

102 * add a chunk to the required chunks list
103 */
104int
105sctp_auth_add_chunk(uint8_t chunk, sctp_auth_chklist_t *list)
106{
107 if (list == NULL)
108 return (-1);
109
110 /* is chunk restricted? */
111 if ((chunk == SCTP_INITIATION) ||
112 (chunk == SCTP_INITIATION_ACK) ||
113 (chunk == SCTP_SHUTDOWN_COMPLETE) ||
114 (chunk == SCTP_AUTHENTICATION)) {
115 return (-1);
116 }
117 if (list->chunks[chunk] == 0) {
118 list->chunks[chunk] = 1;
119 list->num_chunks++;
120 SCTPDBG(SCTP_DEBUG_AUTH1,
121 "SCTP: added chunk %u (0x%02x) to Auth list\n",
122 chunk, chunk);
123 }
124 return (0);
125}
126
127/*
128 * delete a chunk from the required chunks list

Callers 5

sctp_setoptFunction · 0.85
sctp_inpcb_allocFunction · 0.85
sctp_unpack_auth_chunksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected