@ingroup state_machine * @brief Process SCTP message while association is in the process of closing * * This function waits for a SHUT-COMP to close the association. Depending on * the setting of sysctl_holddown_timer it may not remove the association * immediately, but leave it up until SN_X_T(la). Only SHUT-COMP, SHUT-ACK, and * ABORT packets are permitted in this state. All other packets
| 1962 | * @return SN_NAT_PKT | SN_DROP_PKT |
| 1963 | */ |
| 1964 | static int |
| 1965 | CL_process(struct libalias *la, int direction,struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm) |
| 1966 | { |
| 1967 | switch (sm->msg) { |
| 1968 | case SN_SCTP_SHUTCOMP: /* a packet containing a SHUTDOWN-COMPLETE chunk */ |
| 1969 | assoc->state = SN_CL; /* Stay in Close state until timeout */ |
| 1970 | if (sysctl_holddown_timer > 0) |
| 1971 | sctp_ResetTimeOut(la, assoc, SN_X_T(la));/* allow to stay open for Tbit packets*/ |
| 1972 | else |
| 1973 | assoc->state = SN_RM;/* Mark for removal*/ |
| 1974 | return (SN_NAT_PKT); |
| 1975 | case SN_SCTP_SHUTACK: /* a packet containing a SHUTDOWN-ACK chunk */ |
| 1976 | assoc->state = SN_CL; /* Stay in Close state until timeout */ |
| 1977 | sctp_ResetTimeOut(la, assoc, SN_C_T(la)); |
| 1978 | return (SN_NAT_PKT); |
| 1979 | case SN_SCTP_ABORT: /* a packet containing an ABORT chunk */ |
| 1980 | assoc->state = SN_RM;/* Mark for removal*/ |
| 1981 | return (SN_NAT_PKT); |
| 1982 | default: |
| 1983 | return (SN_DROP_PKT); |
| 1984 | } |
| 1985 | return (SN_DROP_PKT);/* shouldn't get here very bad: log, drop and hope for the best */ |
| 1986 | } |
| 1987 | |
| 1988 | /* ---------------------------------------------------------------------- |
| 1989 | * HASH TABLE CODE |
no test coverage detected