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

Function AliasSctpTerm

freebsd/netinet/libalias/alias_sctp.c:680–701  ·  view source on GitHub ↗

* @brief Cleans-up the SCTP NAT Implementation prior to unloading * * Removes all entries from the timer queue, freeing associations as it goes. * We then free memory allocated to the look-up tables and the time queue * * NOTE: We do not need to traverse the look-up tables as each association * will always have an entry in the timer queue, freeing this memory * once will free al

Source from the content-addressed store, hash-verified

678 * @param la Pointer to the relevant libalias instance
679 */
680void AliasSctpTerm(struct libalias *la)
681{
682 struct sctp_nat_assoc *assoc1, *assoc2;
683 int i;
684
685 LIBALIAS_LOCK_ASSERT(la);
686 SN_LOG(SN_LOG_EVENT,
687 SctpAliasLog("Removing SCTP NAT Instance\n"));
688 for (i = 0; i < SN_TIMER_QUEUE_SIZE; i++) {
689 assoc1 = LIST_FIRST(&la->sctpNatTimer.TimerQ[i]);
690 while (assoc1 != NULL) {
691 freeGlobalAddressList(assoc1);
692 assoc2 = LIST_NEXT(assoc1, timer_Q);
693 sn_free(assoc1);
694 assoc1 = assoc2;
695 }
696 }
697
698 sn_free(la->sctpTableLocal);
699 sn_free(la->sctpTableGlobal);
700 sn_free(la->sctpNatTimer.TimerQ);
701}
702
703/**
704 * @brief Handles SCTP packets passed from libalias

Callers 2

LibAliasInitFunction · 0.85
LibAliasUninitFunction · 0.85

Calls 2

SctpAliasLogFunction · 0.85
freeGlobalAddressListFunction · 0.85

Tested by

no test coverage detected