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

Function ProcessSctpMsg

freebsd/netinet/libalias/alias_sctp.c:1714–1736  ·  view source on GitHub ↗

---------------------------------------------------------------------- * STATE MACHINE CODE * ---------------------------------------------------------------------- */ @addtogroup state_machine * * The SCTP NAT State Machine functions will: * - Process an already parsed packet * - Use the existing NAT Hash Tables * - Determine the next state for the association

Source from the content-addressed store, hash-verified

1712 * @return SN_DROP_PKT | SN_NAT_PKT | SN_REPLY_ABORT | SN_REPLY_ERROR | SN_PROCESSING_ERROR
1713 */
1714static int
1715ProcessSctpMsg(struct libalias *la, int direction, struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc)
1716{
1717 int rtnval;
1718
1719 switch (assoc->state) {
1720 case SN_ID: /* Idle */
1721 rtnval = ID_process(la, direction, assoc, sm);
1722 if (rtnval != SN_NAT_PKT) {
1723 assoc->state = SN_RM;/* Mark for removal*/
1724 }
1725 return (rtnval);
1726 case SN_INi: /* Initialising - Init */
1727 return (INi_process(la, direction, assoc, sm));
1728 case SN_INa: /* Initialising - AddIP */
1729 return (INa_process(la, direction, assoc, sm));
1730 case SN_UP: /* Association UP */
1731 return (UP_process(la, direction, assoc, sm));
1732 case SN_CL: /* Association Closing */
1733 return (CL_process(la, direction, assoc, sm));
1734 }
1735 return (SN_PROCESSING_ERROR);
1736}
1737
1738/** @ingroup state_machine
1739 * @brief Process SCTP message while in the Idle state

Callers 1

SctpAliasFunction · 0.85

Calls 5

ID_processFunction · 0.85
INi_processFunction · 0.85
INa_processFunction · 0.85
UP_processFunction · 0.85
CL_processFunction · 0.85

Tested by

no test coverage detected