* add a chunk to the required chunks list */
| 102 | * add a chunk to the required chunks list |
| 103 | */ |
| 104 | int |
| 105 | sctp_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 |
no outgoing calls
no test coverage detected