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

Function RmSctpAssoc

freebsd/netinet/libalias/alias_sctp.c:2325–2355  ·  view source on GitHub ↗

@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

Source from the content-addressed store, hash-verified

2323 * @param assoc pointer to sctp association
2324 */
2325static void
2326RmSctpAssoc(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

Callers 4

SctpAliasFunction · 0.85
AddSctpAssocLocalFunction · 0.85
AddSctpAssocGlobalFunction · 0.85
sctp_CheckTimersFunction · 0.85

Calls 3

logsctperrorFunction · 0.85
logsctpassocFunction · 0.85
SctpShowAliasStatsFunction · 0.85

Tested by

no test coverage detected