Lines Matching refs:direction

99 static int sctp_PktParser(struct libalias *la, int direction, struct ip *pip,
102 uint32_t *l_vtag, uint32_t *g_vtag, int direction);
103 static int IsASCONFack(struct libalias *la, struct sctp_nat_msg *sm, int direction);
105 static void AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction);
107 static void RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction);
108 static int IsADDorDEL(struct libalias *la, struct sctp_nat_msg *sm, int direction);
111 static int ProcessSctpMsg(struct libalias *la, int direction, \
114 static int ID_process(struct libalias *la, int direction,\
116 static int INi_process(struct libalias *la, int direction,\
118 static int INa_process(struct libalias *la, int direction,\
120 static int UP_process(struct libalias *la, int direction,\
122 static int CL_process(struct libalias *la, int direction,\
125 struct sctp_nat_assoc *assoc, int sndrply, int direction);
152 static void logsctperror(char* errormsg, uint32_t vtag, int error, int direction);
153 static void logsctpparse(int direction, struct sctp_nat_msg *sm);
690 * - Validating the direction parameter passed by the caller
704 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
709 SctpAlias(struct libalias *la, struct ip *pip, int direction)
715 if ((direction != SN_TO_LOCAL) && (direction != SN_TO_GLOBAL)) {
716 SctpAliasLog("ERROR: Invalid direction\n");
723 rtnval = sctp_PktParser(la, direction, pip, &msg, &assoc); //using *char (change to mbuf when get code from paolo)
734 logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
739 logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
744 (sysctl_error_on_ootb == SN_LOCALandPARTIAL_ERROR_ON_OOTB && direction == SN_TO_LOCAL) ||
745 (sysctl_error_on_ootb == SN_LOCAL_ERROR_ON_OOTB && direction == SN_TO_GLOBAL)) {
746 TxAbortErrorM(la, &msg, assoc, SN_REFLECT_ERROR, direction); /*NB assoc=NULL */
751 logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
757 logsctpparse(direction, &msg);
761 rtnval = ProcessSctpMsg(la, direction, &msg, assoc);
772 switch (direction) {
785 SN_LOG(SN_LOG_LOW, logsctperror("ERROR: Invalid direction", msg.sctp_hdr->v_tag, rtnval, direction));
790 SN_LOG(SN_LOG_DETAIL, logsctperror("SN_DROP_PKT", msg.sctp_hdr->v_tag, rtnval, direction));
795 TxAbortErrorM(la, &msg, assoc, rtnval, direction);
799 SN_LOG(SN_LOG_LOW, logsctperror("SN_PROCESSING_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
850 * - Initial packet direction (SN_TO_LOCAL | SN_TO_GLOBAL)
860 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
900 TxAbortErrorM(struct libalias *la, struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int sndrply, int direction)
951 sctp_hdr->v_tag = (direction == SN_TO_LOCAL) ? assoc->g_vtag : assoc->l_vtag ;
963 ip->ip_src = (direction == SN_TO_LOCAL) ? sm->ip_hdr->ip_src : assoc->a_addr;
964 ip->ip_dst = (direction == SN_TO_LOCAL) ? assoc->l_addr : sm->ip_hdr->ip_dst;
1010 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1018 sctp_PktParser(struct libalias *la, int direction, struct ip *pip,
1020 //sctp_PktParser(int direction, struct mbuf *ipak, int ip_hdr_len,struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc)
1074 if (direction == SN_TO_LOCAL)
1080 if (direction == SN_TO_LOCAL)
1146 if ((*passoc == NULL) && (direction == SN_TO_LOCAL)) { /* AddIP with no association */
1237 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1242 GetAsconfVtags(struct libalias *la, struct sctp_nat_msg *sm, uint32_t *l_vtag, uint32_t *g_vtag, int direction)
1266 switch (direction) {
1290 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1305 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1309 AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction)
1319 switch (direction) {
1352 sm->sctp_hdr->v_tag, 0, direction));
1361 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1369 sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
1384 sm->sctp_hdr->v_tag, 0, direction));
1396 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1403 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1416 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1423 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1467 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1471 RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction)
1481 if (direction == SN_TO_GLOBAL)
1494 sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
1512 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1528 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1539 sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
1548 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1572 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1577 IsASCONFack(struct libalias *la, struct sctp_nat_msg *sm, int direction)
1610 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1625 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1630 IsADDorDEL(struct libalias *la, struct sctp_nat_msg *sm, int direction)
1663 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1690 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1697 ProcessSctpMsg(struct libalias *la, int direction, struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc)
1703 rtnval = ID_process(la, direction, assoc, sm);
1709 return (INi_process(la, direction, assoc, sm));
1711 return (INa_process(la, direction, assoc, sm));
1713 return (UP_process(la, direction, assoc, sm));
1715 return (CL_process(la, direction, assoc, sm));
1728 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1735 ID_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1739 if (!sysctl_accept_global_ootb_addip && (direction == SN_TO_LOCAL))
1742 if (!GetAsconfVtags(la, sm, &(assoc->l_vtag), &(assoc->g_vtag), direction))
1747 AddGlobalIPAddresses(sm, assoc, direction);
1748 switch (direction) {
1797 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1804 INi_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1811 switch (direction) {
1814 AddGlobalIPAddresses(sm, assoc, direction);
1849 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1856 INa_process(struct libalias *la, int direction,struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1863 switch (direction) {
1865 if (!(assoc->TableRegister & SN_WAIT_TOLOCAL)) /* wrong direction */
1869 if (!(assoc->TableRegister & SN_WAIT_TOGLOBAL)) /* wrong direction */
1872 if (IsASCONFack(la,sm,direction)) {
1897 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1904 UP_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1915 if ((direction == SN_TO_LOCAL) && assoc->num_Gaddr) /*If tracking global addresses for this association & from global side */
1916 switch (IsADDorDEL(la,sm,direction)) {
1918 AddGlobalIPAddresses(sm, assoc, direction);
1921 RmGlobalIPAddresses(sm, assoc, direction);
1940 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1947 CL_process(struct libalias *la, int direction,struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
2498 * @param direction Direction of packet
2501 logsctperror(char* errormsg, uint32_t vtag, int error, int direction)
2504 switch (direction) {
2521 * @param direction Direction of packet
2525 logsctpparse(int direction, struct sctp_nat_msg *sm)
2528 switch (direction) {