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);
691 * - Validating the direction parameter passed by the caller
705 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
710 SctpAlias(struct libalias *la, struct ip *pip, int direction)
716 if ((direction != SN_TO_LOCAL) && (direction != SN_TO_GLOBAL)) {
717 SctpAliasLog("ERROR: Invalid direction\n");
724 rtnval = sctp_PktParser(la, direction, pip, &msg, &assoc); //using *char (change to mbuf when get code from paolo)
735 logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
740 logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
745 (sysctl_error_on_ootb == SN_LOCALandPARTIAL_ERROR_ON_OOTB && direction == SN_TO_LOCAL) ||
746 (sysctl_error_on_ootb == SN_LOCAL_ERROR_ON_OOTB && direction == SN_TO_GLOBAL)) {
747 TxAbortErrorM(la, &msg, assoc, SN_REFLECT_ERROR, direction); /*NB assoc=NULL */
752 logsctperror("SN_PARSE_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
758 logsctpparse(direction, &msg);
762 rtnval = ProcessSctpMsg(la, direction, &msg, assoc);
773 switch(direction) {
786 SN_LOG(SN_LOG_LOW, logsctperror("ERROR: Invalid direction", msg.sctp_hdr->v_tag, rtnval, direction));
791 SN_LOG(SN_LOG_DETAIL, logsctperror("SN_DROP_PKT", msg.sctp_hdr->v_tag, rtnval, direction));
796 TxAbortErrorM(la, &msg, assoc, rtnval, direction);
800 SN_LOG(SN_LOG_LOW, logsctperror("SN_PROCESSING_ERROR", msg.sctp_hdr->v_tag, rtnval, direction));
851 * - Initial packet direction (SN_TO_LOCAL | SN_TO_GLOBAL)
861 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
901 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;
1009 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1017 sctp_PktParser(struct libalias *la, int direction, struct ip *pip,
1019 //sctp_PktParser(int direction, struct mbuf *ipak, int ip_hdr_len,struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc)
1073 if (direction == SN_TO_LOCAL)
1079 if (direction == SN_TO_LOCAL)
1145 if ((*passoc == NULL) && (direction == SN_TO_LOCAL)) { /* AddIP with no association */
1236 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1241 GetAsconfVtags(struct libalias *la, struct sctp_nat_msg *sm, uint32_t *l_vtag, uint32_t *g_vtag, int direction)
1265 switch(direction) {
1289 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1304 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1308 AddGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction)
1318 switch(direction) {
1351 sm->sctp_hdr->v_tag, 0, direction));
1360 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1368 sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
1382 sm->sctp_hdr->v_tag, 0, direction));
1394 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1401 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1414 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1421 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1465 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1469 RmGlobalIPAddresses(struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc, int direction)
1479 if(direction == SN_TO_GLOBAL)
1492 sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
1510 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1526 sm->sctp_hdr->v_tag, assoc->num_Gaddr, direction));
1537 sm->sctp_hdr->v_tag, sysctl_track_global_addresses, direction));
1546 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1570 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1575 IsASCONFack(struct libalias *la, struct sctp_nat_msg *sm, int direction)
1608 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1623 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1628 IsADDorDEL(struct libalias *la, struct sctp_nat_msg *sm, int direction)
1661 sm->sctp_hdr->v_tag, sysctl_param_proc_limit, direction));
1688 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1695 ProcessSctpMsg(struct libalias *la, int direction, struct sctp_nat_msg *sm, struct sctp_nat_assoc *assoc)
1701 rtnval = ID_process(la, direction, assoc, sm);
1707 return(INi_process(la, direction, assoc, sm));
1709 return(INa_process(la, direction, assoc, sm));
1711 return(UP_process(la, direction, assoc, sm));
1713 return(CL_process(la, direction, assoc, sm));
1726 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1733 ID_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1737 if (!sysctl_accept_global_ootb_addip && (direction == SN_TO_LOCAL))
1740 if (!GetAsconfVtags(la, sm, &(assoc->l_vtag), &(assoc->g_vtag), direction))
1744 AddGlobalIPAddresses(sm, assoc, direction);
1745 switch(direction){
1794 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1801 INi_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1808 switch(direction){
1811 AddGlobalIPAddresses(sm, assoc, direction);
1846 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1853 INa_process(struct libalias *la, int direction,struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1860 switch(direction){
1862 if (!(assoc->TableRegister & SN_WAIT_TOLOCAL)) /* wrong direction */
1866 if (!(assoc->TableRegister & SN_WAIT_TOGLOBAL)) /* wrong direction */
1869 if (IsASCONFack(la,sm,direction)) {
1894 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1901 UP_process(struct libalias *la, int direction, struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
1912 if ((direction == SN_TO_LOCAL) && assoc->num_Gaddr) /*If tracking global addresses for this association & from global side */
1913 switch(IsADDorDEL(la,sm,direction)) {
1915 AddGlobalIPAddresses(sm, assoc, direction);
1918 RmGlobalIPAddresses(sm, assoc, direction);
1937 * @param direction SN_TO_LOCAL | SN_TO_GLOBAL
1944 CL_process(struct libalias *la, int direction,struct sctp_nat_assoc *assoc, struct sctp_nat_msg *sm)
2495 * @param direction Direction of packet
2498 logsctperror(char* errormsg, uint32_t vtag, int error, int direction)
2501 switch(direction) {
2518 * @param direction Direction of packet
2522 logsctpparse(int direction, struct sctp_nat_msg *sm)
2525 switch(direction) {