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

Function UP_process

freebsd/netinet/libalias/alias_sctp.c:1921–1947  ·  view source on GitHub ↗

@ingroup state_machine * @brief Process SCTP messages while association is UP redirecting packets * * While in the SN_UP state, all packets for the particular association * are passed. Only a SHUT-ACK or an ABORT will cause a change of state. * * @param la Pointer to the relevant libalias instance * @param direction SN_TO_LOCAL | SN_TO_GLOBAL * @param sm Pointer to sctp message information

Source from the content-addressed store, hash-verified

1919 * @return SN_NAT_PKT | SN_DROP_PKT
1920 */
1921static int
1922UP_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1923{
1924 switch (sm->msg) {
1925 case SN_SCTP_SHUTACK: /* a packet containing a SHUTDOWN-ACK chunk */
1926 assoc->state = SN_CL;
1927 sctp_ResetTimeOut(la,assoc, SN_C_T(la));
1928 return (SN_NAT_PKT);
1929 case SN_SCTP_ABORT: /* a packet containing an ABORT chunk */
1930 assoc->state = SN_RM;/* Mark for removal*/
1931 return (SN_NAT_PKT);
1932 case SN_SCTP_ASCONF: /* a packet containing an ASCONF chunk*/
1933 if ((direction == SN_TO_LOCAL) && assoc->num_Gaddr) /*If tracking global addresses for this association & from global side */
1934 switch (IsADDorDEL(la,sm,direction)) {
1935 case SCTP_ADD_IP_ADDRESS:
1936 AddGlobalIPAddresses(sm, assoc, direction);
1937 break;
1938 case SCTP_DEL_IP_ADDRESS:
1939 RmGlobalIPAddresses(sm, assoc, direction);
1940 break;
1941 } /* fall through to default */
1942 default:
1943 sctp_ResetTimeOut(la,assoc, SN_U_T(la));
1944 return (SN_NAT_PKT); /* forward packet */
1945 }
1946 return (SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */
1947}
1948
1949/** @ingroup state_machine
1950 * @brief Process SCTP message while association is in the process of closing

Callers 1

ProcessSctpMsgFunction · 0.85

Calls 4

sctp_ResetTimeOutFunction · 0.85
IsADDorDELFunction · 0.85
AddGlobalIPAddressesFunction · 0.85
RmGlobalIPAddressesFunction · 0.85

Tested by

no test coverage detected