@ingroup Hash * @brief Remove the sctp association information from the look up table * * For each of the two (local/global) look-up tables, remove the association * from that table IF it has been registered in that table. * * NOTE: The calling code is responsible for freeing memory allocated to the * association structure itself * * NOTE: The association is NOT removed from the tim
| 2323 | * @param assoc pointer to sctp association |
| 2324 | */ |
| 2325 | static void |
| 2326 | RmSctpAssoc(struct libalias *la, struct sctp_nat_assoc *assoc) |
| 2327 | { |
| 2328 | // struct sctp_nat_assoc *found; |
| 2329 | if (assoc == NULL) { |
| 2330 | /* very bad, log and die*/ |
| 2331 | SN_LOG(SN_LOG_LOW, |
| 2332 | logsctperror("ERROR: alias_sctp:RmSctpAssoc(NULL)\n", 0, 0, SN_TO_NODIR)); |
| 2333 | return; |
| 2334 | } |
| 2335 | /* log if association is fully up and now closing */ |
| 2336 | if (assoc->TableRegister == SN_BOTH_TBL) { |
| 2337 | SN_LOG(SN_LOG_INFO, logsctpassoc(assoc, "$")); |
| 2338 | } |
| 2339 | LIBALIAS_LOCK_ASSERT(la); |
| 2340 | if (assoc->TableRegister & SN_LOCAL_TBL) { |
| 2341 | assoc->TableRegister ^= SN_LOCAL_TBL; |
| 2342 | la->sctpLinkCount--; //decrement link count |
| 2343 | LIST_REMOVE(assoc, list_L); |
| 2344 | } |
| 2345 | |
| 2346 | if (assoc->TableRegister & SN_GLOBAL_TBL) { |
| 2347 | assoc->TableRegister ^= SN_GLOBAL_TBL; |
| 2348 | la->sctpLinkCount--; //decrement link count |
| 2349 | LIST_REMOVE(assoc, list_G); |
| 2350 | } |
| 2351 | // sn_free(assoc); //Don't remove now, remove if needed later |
| 2352 | /* libalias logging -- controlled by libalias log definition */ |
| 2353 | if (la->packetAliasMode & PKT_ALIAS_LOG) |
| 2354 | SctpShowAliasStats(la); |
| 2355 | } |
| 2356 | |
| 2357 | /** |
| 2358 | * @ingroup Hash |
no test coverage detected