summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2017-06-15 23:23:29 -0700
committerDeepak S <deepak.s@linux.intel.com>2017-06-15 23:34:46 -0700
commit720998394c5d613529ce616b333c0de5da1b8de4 (patch)
treec03f694bfb3c39fcdaa9c03e2ce7a19f807820c7
parent44e700fcfe8655565076b9c3036c61b2e53a8bcd (diff)
Adding Sample vCGNAPT config to run with multi-port pairv1.0.0
JIRA: SAMPLEVNF-40 This patch adds sample vCGNAPT config for 1, 6, 10 port pair Change-Id: I003e98b26e794d111af562232e8688f255a7d61a Signed-off-by: Deepak S <deepak.s@linux.intel.com>
-rw-r--r--VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.cfg281
-rw-r--r--VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.txt57
-rw-r--r--VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.cfg454
-rw-r--r--VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.txt95
-rw-r--r--VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.cfg68
-rw-r--r--VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.txt15
-rw-r--r--common/cscope.out250740
7 files changed, 970 insertions, 250740 deletions
diff --git a/VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.cfg b/VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.cfg
new file mode 100644
index 0000000..9b7fab5
--- /dev/null
+++ b/VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.cfg
@@ -0,0 +1,281 @@
+[EAL]
+n = 4
+file_prefix = cgnat_1
+m = 8192
+
+[PIPELINE0]
+type = MASTER
+core = 0
+
+[PIPELINE1]
+type = ARPICMP
+core = 0
+pktq_in = SWQ0 SWQ1 SWQ2 SWQ3 SWQ4 SWQ5 SWQ6 SWQ7 SWQ8 SWQ9 SWQ10 SWQ11
+pktq_out = TXQ0.2 TXQ1.2 TXQ2.2 TXQ3.2 TXQ4.2 TXQ5.2 TXQ6.2 TXQ7.2 TXQ8.2 TXQ9.2 TXQ10.2 TXQ11.2
+arp_route_tbl = (c0106414,FFFF0000,0,c0106414)
+arp_route_tbl = (ac102814,FFFF0000,1,ac102814)
+arp_route_tbl = (c1106414,FFFF0000,2,c1106414)
+arp_route_tbl = (ad102814,FFFF0000,3,ad102814)
+arp_route_tbl = (c2106414,FFFF0000,4,c2106414)
+arp_route_tbl = (ae102814,FFFF0000,5,ae102814)
+arp_route_tbl = (c3106414,FFFF0000,6,c3106414)
+arp_route_tbl = (af102814,FFFF0000,7,af102814)
+arp_route_tbl = (c4106414,FFFF0000,8,c4106414)
+arp_route_tbl = (b0102814,FFFF0000,9,b0102814)
+arp_route_tbl = (c5106414,FFFF0000,a,c5106414)
+arp_route_tbl = (b1102814,FFFF0000,b,b1102814)
+pktq_in_prv = RXQ0.0 RXQ2.0 RXQ4.0 RXQ6.0 RXQ8.0 RXQ10.0
+prv_to_pub_map = (0, 1)(2, 3)(4, 5)(6, 7)(8, 9)(10, 11)
+ports_mac_list = CC:CC:CC:00:02:00 CC:CC:CC:00:02:01
+ports_mac_list = CC:CC:CC:00:03:00 CC:CC:CC:00:03:01
+ports_mac_list = CC:CC:CC:00:04:00 CC:CC:CC:00:04:01
+ports_mac_list = CC:CC:CC:00:05:00 CC:CC:CC:00:05:01
+ports_mac_list = CC:CC:CC:00:06:00 CC:CC:CC:00:06:01
+ports_mac_list = CC:CC:CC:00:07:00 CC:CC:CC:00:07:01
+
+[PIPELINE2]
+type = TIMER
+core = 0
+timer_dyn_timeout = 1000000
+n_flows = 2097152
+
+[PIPELINE3]
+type = CGNAPT
+core = 1
+pktq_in = RXQ0.0 RXQ1.0
+pktq_out = TXQ0.0 TXQ1.0 SWQ0
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+public_ip_port_range = 04040000:(1, 65535)
+public_ip_port_range = 04040001:(1, 65535)
+public_ip_port_range = 04040002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE4]
+type = CGNAPT
+core = 1h
+pktq_in = RXQ0.1 RXQ1.1
+pktq_out = TXQ0.1 TXQ1.1 SWQ1
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE5]
+type = CGNAPT
+core = 2
+pktq_in = RXQ2.0 RXQ3.0
+pktq_out = TXQ2.0 TXQ3.0 SWQ2
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+public_ip_port_range = 05050000:(1, 65535)
+public_ip_port_range = 05050001:(1, 65535)
+public_ip_port_range = 05050002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE6]
+type = CGNAPT
+core = 2h
+pktq_in = RXQ2.1 RXQ3.1
+pktq_out = TXQ2.1 TXQ3.1 SWQ3
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE7]
+type = CGNAPT
+core = 3
+pktq_in = RXQ4.0 RXQ5.0
+pktq_out = TXQ4.0 TXQ5.0 SWQ4
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+public_ip_port_range = 06060000:(1, 65535)
+public_ip_port_range = 06060001:(1, 65535)
+public_ip_port_range = 06060002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE8]
+type = CGNAPT
+core = 3h
+pktq_in = RXQ4.1 RXQ5.1
+pktq_out = TXQ4.1 TXQ5.1 SWQ5
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE9]
+type = CGNAPT
+core = 4
+pktq_in = RXQ6.0 RXQ7.0
+pktq_out = TXQ6.0 TXQ7.0 SWQ6
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+public_ip_port_range = 07070000:(1, 65535)
+public_ip_port_range = 07070001:(1, 65535)
+public_ip_port_range = 07070002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE10]
+type = CGNAPT
+core = 4h
+pktq_in = RXQ6.1 RXQ7.1
+pktq_out = TXQ6.1 TXQ7.1 SWQ7
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE11]
+type = CGNAPT
+core = 5
+pktq_in = RXQ8.0 RXQ9.0
+pktq_out = TXQ8.0 TXQ9.0 SWQ8
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+public_ip_port_range = 08080000:(1, 65535)
+public_ip_port_range = 08080001:(1, 65535)
+public_ip_port_range = 08080002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE12]
+type = CGNAPT
+core = 5h
+pktq_in = RXQ8.1 RXQ9.1
+pktq_out = TXQ8.1 TXQ9.1 SWQ9
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE13]
+type = CGNAPT
+core = 6
+pktq_in = RXQ10.0 RXQ11.0
+pktq_out = TXQ10.0 TXQ11.0 SWQ10
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+public_ip_port_range = 09090000:(1, 65535)
+public_ip_port_range = 09090001:(1, 65535)
+public_ip_port_range = 09090002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE14]
+type = CGNAPT
+core = 6h
+pktq_in = RXQ10.1 RXQ11.1
+pktq_out = TXQ10.1 TXQ11.1 SWQ11
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
diff --git a/VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.txt b/VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.txt
new file mode 100644
index 0000000..9b66437
--- /dev/null
+++ b/VNFs/vCGNAPT/config/cgnat_120G_hwlb_12port.txt
@@ -0,0 +1,57 @@
+
+p 1 arpadd 0 192.16.100.20 00:00:00:00:00:01
+p 1 arpadd 1 172.16.40.20 00:00:00:A1:3A:79
+p 1 arpadd 2 193.16.100.20 00:00:00:00:00:02
+p 1 arpadd 3 173.16.40.20 00:00:00:A1:3A:81
+p 1 arpadd 4 194.16.100.20 00:00:00:00:00:03
+p 1 arpadd 5 174.16.40.20 00:00:00:A1:3A:41
+p 1 arpadd 6 195.16.100.20 00:00:00:00:00:04
+p 1 arpadd 7 175.16.40.20 00:00:00:A1:3A:43
+p 1 arpadd 8 196.16.100.20 00:00:00:00:00:05
+p 1 arpadd 9 176.16.40.20 00:00:00:37:db:09
+p 1 arpadd 10 197.16.100.20 00:00:00:00:00:06
+p 1 arpadd 11 177.16.40.20 00:00:00:37:db:11
+
+set fwd rxonly
+set_sym_hash_ena_per_port 0 enable
+set_hash_global_config 0 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 1 enable
+set_hash_global_config 1 simple_xor ipv4-udp enable
+set_hash_input_set 0 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 1 ipv4-udp dst-ipv4 udp-dst-port add
+set_sym_hash_ena_per_port 2 enable
+set_hash_global_config 2 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 3 enable
+set_hash_global_config 3 simple_xor ipv4-udp enable
+set_hash_input_set 2 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 3 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 4 enable
+set_hash_global_config 4 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 5 enable
+set_hash_global_config 5 simple_xor ipv4-udp enable
+set_hash_input_set 4 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 5 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 6 enable
+set_hash_global_config 6 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 7 enable
+set_hash_global_config 7 simple_xor ipv4-udp enable
+set_hash_input_set 6 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 7 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 8 enable
+set_hash_global_config 8 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 9 enable
+set_hash_global_config 9 simple_xor ipv4-udp enable
+set_hash_input_set 8 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 9 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 10 enable
+set_hash_global_config 10 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 11 enable
+set_hash_global_config 11 simple_xor ipv4-udp enable
+set_hash_input_set 10 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 11 ipv4-udp dst-ipv4 udp-dst-port add
+
+p 1 arpls
diff --git a/VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.cfg b/VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.cfg
new file mode 100644
index 0000000..908543c
--- /dev/null
+++ b/VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.cfg
@@ -0,0 +1,454 @@
+[EAL]
+n = 4
+file_prefix = cgnat_1
+m = 8192
+
+[PIPELINE0]
+type = MASTER
+core = 0
+
+[PIPELINE1]
+type = ARPICMP
+core = 0
+pktq_in = SWQ0 SWQ1 SWQ2 SWQ3 SWQ4 SWQ5 SWQ6 SWQ7 SWQ8 SWQ9 SWQ10 SWQ11 SWQ12 SWQ13 SWQ14 SWQ15 SWQ16 SWQ17 SWQ18 SWQ19
+pktq_out = TXQ0.2 TXQ1.2 TXQ2.2 TXQ3.2 TXQ4.2 TXQ5.2 TXQ6.2 TXQ7.2 TXQ8.2 TXQ9.2 TXQ10.2 TXQ11.2 TXQ12.2 TXQ13.2 TXQ14.2 TXQ15.2 TXQ16.2 TXQ17.2 TXQ18.2 TXQ19.2
+arp_route_tbl = (c0106414,FFFF0000,0,c0106414)
+arp_route_tbl = (ac102814,FFFF0000,1,ac102814)
+arp_route_tbl = (c1106414,FFFF0000,2,c1106414)
+arp_route_tbl = (ad102814,FFFF0000,3,ad102814)
+arp_route_tbl = (c2106414,FFFF0000,4,c2106414)
+arp_route_tbl = (ae102814,FFFF0000,5,ae102814)
+arp_route_tbl = (c3106414,FFFF0000,6,c3106414)
+arp_route_tbl = (af102814,FFFF0000,7,af102814)
+arp_route_tbl = (c4106414,FFFF0000,8,c4106414)
+arp_route_tbl = (b0102814,FFFF0000,9,b0102814)
+arp_route_tbl = (c5106414,FFFF0000,a,c5106414)
+arp_route_tbl = (b1102814,FFFF0000,b,b1102814)
+arp_route_tbl = (c6106414,FFFF0000,c,c6106414)
+arp_route_tbl = (b2102814,FFFF0000,d,b2102814)
+arp_route_tbl = (c7106414,FFFF0000,e,c7106414)
+arp_route_tbl = (b3102814,FFFF0000,f,b3102814)
+arp_route_tbl = (c8106414,FFFF0000,10,c8106414)
+arp_route_tbl = (b4102814,FFFF0000,11,b4102814)
+arp_route_tbl = (c9106414,FFFF0000,12,c9106414)
+arp_route_tbl = (b5102814,FFFF0000,13,b5102814)
+pktq_in_prv = RXQ0.0 RXQ2.0 RXQ4.0 RXQ6.0 RXQ8.0 RXQ10.0 RXQ12.0 RXQ14.0 RXQ16.0 RXQ18.0
+prv_to_pub_map = (0, 1)(2, 3)(4, 5)(6, 7)(8, 9) (10, 11)(12, 13)(14, 15)(16, 17)(18, 19)
+ports_mac_list = CC:CC:CC:00:00:00 CC:CC:CC:00:00:01
+ports_mac_list = CC:CC:CC:00:01:00 CC:CC:CC:00:01:01
+ports_mac_list = CC:CC:CC:00:02:00 CC:CC:CC:00:02:01
+ports_mac_list = CC:CC:CC:00:03:00 CC:CC:CC:00:03:01
+ports_mac_list = CC:CC:CC:00:04:00 CC:CC:CC:00:04:01
+ports_mac_list = CC:CC:CC:00:05:00 CC:CC:CC:00:05:01
+ports_mac_list = CC:CC:CC:00:06:00 CC:CC:CC:00:06:01
+ports_mac_list = CC:CC:CC:00:07:00 CC:CC:CC:00:07:01
+ports_mac_list = CC:CC:CC:00:08:00 CC:CC:CC:00:08:01
+ports_mac_list = CC:CC:CC:00:09:00 CC:CC:CC:00:09:01
+
+
+[PIPELINE2]
+type = TIMER
+core = 0
+timer_dyn_timeout = 1000000
+n_flows = 2097152
+
+[PIPELINE3]
+type = CGNAPT
+core = 1
+pktq_in = RXQ0.0 RXQ1.0
+pktq_out = TXQ0.0 TXQ1.0 SWQ0
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 04040000:(1, 65535)
+public_ip_port_range = 04040001:(1, 65535)
+public_ip_port_range = 04040002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE4]
+type = CGNAPT
+core = 1h
+pktq_in = RXQ0.1 RXQ1.1
+pktq_out = TXQ0.1 TXQ1.1 SWQ1
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE5]
+type = CGNAPT
+core = 2
+pktq_in = RXQ2.0 RXQ3.0
+pktq_out = TXQ2.0 TXQ3.0 SWQ2
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 05050000:(1, 65535)
+public_ip_port_range = 05050001:(1, 65535)
+public_ip_port_range = 05050002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE6]
+type = CGNAPT
+core = 2h
+pktq_in = RXQ2.1 RXQ3.1
+pktq_out = TXQ2.1 TXQ3.1 SWQ3
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE7]
+type = CGNAPT
+core = 3
+pktq_in = RXQ4.0 RXQ5.0
+pktq_out = TXQ4.0 TXQ5.0 SWQ4
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 06060000:(1, 65535)
+public_ip_port_range = 06060001:(1, 65535)
+public_ip_port_range = 06060002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE8]
+type = CGNAPT
+core = 3h
+pktq_in = RXQ4.1 RXQ5.1
+pktq_out = TXQ4.1 TXQ5.1 SWQ5
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE9]
+type = CGNAPT
+core = 4
+pktq_in = RXQ6.0 RXQ7.0
+pktq_out = TXQ6.0 TXQ7.0 SWQ6
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 07070000:(1, 65535)
+public_ip_port_range = 07070001:(1, 65535)
+public_ip_port_range = 07070002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE10]
+type = CGNAPT
+core = 4h
+pktq_in = RXQ6.1 RXQ7.1
+pktq_out = TXQ6.1 TXQ7.1 SWQ7
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE11]
+type = CGNAPT
+core = 5
+pktq_in = RXQ8.0 RXQ9.0
+pktq_out = TXQ8.0 TXQ9.0 SWQ8
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 08080000:(1, 65535)
+public_ip_port_range = 08080001:(1, 65535)
+public_ip_port_range = 08080002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE12]
+type = CGNAPT
+core = 5h
+pktq_in = RXQ8.1 RXQ9.1
+pktq_out = TXQ8.1 TXQ9.1 SWQ9
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE13]
+type = CGNAPT
+core = 6
+pktq_in = RXQ10.0 RXQ11.0
+pktq_out = TXQ10.0 TXQ11.0 SWQ10
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 09090000:(1, 65535)
+public_ip_port_range = 09090001:(1, 65535)
+public_ip_port_range = 09090002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE14]
+type = CGNAPT
+core = 6h
+pktq_in = RXQ10.1 RXQ11.1
+pktq_out = TXQ10.1 TXQ11.1 SWQ11
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE15]
+type = CGNAPT
+core = 7
+pktq_in = RXQ12.0 RXQ13.0
+pktq_out = TXQ12.0 TXQ13.0 SWQ12
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 0a0a0000:(1, 65535)
+public_ip_port_range = 0a0a0001:(1, 65535)
+public_ip_port_range = 0a0a0002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE16]
+type = CGNAPT
+core = 7h
+pktq_in = RXQ12.1 RXQ13.1
+pktq_out = TXQ12.1 TXQ13.1 SWQ13
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE17]
+type = CGNAPT
+core = 8
+pktq_in = RXQ14.0 RXQ15.0
+pktq_out = TXQ14.0 TXQ15.0 SWQ14
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 0b0b0000:(1, 65535)
+public_ip_port_range = 0b0b0001:(1, 65535)
+public_ip_port_range = 0b0b0002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE18]
+type = CGNAPT
+core = 8h
+pktq_in = RXQ14.1 RXQ15.1
+pktq_out = TXQ14.1 TXQ15.1 SWQ15
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE19]
+type = CGNAPT
+core = 9
+pktq_in = RXQ16.0 RXQ17.0
+pktq_out = TXQ16.0 TXQ17.0 SWQ16
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 0c0c0000:(1, 65535)
+public_ip_port_range = 0c0c0001:(1, 65535)
+public_ip_port_range = 0c0c0002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE20]
+type = CGNAPT
+core = 9h
+pktq_in = RXQ16.1 RXQ17.1
+pktq_out = TXQ16.1 TXQ17.1 SWQ17
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE21]
+type = CGNAPT
+core = 10
+pktq_in = RXQ18.0 RXQ19.0
+pktq_out = TXQ18.0 TXQ19.0 SWQ18
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+public_ip_port_range = 0d0d0000:(1, 65535)
+public_ip_port_range = 0d0d0001:(1, 65535)
+public_ip_port_range = 0d0d0002:(1, 10)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE22]
+type = CGNAPT
+core = 10h
+pktq_in = RXQ18.1 RXQ19.1
+pktq_out = TXQ18.1 TXQ19.1 SWQ19
+phyport_offset = 204
+n_flows = 2097152
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 1000000
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
diff --git a/VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.txt b/VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.txt
new file mode 100644
index 0000000..20bacb7
--- /dev/null
+++ b/VNFs/vCGNAPT/config/cgnat_200G_hwlb_20port.txt
@@ -0,0 +1,95 @@
+
+p 1 arpadd 0 192.16.100.20 00:00:00:00:00:01
+p 1 arpadd 1 172.16.40.20 00:00:00:9F:32:71
+p 1 arpadd 2 193.16.100.20 00:00:00:00:00:02
+p 1 arpadd 3 173.16.40.20 00:00:00:9F:32:73
+p 1 arpadd 4 194.16.100.20 00:00:00:00:00:03
+p 1 arpadd 5 174.16.40.20 00:00:00:A0:0D:C1
+p 1 arpadd 6 195.16.100.20 00:00:00:00:00:04
+p 1 arpadd 7 175.16.40.20 00:00:00:A0:0D:C3
+p 1 arpadd 8 196.16.100.20 00:00:00:00:00:05
+p 1 arpadd 9 176.16.40.20 00:00:00:a4:ed:01
+p 1 arpadd 10 197.16.100.20 00:00:00:00:00:06
+p 1 arpadd 11 177.16.40.20 00:00:00:a4:ed:03
+p 1 arpadd 12 198.16.100.20 00:00:00:00:00:07
+p 1 arpadd 13 178.16.40.20 00:00:00:9f:37:c1
+p 1 arpadd 14 199.16.100.20 00:00:00:00:00:08
+p 1 arpadd 15 179.16.40.20 00:00:00:9f:37:c3
+p 1 arpadd 16 200.16.100.20 00:00:00:00:00:09
+p 1 arpadd 17 180.16.40.20 00:00:00:A5:4F:89
+p 1 arpadd 18 201.16.100.20 00:00:00:00:00:0a
+p 1 arpadd 19 181.16.40.20 00:00:00:A5:4F:8B
+
+set fwd rxonly
+set_sym_hash_ena_per_port 0 enable
+set_hash_global_config 0 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 1 enable
+set_hash_global_config 1 simple_xor ipv4-udp enable
+set_hash_input_set 0 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 1 ipv4-udp dst-ipv4 udp-dst-port add
+set_sym_hash_ena_per_port 2 enable
+set_hash_global_config 2 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 3 enable
+set_hash_global_config 3 simple_xor ipv4-udp enable
+set_hash_input_set 2 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 3 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 4 enable
+set_hash_global_config 4 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 5 enable
+set_hash_global_config 5 simple_xor ipv4-udp enable
+set_hash_input_set 4 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 5 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 6 enable
+set_hash_global_config 6 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 7 enable
+set_hash_global_config 7 simple_xor ipv4-udp enable
+set_hash_input_set 6 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 7 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 8 enable
+set_hash_global_config 8 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 9 enable
+set_hash_global_config 9 simple_xor ipv4-udp enable
+set_hash_input_set 8 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 9 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 10 enable
+set_hash_global_config 10 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 11 enable
+set_hash_global_config 11 simple_xor ipv4-udp enable
+set_hash_input_set 10 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 11 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 12 enable
+set_hash_global_config 12 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 13 enable
+set_hash_global_config 13 simple_xor ipv4-udp enable
+set_hash_input_set 12 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 13 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 14 enable
+set_hash_global_config 14 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 15 enable
+set_hash_global_config 15 simple_xor ipv4-udp enable
+set_hash_input_set 14 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 15 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 16 enable
+set_hash_global_config 16 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 17 enable
+set_hash_global_config 17 simple_xor ipv4-udp enable
+set_hash_input_set 16 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 17 ipv4-udp dst-ipv4 udp-dst-port add
+
+set_sym_hash_ena_per_port 18 enable
+set_hash_global_config 18 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 19 enable
+set_hash_global_config 19 simple_xor ipv4-udp enable
+set_hash_input_set 18 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 19 ipv4-udp dst-ipv4 udp-dst-port add
+
+
+p 1 arpls
+
diff --git a/VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.cfg b/VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.cfg
new file mode 100644
index 0000000..7b313a0
--- /dev/null
+++ b/VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.cfg
@@ -0,0 +1,68 @@
+[EAL]
+n = 4
+file_prefix = cgnat_1
+m = 4096
+
+[PIPELINE0]
+type = MASTER
+core = 0
+
+[PIPELINE1]
+type = ARPICMP
+core = 0
+pktq_in = SWQ0 SWQ1
+pktq_out = TXQ0.0 TXQ1.0
+arp_route_tbl = (c0106414,FFFF0000,0,c0106414)
+arp_route_tbl = (ac102814,FFFF0000,1,ac102814)
+#nd_route_tbl = (0064:ff9b:0:0:0:0:c010:6414,120,0,0064:ff9b:0:0:0:0:c010:6414)
+#nd_route_tbl = (0064:ff9b:0:0:0:0:ac10:2814,120,1,0064:ff9b:0:0:0:0:ac10:2814)
+pktq_in_prv = RXQ0.0
+prv_to_pub_map = (0, 1)
+ports_mac_list = CC:CC:CC:00:00:00 CC:CC:CC:00:00:01
+
+[PIPELINE2]
+type = TIMER
+core = 0
+timer_dyn_timeout = 1000000
+n_flows = 1048576
+
+[PIPELINE3]
+type = CGNAPT
+core = 1
+pktq_in = RXQ0.0 RXQ1.0
+pktq_out = TXQ0.1 TXQ1.1 SWQ0
+phyport_offset = 204
+n_flows = 1048576
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100
+public_ip_port_range = 04040000:(1, 65535)
+public_ip_port_range = 04040001:(1, 65535)
+public_ip_port_range = 04040002:(1, 65535)
+vnf_set = (3,4,5)
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
+[PIPELINE4]
+type = CGNAPT
+core = 1h
+pktq_in = RXQ0.1 RXQ1.1
+pktq_out = TXQ0.2 TXQ1.2 SWQ1
+phyport_offset = 204
+n_flows = 1048576
+key_offset = 192;64
+key_size = 8
+hash_offset = 200;72
+timer_period = 1000000;
+max_clients_per_ip = 65535
+max_port_per_client = 100
+pkt_type = ipv4
+cgnapt_meta_offset = 128
+prv_que_handler = (0,)
+hw_checksum_reqd = 1
+
diff --git a/VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.txt b/VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.txt
new file mode 100644
index 0000000..d3aa524
--- /dev/null
+++ b/VNFs/vCGNAPT/config/cgnat_20G_hwlb_2port.txt
@@ -0,0 +1,15 @@
+
+p 1 arpadd 0 192.16.100.20 00:00:00:00:00:01
+p 1 arpadd 1 172.16.40.20 00:00:00:9F:32:71
+
+set fwd rxonly
+set_sym_hash_ena_per_port 0 enable
+set_hash_global_config 0 simple_xor ipv4-udp enable
+set_sym_hash_ena_per_port 1 enable
+set_hash_global_config 1 simple_xor ipv4-udp enable
+
+set_hash_input_set 0 ipv4-udp src-ipv4 udp-src-port add
+set_hash_input_set 1 ipv4-udp dst-ipv4 udp-dst-port add
+
+p 1 arpls
+
diff --git a/common/cscope.out b/common/cscope.out
deleted file mode 100644
index 54523ac..0000000
--- a/common/cscope.out
+++ /dev/null
@@ -1,250740 +0,0 @@
-cscope 15 $HOME/work/opnfv/samplevnf/common 0001447068
- @VIL/acl/lib_acl.c
-
-16 
- ~"lib_a.h
-"
-
-17 
- ~"vnf_comm.h
-"
-
-18 
- ~<e_pt.h
->
-
-19 
- #ACL_LIB_DEBUG
- 0
-
- )
-
-20 
-e_a_fld_def
-
- gfld_fm_v4
-[] = {
-
-23 .
-ty
- =
-RTE_ACL_FIELD_TYPE_BITMASK
-,
-
-24 .
- gsize
- = (
-ut8_t
-),
-
-25 .
- gfld_dex
- = 0,
-
-26 .
- gput_dex
- = 0,
-
-27 .
- gofft
- = (
-h_hdr
-) +
-
-28
-offtof
-(
-v4_hdr
-,
-xt_o_id
-),
-
-33 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-34 .
- gsize
- = (
-ut32_t
-),
-
-35 .
- gfld_dex
- = 1,
-
-36 .
- gput_dex
- = 1,
-
-37 .
- gofft
- = (
-h_hdr
-) +
-
-38
-offtof
-(
-v4_hdr
-,
-c_addr
-),
-
-43 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-44 .
- gsize
- = (
-ut32_t
-),
-
-45 .
- gfld_dex
- = 2,
-
-46 .
- gput_dex
- = 2,
-
-47 .
- gofft
- = (
-h_hdr
-) +
-
-48
-offtof
-(
-v4_hdr
-,
-d_addr
-),
-
-53 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-54 .
- gsize
- = (
-ut16_t
-),
-
-55 .
- gfld_dex
- = 3,
-
-56 .
- gput_dex
- = 3,
-
-57 .
- gofft
- = (
-h_hdr
-) +
-
-58 (
-v4_hdr
-+
-offtof
-(
-t_hdr
-,
-c_pt
-),
-
-63 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-64 .
- gsize
- = (
-ut16_t
-),
-
-65 .
- gfld_dex
- = 4,
-
-66 .
- gput_dex
- = 3,
-
-67 .
- gofft
- = (
-h_hdr
-) +
-
-68 (
-v4_hdr
-+
-offtof
-(
-t_hdr
-,
-d_pt
-),
-
-72 
- #SIZEOF_VLAN_HDR
- 4
-
- )
-
-74 
-e_a_fld_def
-
- gfld_fm_vn_v4
-[] = {
-
-77 .
-ty
- =
-RTE_ACL_FIELD_TYPE_BITMASK
-,
-
-78 .
- gsize
- = (
-ut8_t
-),
-
-79 .
- gfld_dex
- = 0,
-
-80 .
- gput_dex
- = 0,
-
-81 .
- gofft
- = (
-h_hdr
-) +
-
-82
-SIZEOF_VLAN_HDR
- +
-offtof
-(
-v4_hdr
-,
-xt_o_id
-),
-
-87 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-88 .
- gsize
- = (
-ut32_t
-),
-
-89 .
- gfld_dex
- = 1,
-
-90 .
- gput_dex
- = 1,
-
-91 .
- gofft
- = (
-h_hdr
-) +
-
-92
-SIZEOF_VLAN_HDR
- +
-offtof
-(
-v4_hdr
-,
-c_addr
-),
-
-97 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-98 .
- gsize
- = (
-ut32_t
-),
-
-99 .
- gfld_dex
- = 2,
-
-100 .
- gput_dex
- = 2,
-
-101 .
- gofft
- = (
-h_hdr
-) +
-
-102
-SIZEOF_VLAN_HDR
- +
-offtof
-(
-v4_hdr
-,
-d_addr
-),
-
-107 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-108 .
- gsize
- = (
-ut16_t
-),
-
-109 .
- gfld_dex
- = 3,
-
-110 .
- gput_dex
- = 3,
-
-111 .
- gofft
- = (
-h_hdr
-) +
-
-112
-SIZEOF_VLAN_HDR
- +
-
-113 (
-v4_hdr
-+
-offtof
-(
-t_hdr
-,
-c_pt
-),
-
-118 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-119 .
- gsize
- = (
-ut16_t
-),
-
-120 .
- gfld_dex
- = 4,
-
-121 .
- gput_dex
- = 4,
-
-122 .
- gofft
- = (
-h_hdr
-) +
-
-123
-SIZEOF_VLAN_HDR
- +
-
-124 (
-v4_hdr
-+
-offtof
-(
-t_hdr
-,
-d_pt
-),
-
-128 
- #SIZEOF_QINQ_HEADER
- 8
-
- )
-
-130 
-e_a_fld_def
-
- gfld_fm_qq_v4
-[] = {
-
-133 .
-ty
- =
-RTE_ACL_FIELD_TYPE_BITMASK
-,
-
-134 .
- gsize
- = (
-ut8_t
-),
-
-135 .
- gfld_dex
- = 0,
-
-136 .
- gput_dex
- = 0,
-
-137 .
- gofft
- = (
-h_hdr
-) +
-
-138
-SIZEOF_QINQ_HEADER
- +
-offtof
-(
-v4_hdr
-,
-xt_o_id
-),
-
-143 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-144 .
- gsize
- = (
-ut32_t
-),
-
-145 .
- gfld_dex
- = 1,
-
-146 .
- gput_dex
- = 1,
-
-147 .
- gofft
- = (
-h_hdr
-) +
-
-148
-SIZEOF_QINQ_HEADER
- +
-offtof
-(
-v4_hdr
-,
-c_addr
-),
-
-153 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-154 .
- gsize
- = (
-ut32_t
-),
-
-155 .
- gfld_dex
- = 2,
-
-156 .
- gput_dex
- = 2,
-
-157 .
- gofft
- = (
-h_hdr
-) +
-
-158
-SIZEOF_QINQ_HEADER
- +
-offtof
-(
-v4_hdr
-,
-d_addr
-),
-
-163 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-164 .
- gsize
- = (
-ut16_t
-),
-
-165 .
- gfld_dex
- = 3,
-
-166 .
- gput_dex
- = 3,
-
-167 .
- gofft
- = (
-h_hdr
-) +
-
-168
-SIZEOF_QINQ_HEADER
- +
-
-169 (
-v4_hdr
-+
-offtof
-(
-t_hdr
-,
-c_pt
-),
-
-174 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-175 .
- gsize
- = (
-ut16_t
-),
-
-176 .
- gfld_dex
- = 4,
-
-177 .
- gput_dex
- = 4,
-
-178 .
- gofft
- = (
-h_hdr
-) +
-
-179
-SIZEOF_QINQ_HEADER
- +
-
-180 (
-v4_hdr
-+
-offtof
-(
-t_hdr
-,
-d_pt
-),
-
-184 
-e_a_fld_def
-
- gfld_fm_v6
-[] = {
-
-187 .
-ty
- =
-RTE_ACL_FIELD_TYPE_BITMASK
-,
-
-188 .
- gsize
- = (
-ut8_t
-),
-
-189 .
- gfld_dex
- = 0,
-
-190 .
- gput_dex
- = 0,
-
-191 .
- gofft
- = (
-h_hdr
-) +
-
-192
-offtof
-(
-v6_hdr
-,
-o
-),
-
-197 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-198 .
- gsize
- = (
-ut32_t
-),
-
-199 .
- gfld_dex
- = 1,
-
-200 .
- gput_dex
- = 1,
-
-201 .
- gofft
- = (
-h_hdr
-) +
-
-202
-offtof
-(
-v6_hdr
-,
-c_addr
-),
-
-206 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-207 .
- gsize
- = (
-ut32_t
-),
-
-208 .
- gfld_dex
- = 2,
-
-209 .
- gput_dex
- = 2,
-
-210 .
- gofft
- = (
-h_hdr
-) +
-
-211
-offtof
-(
-v6_hdr
-,
-c_addr
-+ (
- gut32_t
-),
-
-215 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-216 .
- gsize
- = (
-ut32_t
-),
-
-217 .
- gfld_dex
- = 3,
-
-218 .
- gput_dex
- = 3,
-
-219 .
- gofft
- = (
-h_hdr
-) +
-
-220
-offtof
-(
-v6_hdr
-,
-c_addr
-+ 2 * (
- gut32_t
-),
-
-224 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-225 .
- gsize
- = (
-ut32_t
-),
-
-226 .
- gfld_dex
- = 4,
-
-227 .
- gput_dex
- = 4,
-
-228 .
- gofft
- = (
-h_hdr
-) +
-
-229
-offtof
-(
-v6_hdr
-,
-c_addr
-+ 3 * (
- gut32_t
-),
-
-234 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-235 .
- gsize
- = (
-ut32_t
-),
-
-236 .
- gfld_dex
- = 5,
-
-237 .
- gput_dex
- = 5,
-
-238 .
- gofft
- = (
-h_hdr
-) +
-
-239
-offtof
-(
-v6_hdr
-,
-d_addr
-),
-
-243 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-244 .
- gsize
- = (
-ut32_t
-),
-
-245 .
- gfld_dex
- = 6,
-
-246 .
- gput_dex
- = 6,
-
-247 .
- gofft
- = (
-h_hdr
-) +
-
-248
-offtof
-(
-v6_hdr
-,
-d_addr
-+ (
- gut32_t
-),
-
-252 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-253 .
- gsize
- = (
-ut32_t
-),
-
-254 .
- gfld_dex
- = 7,
-
-255 .
- gput_dex
- = 7,
-
-256 .
- gofft
- = (
-h_hdr
-) +
-
-257
-offtof
-(
-v6_hdr
-,
-d_addr
-+ 2 * (
- gut32_t
-),
-
-261 .
-ty
- =
-RTE_ACL_FIELD_TYPE_MASK
-,
-
-262 .
- gsize
- = (
-ut32_t
-),
-
-263 .
- gfld_dex
- = 8,
-
-264 .
- gput_dex
- = 8,
-
-265 .
- gofft
- = (
-h_hdr
-) +
-
-266
-offtof
-(
-v6_hdr
-,
-d_addr
-+ 3 * (
- gut32_t
-),
-
-271 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-272 .
- gsize
- = (
-ut16_t
-),
-
-273 .
- gfld_dex
- = 9,
-
-274 .
- gput_dex
- = 9,
-
-275 .
- gofft
- = (
-h_hdr
-) +
-
-276 (
-v6_hdr
-+
-offtof
-(
-t_hdr
-,
-c_pt
-),
-
-281 .
-ty
- =
-RTE_ACL_FIELD_TYPE_RANGE
-,
-
-282 .
- gsize
- = (
-ut16_t
-),
-
-283 .
- gfld_dex
- = 10,
-
-284 .
- gput_dex
- = 9,
-
-285 .
- gofft
- = (
-h_hdr
-) +
-
-286 (
-v6_hdr
-+
-offtof
-(
-t_hdr
-,
-d_pt
-),
-
-290 *
- $lib_a__aive_dby_b_v4
-(
-ut8_t
-
-b_num
-,
-
-291
-ut32_t
- *
-liba_n_rus
-)
-
-293
- `tf
-("Create LIBACLctive IPV4 Tableste_socket_id(): %i\n",
-
-294
- `e_sock_id
-());
-
-297 
-e_b_a_ms
-
-comm_v4_b_liba_ms
- = {
-
-298 .
-me
- = "LIBACLIPV4A",
-
-299 .
-n_rus
- = *
-liba_n_rus
-,
-
-300 .
-n_ru_flds
- =
- `RTE_DIM
-(
-fld_fm_v4
-),
-
-303
- `memy
-(
-comm_v4_b_liba_ms
-.
-fld_fm
-,
-
-304
-fld_fm_v4
-, (field_format_ipv4));
-
-306
-ut32_t
-
-v4_y_size
- = (
-lib_a_b_y
-);
-
-308 i(
-b_num
- == 2)
-
-309
-comm_v4_b_liba_ms
-.
-me
- = "LIBACLIPV4B";
-
-310 
-e_b_a_s
-.
- `f_
-(&
-comm_v4_b_liba_ms
-,
-
-311
- `e_sock_id
-(),
-
-312
-v4_y_size
-);
-
-315
- }
-}
-
-317 *
- $lib_a__aive_dby_b_v6
-(
-ut8_t
-
-b_num
-,
-
-318
-ut32_t
- *
-liba_n_rus
-)
-
-320
- `tf
-("Create LIBACLctive IPV6 Tableste_socket_id(): %i\n",
-
-321
- `e_sock_id
-());
-
-323 
-e_b_a_ms
-
-comm_v6_b_liba_ms
- = {
-
-324 .
-me
- = "LIBACLIPV6A",
-
-325 .
-n_rus
- = *
-liba_n_rus
-,
-
-326 .
-n_ru_flds
- =
- `RTE_DIM
-(
-fld_fm_v6
-),
-
-329
- `memy
-(
-comm_v6_b_liba_ms
-.
-fld_fm
-,
-
-330
-fld_fm_v6
-, (field_format_ipv6));
-
-332
-ut32_t
-
-v6_y_size
- = (
-lib_a_b_y
-);
-
-334 i(
-b_num
- == 2)
-
-335
-comm_v6_b_liba_ms
-.
-me
- = "LIBACLIPV6B";
-
-336 
-e_b_a_s
-.
- `f_
-(&
-comm_v6_b_liba_ms
-,
-
-337
- `e_sock_id
-(),
-
-338
-v6_y_size
-);
-
-341
- }
-}
-
-342 
- $lib_a_r_cfig
-(
-lib_a
- *
-ib_a
-,
-
-343 *
-g_me
-, *
-g_vue
-,
-
-344
-ut32_t
- *
-liba_n_rus
-)
-
-346
-ut32_t
-
-n_rus_e
- = 0;
-
-347
-ut32_t
-
-pkt_ty_e
- = 0;
-
-349
-ib_a
-->
-n_rus
- =
-DEFULT_NUM_RULE
-;
-
-350 *
-liba_n_rus
- =
-DEFULT_NUM_RULE
-;
-
-351
-ib_a
-->
-n_ru_flds
- =
- `RTE_DIM
-(
-fld_fm_v4
-);
-
-352
-ib_a
-->
-fld_fm
- =
-fld_fm_v4
-;
-
-353
-ib_a
-->
-fld_fm_size
- = (
-fld_fm_v4
-);
-
-354 i(
- `rcmp
-(
-g_me
-, "n_rules") == 0) {
-
-355 i(
-n_rus_e
-) {
-
-356
- `tf
-("n_rules_present");
-
-359
-n_rus_e
- = 1;
-
-361
-ib_a
-->
-n_rus
- =
- `oi
-(
-g_vue
-);
-
-362 *
-liba_n_rus
- =
- `oi
-(
-g_vue
-);
-
-365 i(
- `rcmp
-(
-g_me
-, "pkt_type") == 0) {
-
-366 i(
-pkt_ty_e
-) {
-
-367
- `tf
-("pkt_type");
-
-370
-pkt_ty_e
- = 1;
-
-373 i(
- `rcmp
-(
-g_vue
-, "ipv4") == 0) {
-
-374
-ib_a
-->
-n_ru_flds
- =
-
-375
- `RTE_DIM
-(
-fld_fm_v4
-);
-
-376
-ib_a
-->
-fld_fm
- =
-fld_fm_v4
-;
-
-377
-ib_a
-->
-fld_fm_size
- =
-
-378 (
-fld_fm_v4
-);
-
-383 i(
- `rcmp
-(
-g_vue
-, "vlan_ipv4") == 0) {
-
-384
-ib_a
-->
-n_ru_flds
- =
-
-385
- `RTE_DIM
-(
-fld_fm_vn_v4
-);
-
-386
-ib_a
-->
-fld_fm
- =
-
-387
-fld_fm_vn_v4
-;
-
-388
-ib_a
-->
-fld_fm_size
- =
-
-389 (
-fld_fm_vn_v4
-);
-
-394 i(
- `rcmp
-(
-g_vue
-, "qinq_ipv4") == 0) {
-
-395
-ib_a
-->
-n_ru_flds
- =
-
-396
- `RTE_DIM
-(
-fld_fm_qq_v4
-);
-
-397
-ib_a
-->
-fld_fm
- =
-
-398
-fld_fm_qq_v4
-;
-
-399
-ib_a
-->
-fld_fm_size
- =
-
-400 (
-fld_fm_qq_v4
-);
-
-405 i(
- `rcmp
-(
-g_vue
-, "ipv6") == 0) {
-
-406
-ib_a
-->
-n_ru_flds
- =
-
-407
- `RTE_DIM
-(
-fld_fm_v6
-);
-
-408
-ib_a
-->
-fld_fm
- =
-fld_fm_v6
-;
-
-409
-ib_a
-->
-fld_fm_size
- =
-
-410 (
-fld_fm_v6
-);
-
-414
- `tf
-("other");
-
-419
- }
-}
-
-444
-ut64_t
-
-
-445
-lib_a_pkt_wk_key
-(
-lib_a
- *
-ib_a
-,
-
-446 
-e_mbuf
- **
-pkts
-,
-ut64_t
-
-pkts_mask
-,
-
-447
-ut64_t
- *
-pkts_dr_whout_ru
-,
-
-448 *
-ib_a_ru_b_v4_aive
-,
-
-449 *
-ib_a_ru_b_v6_aive
-,
-
-450 
-pe_ai_key
- *
-ai_y_aive
-,
-
-451 
-ai_cou_block
- (*
-p_ai_cou_b
-)[
-ai_y_max
-],
-
-452
-ut64_t
- *
-cck_mask
-,
-
-453
-ut64_t
- *
-cxi_mask
-,
-
-454 
-lib_a_v4_abd
-, 
-lib_a_v6_abd
-)
-
-457
-ut64_t
-
- glookup_h_mask
- = 0;
-
-458
-ut64_t
-
- glookup_h_mask_v4
- = 0;
-
-459
-ut64_t
-
- glookup_h_mask_v6
- = 0;
-
-460
-ut64_t
-
- glookup_miss_mask
- = 0;
-
-461 
- gus
-;
-
-464 i(
- glib_a_v4_abd
-) {
-
-465 i(
- gACL_LIB_DEBUG
-)
-
-466
-tf
-("ACL IPV4 LookuMask Befܐ0x%"
-PRIx64
-"\n",
-
-467
-pkts_mask
-);
-
-468
- gus
- =
-e_b_a_s
-.
-f_lookup
-(
-
-469
-ib_a_ru_b_v4_aive
-,
-
-470
-pkts
-,
-pkts_mask
-, &
-lookup_h_mask_v4
-,
-
-471 (**
-ib_a
-->
-ib_a_s_v4
-);
-
-472 i(
- gus
- < 0)
-
-473
-tf
-("Lookup failed\n");
-
-474 i(
- gACL_LIB_DEBUG
-)
-
-475
-tf
-("ACL IPV4 LookuMask A = 0x%"
-PRIx64
-"\n",
-
-476
-lookup_h_mask_v4
-);
-
-479 i(
- glib_a_v6_abd
-) {
-
-480 i(
- gACL_LIB_DEBUG
-)
-
-481
-tf
-("ACL IPV6 LookuMask Befܐ0x%"
-PRIx64
-"\n",
-
-482
-pkts_mask
-);
-
-483
- gus
- =
-e_b_a_s
-.
-f_lookup
-(
-
-484
-ib_a_ru_b_v6_aive
-,
-
-485
-pkts
-,
-pkts_mask
-, &
-lookup_h_mask_v6
-,
-
-486 (**
-ib_a
-->
-ib_a_s_v6
-);
-
-487 i(
- gus
- < 0)
-
-488
-tf
-("Lookup Failed\n");
-
-489 i(
- gACL_LIB_DEBUG
-)
-
-490
-tf
-("ACL IPV6 LookuMask A = 0x%"
-PRIx64
-"\n",
-
-491
-lookup_h_mask_v6
-);
-
-495
- glookup_h_mask
- =
-lookup_h_mask_v4
- |
-lookup_h_mask_v6
-;
-
-496 i(
- gACL_LIB_DEBUG
-)
-
-497
-tf
-("ACL LookuMask A = 0x%"
-PRIx64
-"\n",
-
-498
-lookup_h_mask
-);
-
-500
- glookup_miss_mask
- =
-pkts_mask
- & (~
-lookup_h_mask
-);
-
-501
- gpkts_mask
- =
-lookup_h_mask
-;
-
-502 *
- gpkts_dr_whout_ru
- +
-__but_pcou
-(
-lookup_miss_mask
-);
-
-503 i(
- gACL_LIB_DEBUG
-)
-
-504
-tf
-("pkt_wk_a_keykts_dr: %"
-PRIu64
- "_pkts: %u\n",
-
-505 *
-pkts_dr_whout_ru
-,
-
-506
-__but_pcou
-(
-lookup_miss_mask
-));
-
-508
-ut64_t
-
- gpkts_to_oss
- =
-lookup_h_mask
-;
-
-510 ;
- gpkts_to_oss
-;) {
-
-511
-ut8_t
-
- gpos
- = (ut8_t)
-__but_z
-(
-pkts_to_oss
-);
-
-513
-ut64_t
-
- gpkt_mask
- = 1LLU <<
-pos
-;
-
-515
- gpkts_to_oss
- &~
-pkt_mask
-;
-
-516 
-e_mbuf
- *
- gpkt
- =
-pkts
-[
-pos
-];
-
-518
-ut8_t
-
- ghdr_chk
- =
-RTE_MBUF_METADATA_UINT8
-(
-pkt
-,
-IP_START
-);
-
-520
- ghdr_chk
- =
-hdr_chk
- >>
-IP_VERSION_CHECK
-;
-
-522 i(
- ghdr_chk
- =
-IPv4_HDR_VERSION
-) {
-
-524 
-lib_a_b_y
- *
-y
- =
-
-525 (
-lib_a_b_y
- *)
-
-526
-ib_a
-->
-ib_a_s_v4
-[
-pos
-];
-
-527
-ut16_t
-
- gphy_pt
- =
-y
-->
-hd
-.
-pt_id
-;
-
-528
-ut32_t
-
- gai_id
- =
-y
-->
-ai_id
-;
-
-530 i(
- gACL_LIB_DEBUG
-)
-
-531
-tf
-("ai_id = %u\n",
-ai_id
-);
-
-533
-ut32_t
-
- gds_offt
- =
-IP_START
- +
-IP_HDR_DSCP_OFST
-;
-
-535 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-536
- glib_a_ai_cou
-) {
-
-537
- gp_ai_cou_b
-
-
-538 [
-ib_a
-->
-ai_cou_dex
-]
-
-539 [
-ai_id
-].
- gckCou
-++;
-
-540
- gp_ai_cou_b
-
-
-541 [
-ib_a
-->
-ai_cou_dex
-]
-
-542 [
-ai_id
-].
- gbyCou
- +=
-
-543
-e_pktmbuf_pkt_n
-(
-pkt
-);
-
-544 i(
- gACL_LIB_DEBUG
-)
-
-545
-tf
-("Action Count Packet Count: %"
-
-546
-PRIu64
- " Byte Count: %"
-
-547
-PRIu64
- "\n"
-
-548 ,
-p_ai_cou_b
-
-
-549 [
-ib_a
-->
-ai_cou_dex
-]
-
-550 [
-ai_id
-].
-ckCou
-,
-
-551
-p_ai_cou_b
-
-
-552 [
-ib_a
-->
-ai_cou_dex
-]
-
-553 [
-ai_id
-].
-byCou
-);
-
-556 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-557
- glib_a_ai_ck_dr
-) {
-
-560 i(
- gACL_LIB_DEBUG
-)
-
-561
-tf
-("ACL before dropkt_mask %"
-
-562
-PRIx64
-",kt_num %d\n",
-
-563
-pkts_mask
-,
-pos
-);
-
-564
- gpkts_mask
- &~(1LLU <<
-pos
-);
-
-565 (*
- gpkts_dr_whout_ru
-)++;
-
-566 i(
- gACL_LIB_DEBUG
-)
-
-567
-tf
-("ACL dr݅kt_mask %"
-PRIx64
-
-
-569
-PRIu64
-"\n",
-pkts_mask
-,
-pos
-,
-
-570 *
-pkts_dr_whout_ru
-);
-
-573 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-574
- glib_a_ai_fwd
-) {
-
-575
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-576
-fwd_pt
-;
-
-577
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-578 i(
- gACL_LIB_DEBUG
-)
-
-579
-tf
-("Action FWD Port ID: %"
-
-580
-PRIu16
-"\n",
-phy_pt
-);
-
-583 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-584
- glib_a_ai_t
-) {
-
-585
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-586
-t_pt
-;
-
-587
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-588 i(
- gACL_LIB_DEBUG
-)
-
-589
-tf
-("Action NAT Port ID: %"
-
-590
-PRIu16
-"\n",
-phy_pt
-);
-
-593 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-594
- glib_a_ai_ds
-) {
-
-597
-ut8_t
- *
- gds
- =
-RTE_MBUF_METADATA_UINT8_PTR
-(
-pkt
-,
-
-598
-ds_offt
-);
-
-599 *
- gds
- =
-ai_y_aive
-[
-ai_id
-].
-
-600
-ds_iܙy
- << 2;
-
-601 i(
- gACL_LIB_DEBUG
-)
-
-602
-tf
-("Action DSCP DSCP Priority: %"
-
-603
-PRIu16
- "\n", *
-ds
-);
-
-606 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-607
- glib_a_ai_ck_ac
-) {
-
-608 i(
- gACL_LIB_DEBUG
-)
-
-609
-tf
-("Action Accept\n");
-
-611 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-612 &
- glib_a_ai_cck
-) {
-
-615 *
- gcck_mask
- |
-pkt_mask
-;
-
-616 i(
- gACL_LIB_DEBUG
-)
-
-617
-tf
-("ACL CTnabled: 0x%"
-
-618
-PRIx64
-"kt_mask: 0x%"
-
-619
-PRIx64
-"\n",
-
-620 *
-cck_mask
-,
-
-621
-pkt_mask
-);
-
-624 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-625 &
- glib_a_ai_cxi
-) {
-
-628 *
- gcck_mask
- |
-pkt_mask
-;
-
-634 i(
- gai_y_aive
-[
-ai_id
-].
-
-635
- give_public
- ==
-
-636
-lib_a_public_ive
-)
-
-637 *
-cxi_mask
- |
-pkt_mask
-;
-
-639 i(
- gACL_LIB_DEBUG
-)
-
-640
-tf
-("Connexist ENB CT:0x%"
-
-641
-PRIx64
-" connexist: 0x%"
-
-642
-PRIx64
-"kt_mask: 0x%"
-
-643
-PRIx64
-"\n",
-
-644 *
-cck_mask
-,
-
-645 *
-cxi_mask
-,
-
-646
-pkt_mask
-);
-
-651 i(
- ghdr_chk
- =
-IPv6_HDR_VERSION
-) {
-
-653 
-lib_a_b_y
- *
-y
- =
-
-654 (
-lib_a_b_y
- *)
-
-655
-ib_a
-->
-ib_a_s_v6
-[
-pos
-];
-
-656
-ut16_t
-
- gphy_pt
- =
-y
-->
-hd
-.
-pt_id
-;
-
-657
-ut32_t
-
- gai_id
- =
-y
-->
-ai_id
-;
-
-659 i(
- gACL_LIB_DEBUG
-)
-
-660
-tf
-("ai_id = %u\n",
-ai_id
-);
-
-662 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-663
- glib_a_ai_cou
-) {
-
-664
- gp_ai_cou_b
-
-
-665 [
-ib_a
-->
-ai_cou_dex
-]
-
-666 [
-ai_id
-].
- gckCou
-++;
-
-667
- gp_ai_cou_b
-
-
-668 [
-ib_a
-->
-ai_cou_dex
-]
-
-669 [
-ai_id
-].
- gbyCou
- +=
-
-670
-e_pktmbuf_pkt_n
-(
-pkt
-);
-
-671 i(
- gACL_LIB_DEBUG
-)
-
-672
-tf
-("Action Count Packet Count: %"
-
-673
-PRIu64
- " Byte Count: %"
-
-674
-PRIu64
- "\n",
-
-675
-p_ai_cou_b
-
-
-676 [
-ib_a
-->
-ai_cou_dex
-]
-
-677 [
-ai_id
-].
-ckCou
-,
-
-678
-p_ai_cou_b
-
-
-679 [
-ib_a
-->
-ai_cou_dex
-]
-
-680 [
-ai_id
-].
-byCou
-);
-
-683 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-684
- glib_a_ai_ck_dr
-) {
-
-686 i(
- gACL_LIB_DEBUG
-)
-
-687
-tf
-("ACL before dropkt_mask %"
-
-688
-PRIx64
-",kt_num %d\n",
-
-689
-pkts_mask
-,
-pos
-);
-
-690
- gpkts_mask
- &~(1LLU <<
-pos
-);
-
-691 (*
- gpkts_dr_whout_ru
-)++;
-
-692 i(
- gACL_LIB_DEBUG
-)
-
-693
-tf
-("ACL dr݅kt_mask %"
-PRIx64
-
-
-695
-PRIu64
- "\n",
-pkts_mask
-,
-pos
-,
-
-696 *
-pkts_dr_whout_ru
-);
-
-700 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-701
- glib_a_ai_fwd
-) {
-
-702
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-703
-fwd_pt
-;
-
-704
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-705 i(
- gACL_LIB_DEBUG
-)
-
-706
-tf
-("Action FWD Port ID: %"
-
-707
-PRIu16
-"\n",
-phy_pt
-);
-
-710 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-711
- glib_a_ai_t
-) {
-
-712
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-713
-t_pt
-;
-
-714
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-715 i(
- gACL_LIB_DEBUG
-)
-
-716
-tf
-("Action NAT Port ID: %"
-
-717
-PRIu16
-"\n",
-phy_pt
-);
-
-720 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-721
- glib_a_ai_ds
-) {
-
-724
-ut32_t
-
- gds_offt
- =
-IP_START
- +
-
-725
-IP_HDR_DSCP_OFST_IPV6
-;
-
-726
-ut16_t
- *
- gds
- =
-RTE_MBUF_METADATA_UINT16_PTR
-(
-
-727
-pkt
-,
-ds_offt
-);
-
-728
-ut16_t
-
- gmp
- = *
-ds
-;
-
-729
-ut16_t
-
- gds_vue
- = (
-e_bsw16
-(
-mp
-) &
-
-731
-ut8_t
-
- gds_e
- =
-
-732
-ai_y_aive
-
-
-733 [
-ai_id
-].
-ds_iܙy
- << 2;
-
-734
-ut16_t
-
- gds_mp
- =
-ds_e
-;
-
-736
- gds_mp
- =
-ds_mp
- << 4;
-
-737 *
- gds
- =
-e_bsw16
-(
-ds_mp
- |
-ds_vue
-);
-
-738 i(
- gACL_LIB_DEBUG
-)
-
-739
-tf
-("Action DSCP DSCP Priority: %"
-
-740
-PRIu16
-"\n", *
-ds
-);
-
-743 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-744 &
- glib_a_ai_ck_ac
-) {
-
-745 i(
- gACL_LIB_DEBUG
-)
-
-746
-tf
-("Action Accept\n");
-
-748 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-749 &
- glib_a_ai_cck
-) {
-
-752 *
- gcck_mask
- |
-pkt_mask
-;
-
-753 i(
- gACL_LIB_DEBUG
-)
-
-754
-tf
-("ACL CTnabled: 0x%"
-
-755
-PRIx64
-"kt_mask: 0x%"
-
-756
-PRIx64
-"\n",
-
-757 *
-cck_mask
-,
-
-758
-pkt_mask
-);
-
-761 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-762 &
- glib_a_ai_cxi
-) {
-
-765 *
- gcck_mask
- |
-pkt_mask
-;
-
-771 i(
- gai_y_aive
-[
-ai_id
-].
-
-772
- give_public
- ==
-
-773
-lib_a_public_ive
-)
-
-774 *
-cxi_mask
- |
-pkt_mask
-;
-
-776 i(
- gACL_LIB_DEBUG
-)
-
-777
-tf
-("Connexist ENB CT:0x%"
-
-778
-PRIx64
-" connexist: 0x%"
-
-779
-PRIx64
-"kt_mask: 0x%"
-
-780
-PRIx64
-"\n",
-
-781 *
-cck_mask
-,
-
-782 *
-cxi_mask
-,
-
-783
-pkt_mask
-);
-
-788 
- gpkts_mask
-;
-
-813
-ut64_t
-
-
-814
-lib_a_v4_pkt_wk_key
-(
-lib_a
- *
-ib_a
-,
-
-815 
-e_mbuf
- **
-pkts
-,
-ut64_t
-
-pkts_mask
-,
-
-816
-ut64_t
- *
-pkts_dr_whout_ru
-,
-
-817 *
-ib_a_ru_b_v4_aive
-,
-
-818 
-pe_ai_key
- *
-ai_y_aive
-,
-
-819 
-ai_cou_block
- (*
-p_ai_cou_b
-)[
-ai_y_max
-],
-
-820
-ut64_t
- *
-cck_mask
-,
-
-821
-ut64_t
- *
-cxi_mask
-)
-
-824
-ut64_t
-
- glookup_h_mask_v4
- = 0;
-
-825
-ut64_t
-
- glookup_miss_mask_v4
- = 0;
-
-826 
- gus
-;
-
-828 i(
- gACL_LIB_DEBUG
-)
-
-829
-tf
-("ACL IPV4 LookuMask Befܐ0x%"
-PRIx64
-"\n",
-
-830
-pkts_mask
-);
-
-831
- gus
- =
-e_b_a_s
-.
-f_lookup
-(
-
-832
-ib_a_ru_b_v4_aive
-,
-
-833
-pkts
-,
-pkts_mask
-, &
-lookup_h_mask_v4
-,
-
-834 (**
-ib_a
-->
-ib_a_s_v4
-);
-
-835 i(
- gus
- < 0)
-
-836
-tf
-("Lookup Failed\n");
-
-837 i(
- gACL_LIB_DEBUG
-)
-
-838
-tf
-("ACL IPV4 LookuMask A = 0x%"
-PRIx64
-"\n",
-
-839
-lookup_h_mask_v4
-);
-
-840 i(
- gACL_LIB_DEBUG
-)
-
-841
-tf
-("ACL LookuMask A = 0x%"
-PRIx64
-"\n",
-
-842
-lookup_h_mask_v4
-);
-
-844
- glookup_miss_mask_v4
- =
-pkts_mask
- & (~
-lookup_h_mask_v4
-);
-
-845
- gpkts_mask
- =
-lookup_h_mask_v4
-;
-
-846 *
- gpkts_dr_whout_ru
- +
-__but_pcou
-(
-lookup_miss_mask_v4
-);
-
-847 i(
- gACL_LIB_DEBUG
-)
-
-848
-tf
-("pkt_wk_a_keykts_dr: %"
-PRIu64
- "_pkts: %u\n",
-
-849 *
-pkts_dr_whout_ru
-,
-
-850
-__but_pcou
-(
-lookup_miss_mask_v4
-));
-
-852
-ut64_t
-
- gpkts_to_oss
- =
-lookup_h_mask_v4
-;
-
-854 ;
- gpkts_to_oss
-;) {
-
-855
-ut8_t
-
- gpos
- = (ut8_t)
-__but_z
-(
-pkts_to_oss
-);
-
-857
-ut64_t
-
- gpkt_mask
- = 1LLU <<
-pos
-;
-
-859
- gpkts_to_oss
- &~
-pkt_mask
-;
-
-860 
-e_mbuf
- *
- gpkt
- =
-pkts
-[
-pos
-];
-
-864 
-lib_a_b_y
- *
- gy
- =
-
-865 (
-lib_a_b_y
- *)
-
-866
-ib_a
-->
-ib_a_s_v4
-[
-pos
-];
-
-867
-ut16_t
-
- gphy_pt
- =
-y
-->
-hd
-.
-pt_id
-;
-
-868
-ut32_t
-
- gai_id
- =
-y
-->
-ai_id
-;
-
-870 i(
- gACL_LIB_DEBUG
-)
-
-871
-tf
-("ai_id = %u\n",
-ai_id
-);
-
-873
-ut32_t
-
- gds_offt
- =
-IP_START
- +
-IP_HDR_DSCP_OFST
-;
-
-875 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-876
- glib_a_ai_cou
-) {
-
-877
- gp_ai_cou_b
-
-
-878 [
-ib_a
-->
-ai_cou_dex
-]
-
-879 [
-ai_id
-].
- gckCou
-++;
-
-880
- gp_ai_cou_b
-
-
-881 [
-ib_a
-->
-ai_cou_dex
-]
-
-882 [
-ai_id
-].
- gbyCou
- +=
-
-883
-e_pktmbuf_pkt_n
-(
-pkt
-);
-
-884 i(
- gACL_LIB_DEBUG
-)
-
-885
-tf
-("Action Count Packet Count: %"
-
-886
-PRIu64
- " Byte Count: %"
-
-887
-PRIu64
- "\n"
-
-888 ,
-p_ai_cou_b
-
-
-889 [
-ib_a
-->
-ai_cou_dex
-]
-
-890 [
-ai_id
-].
-ckCou
-,
-
-891
-p_ai_cou_b
-
-
-892 [
-ib_a
-->
-ai_cou_dex
-]
-
-893 [
-ai_id
-].
-byCou
-);
-
-896 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-897
- glib_a_ai_ck_dr
-) {
-
-900 i(
- gACL_LIB_DEBUG
-)
-
-901
-tf
-("ACL before dropkt_mask %"
-
-902
-PRIx64
-",kt_num %d\n",
-
-903
-pkts_mask
-,
-pos
-);
-
-904
- gpkts_mask
- &~(1LLU <<
-pos
-);
-
-905 (*
- gpkts_dr_whout_ru
-)++;
-
-906 i(
- gACL_LIB_DEBUG
-)
-
-907
-tf
-("ACL dr݅kt_mask %"
-PRIx64
-
-
-909
-PRIu64
- "\n",
-pkts_mask
-,
-pos
-,
-
-910 *
-pkts_dr_whout_ru
-);
-
-913 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-914
- glib_a_ai_fwd
-) {
-
-915
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-916
-fwd_pt
-;
-
-917
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-918 i(
- gACL_LIB_DEBUG
-)
-
-919
-tf
-("Action FWD Port ID: %"
-
-920
-PRIu16
-"\n",
-phy_pt
-);
-
-923 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-924
- glib_a_ai_t
-) {
-
-925
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-926
-t_pt
-;
-
-927
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-928 i(
- gACL_LIB_DEBUG
-)
-
-929
-tf
-("Action NAT Port ID: %"
-
-930
-PRIu16
-"\n",
-phy_pt
-);
-
-933 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-934
- glib_a_ai_ds
-) {
-
-937
-ut8_t
- *
- gds
- =
-RTE_MBUF_METADATA_UINT8_PTR
-(
-pkt
-,
-
-938
-ds_offt
-);
-
-939 *
- gds
- =
-ai_y_aive
-[
-ai_id
-].
-
-940
-ds_iܙy
- << 2;
-
-941 i(
- gACL_LIB_DEBUG
-)
-
-942
-tf
-("Action DSCP DSCP Priority: %"
-
-943
-PRIu16
- "\n", *
-ds
-);
-
-946 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-947
- glib_a_ai_ck_ac
-) {
-
-948 i(
- gACL_LIB_DEBUG
-)
-
-949
-tf
-("Action Accept\n");
-
-951 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-952 &
- glib_a_ai_cck
-) {
-
-955 *
- gcck_mask
- |
-pkt_mask
-;
-
-956 i(
- gACL_LIB_DEBUG
-)
-
-957
-tf
-("ACL CTnabled: 0x%"
-
-958
-PRIx64
-"kt_mask: 0x%"
-
-959
-PRIx64
-"\n",
-
-960 *
-cck_mask
-,
-
-961
-pkt_mask
-);
-
-964 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-965 &
- glib_a_ai_cxi
-) {
-
-968 *
- gcck_mask
- |
-pkt_mask
-;
-
-974 i(
- gai_y_aive
-[
-ai_id
-].
-
-975
- give_public
- ==
-
-976
-lib_a_public_ive
-)
-
-977 *
-cxi_mask
- |
-pkt_mask
-;
-
-979 i(
- gACL_LIB_DEBUG
-)
-
-980
-tf
-("ACL Connexist ENB CT:0x%"
-
-981
-PRIx64
-" connexist: 0x%"
-
-982
-PRIx64
-"kt_mask: 0x%"
-
-983
-PRIx64
-"\n",
-
-984 *
-cck_mask
-,
-
-985 *
-cxi_mask
-,
-
-986
-pkt_mask
-);
-
-991 
- gpkts_mask
-;
-
-1016
-ut64_t
-
-
-1017
-lib_a_v6_pkt_wk_key
-(
-lib_a
- *
-ib_a
-,
-
-1018 
-e_mbuf
- **
-pkts
-,
-ut64_t
-
-pkts_mask
-,
-
-1019
-ut64_t
- *
-pkts_dr_whout_ru
-,
-
-1020 *
-ib_a_ru_b_v6_aive
-,
-
-1021 
-pe_ai_key
- *
-ai_y_aive
-,
-
-1022 
-ai_cou_block
- (*
-p_ai_cou_b
-)[
-ai_y_max
-],
-
-1023
-ut64_t
- *
-cck_mask
-,
-
-1024
-ut64_t
- *
-cxi_mask
-)
-
-1027
-ut64_t
-
- glookup_h_mask_v6
- = 0;
-
-1028
-ut64_t
-
- glookup_miss_mask_v6
- = 0;
-
-1029 
- gus
-;
-
-1032 i(
- gACL_LIB_DEBUG
-)
-
-1033
-tf
-("ACL IPV6 LookuMask Befܐ0x%"
-PRIx64
-"\n",
-
-1034
-pkts_mask
-);
-
-1035
- gus
- =
-e_b_a_s
-.
-f_lookup
-(
-
-1036
-ib_a_ru_b_v6_aive
-,
-
-1037
-pkts
-,
-pkts_mask
-, &
-lookup_h_mask_v6
-,
-
-1038 (**
-ib_a
-->
-ib_a_s_v6
-);
-
-1039 i(
- gus
- < 0)
-
-1040
-tf
-("Lookup Failed\n");
-
-1041 i(
- gACL_LIB_DEBUG
-)
-
-1042
-tf
-("ACL IPV6 LookuMask A = 0x%"
-PRIx64
-"\n",
-
-1043
-lookup_h_mask_v6
-);
-
-1045 i(
- gACL_LIB_DEBUG
-)
-
-1046
-tf
-("ACL LookuMask A = 0x%"
-PRIx64
-"\n",
-
-1047
-lookup_h_mask_v6
-);
-
-1049
- glookup_miss_mask_v6
- =
-pkts_mask
- & (~
-lookup_h_mask_v6
-);
-
-1050
- gpkts_mask
- =
-lookup_h_mask_v6
-;
-
-1051 *
- gpkts_dr_whout_ru
- +
-__but_pcou
-(
-lookup_miss_mask_v6
-);
-
-1052 i(
- gACL_LIB_DEBUG
-)
-
-1053
-tf
-("pkt_wk_a_keykts_dr: %"
-PRIu64
- "_pkts: %u\n",
-
-1054 *
-pkts_dr_whout_ru
-,
-
-1055
-__but_pcou
-(
-lookup_miss_mask_v6
-));
-
-1057
-ut64_t
-
- gpkts_to_oss
- =
-lookup_h_mask_v6
-;
-
-1059 ;
- gpkts_to_oss
-;) {
-
-1060
-ut8_t
-
- gpos
- = (ut8_t)
-__but_z
-(
-pkts_to_oss
-);
-
-1062
-ut64_t
-
- gpkt_mask
- = 1LLU <<
-pos
-;
-
-1064
- gpkts_to_oss
- &~
-pkt_mask
-;
-
-1065 
-e_mbuf
- *
- gpkt
- =
-pkts
-[
-pos
-];
-
-1068 
-lib_a_b_y
- *
- gy
- =
-
-1069 (
-lib_a_b_y
- *)
-
-1070
-ib_a
-->
-ib_a_s_v6
-[
-pos
-];
-
-1071
-ut16_t
-
- gphy_pt
- =
-y
-->
-hd
-.
-pt_id
-;
-
-1072
-ut32_t
-
- gai_id
- =
-y
-->
-ai_id
-;
-
-1074 i(
- gACL_LIB_DEBUG
-)
-
-1075
-tf
-("ai_id = %u\n",
-ai_id
-);
-
-1077 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-1078
- glib_a_ai_cou
-) {
-
-1079
- gp_ai_cou_b
-
-
-1080 [
-ib_a
-->
-ai_cou_dex
-]
-
-1081 [
-ai_id
-].
- gckCou
-++;
-
-1082
- gp_ai_cou_b
-
-
-1083 [
-ib_a
-->
-ai_cou_dex
-]
-
-1084 [
-ai_id
-].
- gbyCou
- +=
-
-1085
-e_pktmbuf_pkt_n
-(
-pkt
-);
-
-1086 i(
- gACL_LIB_DEBUG
-)
-
-1087
-tf
-("Action Count Packet Count: %"
-
-1088
-PRIu64
- " Byte Count: %"
-
-1089
-PRIu64
- "\n",
-
-1090
-p_ai_cou_b
-
-
-1091 [
-ib_a
-->
-ai_cou_dex
-]
-
-1092 [
-ai_id
-].
-ckCou
-,
-
-1093
-p_ai_cou_b
-
-
-1094 [
-ib_a
-->
-ai_cou_dex
-]
-
-1095 [
-ai_id
-].
-byCou
-);
-
-1098 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-1099
- glib_a_ai_ck_dr
-) {
-
-1101 i(
- gACL_LIB_DEBUG
-)
-
-1102
-tf
-("ACL before dropkt_mask %"
-
-1103
-PRIx64
-",kt_num %d\n",
-
-1104
-pkts_mask
-,
-pos
-);
-
-1105
- gpkts_mask
- &~(1LLU <<
-pos
-);
-
-1106 (*
- gpkts_dr_whout_ru
-)++;
-
-1107 i(
- gACL_LIB_DEBUG
-)
-
-1108
-tf
-("ACL dr݅kt_mask %"
-PRIx64
-
-
-1110
-PRIu64
- "\n",
-pkts_mask
-,
-pos
-,
-
-1111 *
-pkts_dr_whout_ru
-);
-
-1115 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-1116
- glib_a_ai_fwd
-) {
-
-1117
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-1118
-fwd_pt
-;
-
-1119
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-1120 i(
- gACL_LIB_DEBUG
-)
-
-1121
-tf
-("Action FWD Port ID: %"
-
-1122
-PRIu16
-"\n",
-phy_pt
-);
-
-1125 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-1126
- glib_a_ai_t
-) {
-
-1127
- gphy_pt
- =
-ai_y_aive
-[
-ai_id
-].
-
-1128
-t_pt
-;
-
-1129
- gy
-->
- ghd
-.
- gpt_id
- =
-phy_pt
-;
-
-1130 i(
- gACL_LIB_DEBUG
-)
-
-1131
-tf
-("Action NAT Port ID: %"
-
-1132
-PRIu16
-"\n",
-phy_pt
-);
-
-1135 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
- &
-
-1136
- glib_a_ai_ds
-) {
-
-1139
-ut32_t
-
- gds_offt
- =
-IP_START
- +
-
-1140
-IP_HDR_DSCP_OFST_IPV6
-;
-
-1141
-ut16_t
- *
- gds
- =
-RTE_MBUF_METADATA_UINT16_PTR
-(
-
-1142
-pkt
-,
-ds_offt
-);
-
-1143
-ut16_t
-
- gmp
- = *
-ds
-;
-
-1144
-ut16_t
-
- gds_vue
- = (
-e_bsw16
-(
-mp
-) &
-
-1146
-ut8_t
-
- gds_e
- =
-
-1147
-ai_y_aive
-
-
-1148 [
-ai_id
-].
-ds_iܙy
- << 2;
-
-1149
-ut16_t
-
- gds_mp
- =
-ds_e
-;
-
-1151
- gds_mp
- =
-ds_mp
- << 4;
-
-1152 *
- gds
- =
-e_bsw16
-(
-ds_mp
- |
-ds_vue
-);
-
-1153 i(
- gACL_LIB_DEBUG
-)
-
-1154
-tf
-("Action DSCP DSCP Priority: %"
-
-1155
-PRIu16
-"\n", *
-ds
-);
-
-1158 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-1159 &
- glib_a_ai_ck_ac
-) {
-
-1160 i(
- gACL_LIB_DEBUG
-)
-
-1161
-tf
-("Action Accept\n");
-
-1163 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-1164 &
- glib_a_ai_cck
-) {
-
-1167 *
- gcck_mask
- |
-pkt_mask
-;
-
-1168 i(
- gACL_LIB_DEBUG
-)
-
-1169
-tf
-("ACL CTnabled: 0x%"
-
-1170
-PRIx64
-"kt_mask: 0x%"
-
-1171
-PRIx64
-"\n",
-
-1172 *
-cck_mask
-,
-
-1173
-pkt_mask
-);
-
-1176 i(
- gai_y_aive
-[
-ai_id
-].
- gai_bm
-
-
-1177 &
- glib_a_ai_cxi
-) {
-
-1180 *
- gcck_mask
- |
-pkt_mask
-;
-
-1186 i(
- gai_y_aive
-[
-ai_id
-].
-
-1187
- give_public
- ==
-
-1188
-lib_a_public_ive
-)
-
-1189 *
-cxi_mask
- |
-pkt_mask
-;
-
-1191 i(
- gACL_LIB_DEBUG
-)
-
-1192
-tf
-("ACL Connexist ENB CT:0x%"
-
-1193
-PRIx64
-" connexist: 0x%"
-
-1194
-PRIx64
-"kt_mask: 0x%"
-
-1195
-PRIx64
-"\n",
-
-1196 *
-cck_mask
-,
-
-1197 *
-cxi_mask
-,
-
-1198
-pkt_mask
-);
-
-1202 
- gpkts_mask
-;
-
- @VIL/acl/lib_acl.h
-
-17 #ide
-__INCLUDE_ACL_LIB_H__
-
-
-18 
- #__INCLUDE_ACL_LIB_H__
-
-
- )
-
-20 
- ~<dlib.h
->
-
-21 
- ~<rg.h
->
-
-22 
- ~<ys.h
->
-
-23 
- ~<e_pe.h
->
-
-24 
- ~<e_b_a.h
->
-
-25 
- ~"e_xn_ackg.h
-"
-
-26 
- ~"e__t.h
-"
-
-28 
- #lib_a_ai_ck_dr
- 1
-
- )
-
-29 
- #lib_a_ai_ck_ac
- 2
-
- )
-
-30 
- #lib_a_ai_t
- 4
-
- )
-
-31 
- #lib_a_ai_fwd
- 8
-
- )
-
-32 
- #lib_a_ai_cou
- 16
-
- )
-
-33 
- #lib_a_ai_ds
- 32
-
- )
-
-34 
- #lib_a_ai_cck
- 64
-
- )
-
-35 
- #lib_a_ai_cxi
- 128
-
- )
-
-36 
- #ai_y_max
- 10000
-
- )
-
-37 
- #lib_a_ive_public
- 0
-
- )
-
-38 
- #lib_a_public_ive
- 1
-
- )
-
-39 
- #IP_HDR_DSCP_OFST
- 1
-
- )
-
-40 
- #IPv4_HDR_VERSION
- 4
-
- )
-
-41 
- #IPv6_HDR_VERSION
- 6
-
- )
-
-42 
- #IP_HDR_DSCP_OFST_IPV6
- 0
-
- )
-
-43 
- #IP_VERSION_CHECK
- 4
-
- )
-
-44 
- #IP_START
- (
-MBUF_HDR_ROOM
- +
-ETH_HDR_SIZE
-)
-
- )
-
-45 
- #DEFULT_NUM_RULE
- (4*1024)
-
- )
-
-49 
- spe_ai_key
- {
-
-50
-ut32_t
-
- mai_id
-;
-
-51
-ut32_t
-
- mai_bm
-;
-
-52
-ut32_t
-
- mt_pt
-;
-
-53
-ut32_t
-
- mfwd_pt
-;
-
-54
-ut8_t
-
- mds_iܙy
-;
-
-55
-ut8_t
-
- mive_public
-;
-
-56 }
- g__e_che_igd
-;
-
-62 
- sai_cou_block
- {
-
-63
-ut64_t
-
- mbyCou
-;
-
-64
-ut64_t
-
- mckCou
-;
-
-65 }
- g__e_che_igd
-;
-
-70 
- slib_a_b_y
- {
-
-71 
-e_pe_b_y
-
- mhd
-;
-
-72
-ut32_t
-
- mai_id
-;
-
-76 
- slib_a
- {
-
-77
-ut32_t
-
- mn_rus
-;
-
-78
-ut32_t
-
- mn_ru_flds
-;
-
-79 
-e_a_fld_def
- *
- mfld_fm
-;
-
-80
-ut32_t
-
- mfld_fm_size
-;
-
-81 
- mai_cou_dex
-;
-
-82 
-lib_a_b_y
-
-
-83 *
- mib_a_s_v4
-[
-RTE_PORT_IN_BURST_SIZE_MAX
-];
-
-84 
-lib_a_b_y
-
-
-85 *
- mib_a_s_v6
-[
-RTE_PORT_IN_BURST_SIZE_MAX
-];
-
-86 }
- g__e_che_igd
-;
-
-88 *
-lib_a__aive_dby_b_v4
-(
-ut8_t
-
-b_num
-,
-
-89
-ut32_t
- *
-liba_n_rus
-);
-
-91 *
-lib_a__aive_dby_b_v6
-(
-ut8_t
-
-b_num
-,
-
-92
-ut32_t
- *
-liba_n_rus
-);
-
-93 
-lib_a_r_cfig
-(
-lib_a
- *
-ib_a
-,
-
-94 *
-g_me
-, *
-g_vue
-,
-
-95
-ut32_t
- *
-liba_n_rus
-);
-
-96
-ut64_t
-
-
-97
-lib_a_pkt_wk_key
-(
-lib_a
- *
-ib_a
-,
-
-98 
-e_mbuf
- **
-pkts
-,
-ut64_t
-
-pkts_mask
-,
-
-99
-ut64_t
- *
-pkts_dr_whout_ru
-,
-
-100 *
-ib_a_ru_b_v4_aive
-,
-
-101 *
-ib_a_ru_b_v6_aive
-,
-
-102 
-pe_ai_key
- *
-ai_y_aive
-,
-
-103 
-ai_cou_block
- (*
-p_ai_cou_b
-)[
-ai_y_max
-],
-
-104
-ut64_t
- *
-cck_mask
-,
-
-105
-ut64_t
- *
-cxi_mask
-,
-
-106 
-lib_a_v4_abd
-, 
-lib_a_v6_abd
-);
-
-107
-ut64_t
-
-
-108
-lib_a_v4_pkt_wk_key
-(
-lib_a
- *
-ib_a
-,
-
-109 
-e_mbuf
- **
-pkts
-,
-ut64_t
-
-pkts_mask
-,
-
-110
-ut64_t
- *
-pkts_dr_whout_ru
-,
-
-111 *
-ib_a_ru_b_v4_aive
-,
-
-112 
-pe_ai_key
- *
-ai_y_aive
-,
-
-113 
-ai_cou_block
- (*
-p_ai_cou_b
-)[
-ai_y_max
-],
-
-114
-ut64_t
- *
-cck_mask
-,
-
-115
-ut64_t
- *
-cxi_mask
-);
-
-116
-ut64_t
-
-
-117
-lib_a_v6_pkt_wk_key
-(
-lib_a
- *
-ib_a
-,
-
-118 
-e_mbuf
- **
-pkts
-,
-ut64_t
-
-pkts_mask
-,
-
-119
-ut64_t
- *
-pkts_dr_whout_ru
-,
-
-120 *
-ib_a_ru_b_v6_aive
-,
-
-121 
-pe_ai_key
- *
-ai_y_aive
-,
-
-122 
-ai_cou_block
- (*
-p_ai_cou_b
-)[
-ai_y_max
-],
-
-123
-ut64_t
- *
-cck_mask
-,
-
-124
-ut64_t
- *
-cxi_mask
-);
-
- @VIL/alg/lib_ftp_alg.c
-
-16 
- ~<dio.h
->
-
-17 
- ~<dlib.h
->
-
-18 
- ~<dt.h
->
-
-19 
- ~<rg.h
->
-
-20 
- ~<unid.h
->
-
-22 
- ~<p.h
->
-
-23 
- ~<e_comm.h
->
-
-24 
- ~<e_mloc.h
->
-
-25 
- ~<e_mbuf.h
->
-
-26 
- ~<e_.h
->
-
-27 
- ~<e_byd.h
->
-
-28 
- ~<e_b_m.h
->
-
-29 
- ~<e_b_hash.h
->
-
-30 
- ~<e_pe.h
->
-
-31 
- ~<e_p.h
->
-
-32 
- ~<e_icmp.h
->
-
-33 
- ~<e_hash.h
->
-
-34 
- ~<e_jhash.h
->
-
-35 
- ~<e_cyes.h
->
-
-36 
- ~"pe_cgDZ_comm.h
-"
-
-37 
- ~"pe_ais_comm.h
-"
-
-38 
- ~"pe_cgDZ_be.h
-"
-
-39 
- ~"hash_func.h
-"
-
-40 
- ~"lib_p_g.h
-"
-
-41 
- ~"vnf_comm.h
-"
-
-42 
- ~"pe_comm_be.h
-"
-
-43 
- ~"e__t.h
-"
-
-44 
- ~"e_xn_ackg.h
-"
-
-45 
- #ALG_DEBUG
- 1
-
- )
-
-48
-ut8_t
-
-
-49
-e___xn_hashkey
-(
-
-50
-ut32_t
- *
-c_addr
-,
-
-51
-ut32_t
- *
-d_addr
-,
-
-52
-ut16_t
-
-c_pt
-,
-
-53
-ut16_t
-
-d_pt
-,
-
-54
-ut8_t
-
-o
-,
-
-55
-ut32_t
- *
-key
-,
-
-56
-ut8_t
-
-ty
-);
-
-59 
-e_mbuf
- *
- glib_g_pkt
-;
-
-60 um {
- mPRIVATE
-,
- mPUBLIC
-};
-
-61 
-e_hash_ms
-
- gp_g_hash_ms
- = {
-
-62 .
-me
- = "FTP ALG",
-
-63 .
- gs
- = 1024,
-
-64 .
- grved
- = 0,
-
-65 .
- gkey_n
- = (
-p_g_key
-),
-
-66 .
- ghash_func
- =
-e_jhash
-,
-
-67 .
- ghash_func__v
- = 0,
-
-70 
-e_hash
- *
- gp_g_hash_hd
-;
-
-75 
- $lib_p_g_
-()
-
-77
- `tf
-("NAT FTP ALG initialization ...\n");
-
-81
-p_g_hash_hd
- =
- `e_hash_
-(&
-p_g_hash_ms
-);
-
-83 #ifde
-ALGDBG
-
-
-84 i(
-p_g_hash_hd
- =
-NULL
-)
-
-85
- `tf
-("FTP ALGte_hash_create failed ...\n");
-
-87
- `tf
-("ftp_alg_hash_table %p\n\n",
-
-88 (*)
-p_g_hash_hd
-);
-
-91
- }
-}
-
-99 
-p_g_b_y
- *
- $ve_p_g_y
-(
-p_g_key
-
-g_key
-)
-
-101 
-p_g_b_y
- *
-t_g_da
- =
-NULL
-;
-
-102
-g_key
-.
-fr1
- = 0;
-
-103
-g_key
-.
-fr2
- = 0;
-
-105 
-t
- =
- `e_hash_lookup_da
-(
-p_g_hash_hd
-, &
-g_key
-,
-
-106 (**)&
-t_g_da
-);
-
-107 i(
-t
- < 0) {
-
-108 #ifde
-ALGDBG
-
-
-109
- `tf
-("alg-hashookup failedet %d, EINVAL %d, ENOENT %d\n",
-
-110
-t
-,
-EINVAL
-,
-ENOENT
-);
-
-113 
-t_g_da
-;
-
-116 
-NULL
-;
-
-117
- }
-}
-
-124 
- $move_p_g_y
-(
-ut32_t
-
-addr
-,
-ut8_t
-
-ptid
-)
-
-129 
-p_g_key
-
-g_key
-;
-
-130
-g_key
-.
-l4pt
- =
- `e_bsw16
-(
-ptid
-);
-
-131
-g_key
-.
-_addss
- =
- `e_bsw32
-(
-addr
-);
-
-132
-g_key
-.
-fr1
- = 0;
-
-133
-g_key
-.
-fr2
- = 0;
-
-135 #ifde
-ALGDBG
-
-
-136
- `tf
-("move_g_y i%x,܈%d\n",
-g_key
-.
-_addss
-,
-
-137
-g_key
-.
-l4pt
-);
-
-139 
- `e_hash_d_key
-(
-p_g_hash_hd
-, &
-g_key
-);
-
-140
- }
-}
-
-147
- $puϋ_p_g_y
-(
-ut32_t
-
-addr
-,
-ut8_t
-
-ptid
-)
-
-151 
-p_g_key
-
-g_key
-;
-
-152
-g_key
-.
-l4pt
- =
- `e_bsw16
-(
-ptid
-);
-
-154
-g_key
-.
-_addss
- =
- `e_bsw32
-(
-addr
-);
-
-155
-g_key
-.
-fr1
- = 0;
-
-156
-g_key
-.
-fr2
- = 0;
-
-161 #ifde
-ALGDBG
-
-
-162
- `tf
-("puϋ_p_g_y i%x,܈%d\n",
-g_key
-.
-_addss
-,
-
-163
-g_key
-.
-l4pt
-);
-
-166 
-p_g_b_y
- *
-w_g_da
- =
-
-167
- `ve_p_g_y
-(
-g_key
-);
-
-168 i(
-w_g_da
-) {
-
-169 #ifde
-ALGDBG
-
-
-170
- `tf
-("g_yxi%x,܈%d\n",
-g_key
-.
-_addss
-,
-
-171
-g_key
-.
-l4pt
-);
-
-176
-w_g_da
- = (
-p_g_b_y
- *)
-
-177
- `mloc
-((
-w_g_da
-));
-
-179
-w_g_da
-->
-l4pt
- =
- `e_bsw16
-(
-ptid
-);
-
-180
-w_g_da
-->
-_addss
- =
- `e_bsw32
-(
-addr
-);
-
-181
- `e_hash_add_key_da
-(
-p_g_hash_hd
-, &
-g_key
-,
-w_g_da
-);
-
-183 #ifde
-ALGDBG
-
-
-185
-tf
-
-
-187 (
-g_key
-.
-_addss
- >> 24),
-
-188 ((
-g_key
-.
-_addss
- & 0x00ff0000) >> 16),
-
-189 ((
-g_key
-.
-_addss
- & 0x0000ff00) >> 8),
-
-190 ((
-g_key
-.
-_addss
- & 0x000000ff)),
-ptid
-);
-
-192
- `puts
-("");
-
-194
- }
-}
-
-202 
- $p_g_modify_yld
-(
-
-203 
-cgDZ_b_y
- *
-egss_y
-,
-
-204 *
-pt_rg
-,
-
-205 *
-pt_rg_ed
-, 
-p_ssi_ty
-)
-
-207
-ut32_t
-
-t_
-;
-
-208
-ut16_t
-
-t_pt
-;
-
-209
-ut16_t
-
-tmp1
-,
-tmp2
-,
-tmp3
-,
-tmp4
-,
-tmp5
-,
-tmp6
-;
-
-210
-ut16_t
-
-w_pt_rg_ngth
-;
-
-212
-ut8_t
- *
-br_public_addss
-;
-
-214
-t_
- =
-egss_y
-->
-da
-.
-pub_
-;
-
-215
-t_pt
- =
-egss_y
-->
-da
-.
-pub_pt
-;
-
-216
-tmp5
- = (
-ut16_t
-(
-t_pt
-/0x100);
-
-217
-tmp6
- = (
-ut16_t
-(
-t_pt
- % 0x100);
-
-219
-t_
- =
- `e_bsw32
-(transport_ip);
-
-221
-br_public_addss
- = (
-ut8_t
- *&
-t_
-;
-
-223
-tmp4
- =
-br_public_addss
-[3];
-
-224
-tmp3
- =
-br_public_addss
-[2];
-
-225
-tmp2
- =
-br_public_addss
-[1];
-
-226
-tmp1
- =
-br_public_addss
-[0];
-
-228 i(
-p_ssi_ty
- == 1)
-
-229
- `rtf
-(
-pt_rg_ed
-,
-FTP_PASV_PARAMETER_STRING
-,
-
-230
-FTP_PASV_RETURN_CODE
-,
-tmp1
-,
-tmp2
-,
-tmp3
-,
-tmp4
-,
-
-231
-tmp5
-,
-tmp6
-);
-
-233
- `rtf
-(
-pt_rg_ed
-,
-FTP_PORT_PARAMETER_STRING
-,
-
-234
-tmp1
-,
-tmp2
-,
-tmp3
-,
-tmp4
-,
-tmp5
-,
-tmp6
-);
-
-235 #ifde
-ALGDBG
-
-
-236
- `tf
-("FTP ALG: FTPew string: Len:%d %s\n",
-
-237 (
-ut16_t
-
- `
-(
-pt_rg_ed
-)-2,
-
-238
-pt_rg_ed
-);
-
-240
- `tf
-("FTPonranslated PASV string: Len:%d, %s\n",
-
-241 (
-ut16_t
-)
- `
-(
-pt_rg
-)-2,ort_string);
-
-242
- `tf
-("old strlen:%dew strlen:%d\n",
-
-243 ()
- `
-(
-pt_rg
-),
-
-244 ()
- `
-(
-pt_rg_ed
-));
-
-247 (
-w_pt_rg_ngth
- =
-
-248 (
-ut16_t
-
- `
-(
-pt_rg_ed
-));
-
-249
- }
-}
-
-256 
-le
- 
- $p_g_modify_pkt_n
-(
-e_mbuf
- *
-pkt
-)
-
-258
-ut16_t
-
-pkt_ngth
- = 0;
-
-259 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-pkt
-);
-
-260 *
-hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-262 i(
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-) {
-
-263 
-v4_hdr
- *
-ihdr4
- = (v4_hd*)
-hdr
-;
-
-264
-pkt_ngth
- =
- `e_bsw16
-(
-ihdr4
-->
-tٮ_ngth
-+
-ETH_HDR_SIZE
-;
-
-265 } i(
-_hdr_size_bys
- =
-IPv6_HEADER_SIZE
-) {
-
-266 
-v6_hdr
- *
-ihdr6
- = (v6_hd*)
-hdr
-;
-
-267
-pkt_ngth
- =
- `e_bsw16
-(
-ihdr6
-->
-yld_n
-) +
-
-268
-IPv6_HEADER_SIZE
- +
-ETH_HDR_SIZE
-;
-
-271
-ut16_t
-
-mbuf_pkt_ngth
- =
- `e_pktmbuf_pkt_n
-(
-pkt
-);
-
-273 i(
-pkt_ngth
- =
-mbuf_pkt_ngth
-)
-
-276 i(
-pkt_ngth
- <
-mbuf_pkt_ngth
-) {
-
-277
- `e_pktmbuf_im
-(
-pkt
-,
-mbuf_pkt_ngth
- -
-pkt_ngth
-);
-
-282
- `e_pktmbuf_nd
-(
-pkt
-,
-pkt_ngth
- -
-mbuf_pkt_ngth
-);
-
-283
- }
-}
-
-292
-ut16_t
-
- $p_g_g_IP_hdr_size
-(
-e_mbuf
- *
-pkt
-)
-
-298
-ut8_t
-
-hdr_chk
- =
- `RTE_MBUF_METADATA_UINT8
-(
-pkt
-,
-IP_START
-);
-
-299
-hdr_chk
- = hdr_chk >> 4;
-
-301 i(
-hdr_chk
- =
-IP_VERSION_4
-)
-
-302 
-IPv4_HEADER_SIZE
-;
-
-303 i(
-hdr_chk
- =
-IP_VERSION_6
-)
-
-304 
-IPv6_HEADER_SIZE
-;
-
-308
- }
-}
-
-316 
- $p_g_compu_checksums
-(
-
-317 *
-i_hdr
-,
-
-318 
-t_hdr
- *
-t_hdr
-)
-
-328
-t8_t
-
-hdr_chk
- =
- `e__vsi
-(
-i_hdr
-);
-
-329
-t_hdr
-->
-cksum
- = 0;
-
-331 i(
-hdr_chk
- =
-IP_VERSION_4
-) {
-
-332 
-v4_hdr
- *
-i4_hdr
- = (v4_hd*)
-i_hdr
-;
-
-333
-i4_hdr
-->
-hdr_checksum
- = 0;
-
-334
-t_hdr
-->
-cksum
- = 0;
-
-335
-t_hdr
-->
-cksum
- =
- `e_v4_ud_cksum
-(
-i4_hdr
-,_hdr);
-
-337 #ifde
-ALGDBG
-
-
-338
- `tf
-("cksum %x\n",
- `e_bsw32
-(
-t_hdr
-->
-cksum
-));
-
-341
-i4_hdr
-->
-hdr_checksum
- =
- `e_v4_cksum
-(i4_hdr);
-
-342 } i(
-hdr_chk
- =
-IP_VERSION_6
-) {
-
-343 
-v6_hdr
- *
-i6_hdr
- = (v6_hd*)
-i_hdr
-;
-
-344
-t_hdr
-->
-cksum
- = 0;
-
-345
-t_hdr
-->
-cksum
- =
- `e_v6_ud_cksum
-(
-i6_hdr
-,_hdr);
-
-347
- }
-}
-
-356 
- $p_g_adju_t_ack
-(
-e_mbuf
- *
-pkt
-,
-t16_t
-
-ackSeqdiff
-)
-
-359
-ut16_t
-
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-;
-
-360 
-v4_hdr
- *
-hdr
- = (ipv4_hdr *)
-
-361
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-362 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-363
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-364
-IP_START
- +
-_hdr_size_bys
-);
-
-369
-ut32_t
-
-mp
-;
-
-370
-mp
- =
- `e_bsw32
-(
-thdr
-->
-cv_ack
-);
-
-372 i(
-ackSeqdiff
- < 0)
-
-373
-mp
- +
- `abs
-(
-ackSeqdiff
-);
-
-375
-mp
- -
- `abs
-(
-ackSeqdiff
-);
-
-377
-thdr
-->
-cv_ack
- =
- `e_bsw32
-(
-mp
-);
-
-378
- }
-}
-
-386 
- $p_g_adju_t_q
-(
-e_mbuf
- *
-pkt
-,
-t16_t
-
-ackSeqdiff
-)
-
-389
-ut16_t
-
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-;
-
-390 
-v4_hdr
- *
-hdr
- = (ipv4_hdr *)
-
-391
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-392 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-393
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-394
-IP_START
- +
-_hdr_size_bys
-);
-
-395
-ut32_t
-
-mp
-;
-
-397
-mp
- =
- `e_bsw32
-(
-thdr
-->
-_q
-);
-
-398 i(
-ackSeqdiff
- < 0)
-
-399
-mp
- -
- `abs
-(
-ackSeqdiff
-);
-
-401
-mp
- +
- `abs
-(
-ackSeqdiff
-);
-
-403
-thdr
-->
-_q
- =
- `e_bsw32
-(
-mp
-);
-
-404
- }
-}
-
-414 
- $p_g_d_t_qu
-(
-
-415 
-e_mbuf
- *
-pkt
-,
-
-416 *
-pt_rg
-,
-
-417
-t16_t
-
-exig_tSeqdiff
-,
-
-418
-ut16_t
-
-d_pt_rg_ngth
-,
-
-419
-ut16_t
-
-w_pt_rg_ngth
-)
-
-421
-t16_t
-
-cut_qu_numb_d
-=0;
-
-422
-t16_t
-
-f_qu_numb_d
-;
-
-424
-ut16_t
-
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-;
-
-425 
-v4_hdr
- *
-hdr
- = (ipv4_hdr *)
-
-426
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-427 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-428
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-429
-IP_START
- +
-_hdr_size_bys
-);
-
-434
-cut_qu_numb_d
- = (
-t16_t
-(
-w_pt_rg_ngth
- -
-
-435
-d_pt_rg_ngth
-);
-
-436
-hdr
-->
-tٮ_ngth
- =
- `e_bsw16
-(iphdr->total_length);
-
-438 #ifde
-ALGDBG
-
-
-439
- `tf
-("tٮ_ngth :%u\n",
-hdr
-->
-tٮ_ngth
-);
-
-441 if(
-cut_qu_numb_d
- < 0)
-
-442
-hdr
-->
-tٮ_ngth
- -
- `abs
-(
-cut_qu_numb_d
-);
-
-444
-hdr
-->
-tٮ_ngth
- +
-cut_qu_numb_d
-;
-
-446
-hdr
-->
-tٮ_ngth
- =
- `e_bsw16
-(iphdr->total_length);
-
-447 i(
-exig_tSeqdiff
- !=0)
-
-448
- `p_g_adju_t_q
-(
-pkt
-,
-exig_tSeqdiff
-);
-
-449
-f_qu_numb_d
-
-cut_qu_numb_d
- +
-exig_tSeqdiff
-;
-
-450 
-f_qu_numb_d
-;
-
-451
- }
-}
-
-462 
- $p_g_dpi
-(
-
-463 
-pe_cgDZ
- *
-p_t
-,
-
-464 
-pe_cgDZ_y_key
- *
-t_y_key
-,
-
-465 
-e_mbuf
- *
-pkt
-,
-
-466 
-e__xn_ack
- *
-cgt_xn_ack
-,
-
-467
-t32_t
-
-_posi
-,
-
-468
-ut8_t
-
-dei
-)
-
-476 *
-pt_cmd_rg
-;
-
-477 *
-pt_cmd_d_rg
-;
-
-478 *
-t_hd_d
-;
-
-479 *
-t_t
-;
-
-482
-ut16_t
-
-ive_pt_numb
-;
-
-483
-ut16_t
-
-public_pt_numb
-;
-
-484
-ut16_t
-
-1
-,
-2
-,
-3
-,
-4
-,
-pt1
-,
-pt2
-;
-
-485
-t16_t
-
-tSeqdiff
-;
-
-486
-t16_t
-
-ackSeqdiff
-,
-ackAdju
-;
-
-487
-ut32_t
-
-ive_addss
-;
-
-488
-ut32_t
-
-public_addss
-;
-
-489
-ut8_t
- *
-br_ive_addss
-;
-
-491 
-pt_rg
-[
-FTP_MAXIMUM_PORT_STRING_LENGTH
-];
-
-492 
-pt_rg_ed
-[
-FTP_MAXIMUM_PORT_STRING_LENGTH
-];
-
-493
-t16_t
-
-w_pt_rg_ngth
-;
-
-494
-t16_t
-
-d_pt_rg_ngth
-;
-
-495 
-dummy_vue
-;
-
-496 
-cgDZ_b_y
- *
-egss_y
-, *
-gss_y
-;
-
-497
-ut32_t
-
-_key
-[10];
-
-498
-ut8_t
-
-key_dei
-;
-
-500
-ut16_t
-
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-;
-
-502 
-v4_hdr
- *
-_hdr
- =
- `e_pktmbuf_mtod_offt
-(
-pkt
-,
-
-503 
-v4_hdr
- *, (
-h_hdr
-));
-
-507 
-t_hdr
- *
-thdr
- =
- `e_pktmbuf_mtod_offt
-(
-pkt
-, tcp_hdr *,
-
-508 ((
-h_hdr
-)+(
-v4_hdr
-)));
-
-509
-ut16_t
-
-c_pt
- =
- `e_bsw16
-(
-thdr
-->src_port);
-
-510
-ut16_t
-
-d_pt
- =
- `e_bsw16
-(
-thdr
-->dst_port);
-
-511
-ut8_t
-
-o
- =
-_hdr
-->
-xt_o_id
-;
-
-512
-ut32_t
-
-c_addr
- =
- `e_bsw32
-(
-_hdr
-->src_addr);
-
-513
-ut32_t
-
-d_addr
- =
- `e_bsw32
-(
-_hdr
-->dst_addr);
-
-514
-ut32_t
-
-tmp_t_ylod_size
-;
-
-517 -
-c_pt
- &
-d_pt
-
-checkg
-
-to
-
-be
-
-moved
-
-om
-
-cgt
-
-dpi
-
-
-518 -
-F
-
-cڌ
-
-chl
-
-
-519
-f
-
-vidi
-
-of
-
-tSeqdiff
-
-to
-
-be
-
-checked
-
-
-520
-IF
- < > 0
-
-521
- `p_g_t_ack
-(
-to
-
-be
-
- `ed
-(
-this
-
-udes
-
-PORT
-
-
-522
-
-d
-
-PASV
-eڣ
-ack
-
-as
-
-wl
-)
-
-523
-Ru
-
-
-524
-ELSE
-
-
-525
-the
-
-pt
-/
-sv
-
-mr
-
-checkign
-
-to
-
-be
-
-de
-
-
-526 -
-F
-
-da
-
-chl
-
-
-527 -
-eive
-
-ALG
-
-y
-
-
-528
-IF
-
-found
-
-
-529 -
-move
-
-the
-
-ALG
-
-y
-
-
-530
-ev
- 
-n
-
- `found
-(
-found
-
-s
-
-too
-)
-
-531 -
-t
-
-the
-
-byss
-
-ag
-
-
-h
-CT
-
-ssi
-
-b
-
-
-535 #ifde
-ALGDBG
-
-
-537
- `tf
-("p܈numb: %d, %d\n",
-c_pt
-,
-d_pt
-);
-
-538
- `tf
-("ftp TCP sequm diff: %d\n",
-
-539
-cgt_xn_ack
-->
-hash_b_s
-[
-
-540
-_posi
-].
-tSeqdiff
-);
-
-541
- `tf
-("tcp data offset: %d\n",
-
-542 ((
-thdr
-->
-da_off
- & 0xf0) >> 2));
-
-543
- `tf
-("osi idpi:%d\n",
-_posi
-);
-
-547 i(
-c_pt
- =21 ||
-d_pt
- == 21) {
-
-556
-t_t
- = (*)
-thdr
-;
-
-559
-pt_cmd_rg
- = (* )(
-t_t
-+((
-thdr
-->
-da_off
- & 0xf0) >> 2));
-
-560
-t_hd_d
- =
-pt_cmd_rg
-;
-
-562 i(
-dei
- =
-PRIVATE
-) {
-
-564 #ifde
-ALGDBG
-
-
-565
- `tf
-("In PRIVATE ");
-
-568
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-q_
-
-
-569
- `e_bsw32
-(
-thdr
-->
-_q
-);
-
-570
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-ack_
-
-
-571
- `e_bsw32
-(
-thdr
-->
-cv_ack
-);
-
-572 #ifde
-ALGDBG
-
-
-573
- `tf
-("-->Seq_cli:%u, Ack_cli:%u, Len:%4d\n",
-
-574
- `e_bsw32
-(
-thdr
-->
-_q
-),
-
-575
- `e_bsw32
-(
-thdr
-->
-cv_ack
-),
-
-576 (
- `e_bsw16
-(
-_hdr
-->
-tٮ_ngth
-) -
-
-577 (((
-thdr
-->
-da_off
- & 0xf0) >> 4) * 4)) - 20);
-
-581 #ifde
-ALGDBG
-
-
-582
- `tf
-("In PUBLIC ");
-
-584
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-q_rv
-
-
-585
- `e_bsw32
-(
-thdr
-->
-_q
-);
-
-586
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-ack_rv
-
-
-587
- `e_bsw32
-(
-thdr
-->
-cv_ack
-);
-
-588 #ifde
-ALGDBG
-
-
-589
- `tf
-("<--Seq_cli:%4d, Ack_cli%4d, Len:%4d\n",
-
-590
- `e_bsw32
-(
-thdr
-->
-_q
-),_bsw32hdr->
-cv_ack
-),
-
-591 (
-_hdr
-->
-tٮ_ngth
- - (((
-thdr
-->
-da_off
- & 0xf0) >> 2))
-
-596 i(
- `ssnf
-(
-pt_cmd_rg
-,
-FTP_PASV_PARAMETER_STRING
-, &
-dummy_vue
-,
-
-597 &
-1
-, &
-2
-, &
-3
-, &
-4
-, &
-pt1
-, &
-pt2
-) ==
-
-598
-FTP_PASV_PARAMETER_COUNT
-){
-
-600
- `rtf
- (
-pt_rg
-,
-FTP_PASV_PARAMETER_STRING
-,
-FTP_PASV_RETURN_CODE
-,
-
-601
-1
-,
-2
-,
-3
-,
-4
-,
-pt1
-,
-pt2
-);
-
-603 
-i
- = 0;
-
-604 
-pt_cmd_rg
-[
-i
-] != '\r' &&ort_cmd_string[i+1] != '\n')
-
-605
-i
-++;
-
-607
-i
- += 2;
-
-609
-d_pt_rg_ngth
- =
-i
-;
-
-611
-ive_pt_numb
- = (
-ut16_t
-(
-pt1
- * 0x100 +
-pt2
-);
-
-612
-br_ive_addss
- = (
-ut8_t
- *&
-ive_addss
-;
-
-614
-br_ive_addss
-[3] = (
-ut8_t
-(
-4
- & 0x00FF);
-
-615
-br_ive_addss
-[2] = (
-ut8_t
-(
-3
- & 0x00FF);
-
-616
-br_ive_addss
-[1] = (
-ut8_t
-(
-2
- & 0x00FF);
-
-617
-br_ive_addss
-[0] = (
-ut8_t
-(
-1
- & 0x00FF);
-
-621 i(
-dei
- =
-PUBLIC
-) {
-
-628
- `puϋ_p_g_y
-(
-ive_addss
-,
-ive_pt_numb
-);
-
-634
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-635
-rv_dei
- =
-SERVER_IN_PUBLIC
-;
-
-636
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-637
-p_ssi_ty
-= 1;
-
-638 } i(
-dei
- =
-PRIVATE
-) {
-
-641 
-pe_cgDZ_y_key
-
-da_chl_key
-;
-
-642
-ive_addss
- =
- `e_bsw32
-(private_address);
-
-643
-da_chl_key
-.
-
- =
-ive_addss
-;
-
-644
-da_chl_key
-.
-pt
- =
-ive_pt_numb
-;
-
-646
-da_chl_key
-.
-pid
- =
-pkt
-->
-pt
-;
-
-653 #ifde
-FTP_ALG
-
-
-654 i(
- `add_dymic_cgDZ_y_g
-((
-pe
- *)
-p_t
-,
-
-655 &
-da_chl_key
-, &
-egss_y
-, &
-gss_y
-) == 0){
-
-657 #ifde
-ALGDBG
-
-
-658
- `tf
-("Wrong FTP ALGacket\n");
-
-662
-p_t
-->
-DZDrݳdPktCou
-++;
-
-664 #ifde
-CGNAPT_DEBUGGING
-
-
-665
-p_t
-->
-DZDrݳdPktCou4
-++;
-
-671
-tmp_t_ylod_size
- =
- `e_bsw16
-(
-_hdr
-->
-tٮ_ngth
-) -
-
-672 ((
-thdr
-->
-da_off
- & 0xf0>> 2-
-_hdr_size_bys
-;
-
-673
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-674
-t_yld_size
- =
-tmp_t_ylod_size
-;
-
-677
- `puϋ_p_g_y
-(
-egss_y
-->
-da
-.
-pub_
-,
-
-678
-egss_y
-->
-da
-.
-pub_pt
-);
-
-680
-w_pt_rg_ngth
- =
- `p_g_modify_yld
-(
-egss_y
-,
-
-681
-pt_rg
-,
-
-682
-pt_rg_ed
-, 1);
-
-683
- `y
-(
-t_hd_d
-,
-pt_rg_ed
-,
-
-684
- `
-(
-pt_rg_ed
-));
-
-685
-tSeqdiff
- =
- `p_g_d_t_qu
-
-pkt
-,
-pt_rg
-,
-
-686
-cgt_xn_ack
-->
-hash_b_s
-
-
-687 [
-_posi
-].
-tSeqdiff
-,
-
-688
-d_pt_rg_ngth
-,
-
-689
-w_pt_rg_ngth
-);
-
-692
- `p_g_modify_pkt_n
-(
-pkt
-);
-
-699
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-700
-g_byss_ag
- =
-NO_BYPASS
-;
-
-701
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-702
-tSeqdiff
- =cpSeqdiff;
-
-703
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-704
-rv_dei
- =
-SERVER_IN_PRIVATE
-;
-
-705
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-706
-p_ssi_ty
- = 1;
-
-710 } i(
- `ssnf
-(
-pt_cmd_rg
-,
-FTP_PORT_PARAMETER_STRING
-,
-
-711 &
-1
-, &
-2
-, &
-3
-, &
-4
-, &
-pt1
-, &
-pt2
-) ==
-
-712
-FTP_PORT_PARAMETER_COUNT
-){
-
-714 
-i
- = 0;
-
-715 
-ut8_t
-
-pt_h
-;
-
-716 
-pt_cmd_rg
-[
-i
-] != '\r' &&
-
-717
-pt_cmd_rg
-[
-i
-+1] != '\n')
-
-718
-i
-++;
-
-720
-i
- += 2;
-
-722
-d_pt_rg_ngth
- =
-i
-;
-
-724 #ifde
-ALGDBG
-
-
-725
- `tf
-" Exig Seq Dif%d",
-cgt_xn_ack
-->
-
-726
-hash_b_s
-[
-_posi
-].
-tSeqdiff
-);
-
-727
- `tf
-("FTP ALG: FTP PORT commandength: %d\n",
-
-728
-d_pt_rg_ngth
-);
-
-731
-ive_pt_numb
- = (
-ut16_t
-(
-pt1
- * 0x100 +
-pt2
-);
-
-733 #ifde
-ALGDBG
-
-
-734
- `tf
-("FTP ALG:rivateortumber before swap: %u\n",
-
-735
-ive_pt_numb
-);
-
-738
-br_ive_addss
- = (
-ut8_t
- *&
-ive_addss
-;
-
-739
-br_ive_addss
-[3] = (
-ut8_t
-(
-4
- & 0x00FF);
-
-740
-br_ive_addss
-[2] = (
-ut8_t
-(
-3
- & 0x00FF);
-
-741
-br_ive_addss
-[1] = (
-ut8_t
-(
-2
- & 0x00FF);
-
-742
-br_ive_addss
-[0] = (
-ut8_t
-(
-1
- & 0x00FF);
-
-744
- `rtf
-(
-pt_rg
-,
-FTP_PORT_PARAMETER_STRING
-,
-1
-,
-2
-,
-
-745
-3
-,
-4
-,
-pt1
-,
-pt2
-);
-
-747 #ifde
-ALGDBG
-
-
-748
- `tf
-("FTP ALG: FTP original PORT string: %d,%s\n",
-
-749 (
- `
-(
-pt_rg
-)-2,ort_string);
-
-750
- `tf
-("vddr: %x\n",
-ive_addss
-);
-
-754 i(
-dei
- =
-PUBLIC
-) {
-
-760 
-pe_cgDZ_y_key
-
-da_chl_key
-;
-
-761
-da_chl_key
-.
-
- =
-ive_addss
-;
-
-762
-da_chl_key
-.
-pt
- =
-ive_pt_numb
-;
-
-763
-da_chl_key
-.
-pid
- = 0xffff;
-
-766
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-767
-rv_dei
- =
-SERVER_IN_PRIVATE
-;
-
-768
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-769
-p_ssi_ty
-= 0;
-
-772 #ifde
-ALGDBG
-
-
-773
- `tf
-("<--Seq_cli:%4d, Ack_cli%4d, Len:%4d\n",
-
-774
- `e_bsw32
-(
-thdr
-->
-_q
-),
-
-775
- `e_bsw32
-(
-thdr
-->
-cv_ack
-),
-
-776 (
-_hdr
-->
-tٮ_ngth
- -
-
-777 (((
-thdr
-->
-da_off
- & 0xf0) >> 2)) - 20));
-
-779
- `puϋ_p_g_y
-(
-ive_addss
-,
-ive_pt_numb
-);
-
-780 } i(
-dei
- =
-PRIVATE
-) {
-
-786 
-pe_cgDZ_y_key
-
-da_chl_key
-;
-
-787
-ive_addss
- =
- `e_bsw32
-(private_address);
-
-788
-da_chl_key
-.
-
- =
-ive_addss
-;
-
-789
-da_chl_key
-.
-pt
- =
-ive_pt_numb
-;
-
-791
-da_chl_key
-.
-pid
- =
-pkt
-->
-pt
-;
-
-800 #ifde
-FTP_ALG
-
-
-801 i(
- `add_dymic_cgDZ_y_g
-((
-pe
- *)
-
-802
-p_t
-, &
-da_chl_key
-, &
-egss_y
-,
-
-803 &
-gss_y
-) == 0){
-
-805 #ifde
-ALGDBG
-
-
-806
- `tf
-("Wrong FTP ALGacket\n");
-
-809
-p_t
-->
-DZDrݳdPktCou
-++;
-
-811 #ifde
-CGNAPT_DEBUGGING
-
-
-812
-p_t
-->
-DZDrݳdPktCou4
-++;
-
-818
-tmp_t_ylod_size
- =
- `e_bsw16
-(
-_hdr
-->
-tٮ_ngth
-) -
-
-819 ((
-thdr
-->
-da_off
- & 0xf0) >> 2) -
-
-820
-_hdr_size_bys
-;
-
-821
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-822
-t_yld_size
- =
-tmp_t_ylod_size
-;
-
-825
- `puϋ_p_g_y
-(
-egss_y
-->
-da
-.
-pub_
-,
-
-826
-egss_y
-->
-da
-.
-pub_pt
-);
-
-828
-w_pt_rg_ngth
- =
- `p_g_modify_yld
-(
-egss_y
-,
-
-829
-pt_rg
-,
-
-830
-pt_rg_ed
-, 0);
-
-831
- `y
-(
-t_hd_d
-,
-pt_rg_ed
-,
-
-832
- `
-(
-pt_rg_ed
-));
-
-833
-tSeqdiff
- =
- `p_g_d_t_qu
-
-pkt
-,
-pt_rg
-,
-
-834
-cgt_xn_ack
-->
-hash_b_s
-
-
-835 [
-_posi
-].
-tSeqdiff
-,
-
-836
-d_pt_rg_ngth
-,
-
-837
-w_pt_rg_ngth
-);
-
-839
- `p_g_modify_pkt_n
-(
-pkt
-);
-
-848
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-849
-g_byss_ag
- =
-NO_BYPASS
-;
-
-850
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-851
-tSeqdiff
- =cpSeqdiff;
-
-852
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-853
-rv_dei
- =
-SERVER_IN_PUBLIC
-;
-
-854
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-
-855
-p_ssi_ty
- = 0;
-
-857 #ifde
-ALGDBG
-
-
-858
- `tf
-("<--Seq_cli:%4d, Ack_cli%4d, Len:%4d\n",
-
-859
- `e_bsw32
-(
-thdr
-->
-_q
-),
-
-860
- `e_bsw32
-(
-thdr
-->
-cv_ack
-),
-
-861 (
-_hdr
-->
-tٮ_ngth
- -
-
-862 (((
-thdr
-->
-da_off
- & 0xf0) >> 2)) - 20));
-
-869 i((
-ackAdju
-=
-cgt_xn_ack
-->
-hash_b_s
-[
-
-870
-_posi
-].
-tSeqdiff
-) != 0) {
-
-871 i(
-dei
- =
-PRIVATE
-) {
-
-873
-cgt_xn_ack
-->
-hash_b_s
-
-
-874 [
-_posi
-].
-q_
- !=
-
-875
-cgt_xn_ack
-->
-hash_b_s
-
-
-876 [
-_posi
-].
-ack_rv
-) {
-
-877 
-Seqhs
-;
-
-878
- `p_g_adju_t_q
-
-pkt
-,
-ackAdju
-);
-
-879
-tmp_t_ylod_size
- =
- `e_bsw16
-(
-
-880
-_hdr
-->
-tٮ_ngth
-) -
-
-881 ((
-thdr
-->
-da_off
- & 0xf0) >> 2) -
-
-882
-_hdr_size_bys
-;
-
-883
-cgt_xn_ack
-->
-hash_b_s
-
-
-884 [
-_posi
-].
-t_yld_size
- =
-tmp_t_ylod_size
-;
-
-885 #ifde
-ALGDBG
-
-
-886
- `tf
-("<--Seq_cli:%4d, Ack_cli%4d, Len:%4d\n",
-
-887
- `e_bsw32
-(
-thdr
-->
-_q
-),
-
-888
- `e_bsw32
-(
-thdr
-->
-cv_ack
-),
-
-889 (
-_hdr
-->
-tٮ_ngth
- -(((
-thdr
-->
-da_off
- & 0xf0) >> 2))- 20));
-
-893 i(
-cgt_xn_ack
-->
-hash_b_s
-
-
-894 [
-_posi
-].
-ack_rv
- !=
-
-895 (
-cgt_xn_ack
-->
-hash_b_s
-
-
-896 [
-_posi
-].
-q_
- +
-
-897
-cgt_xn_ack
-->
-hash_b_s
-
-
-898 [
-_posi
-].
-t_yld_size
-)) {
-
-899 
-Ackhs
-;
-
-900
- `p_g_adju_t_ack
-
-pkt
-,
-ackAdju
-);
-
-901 #ifde
-ALGDBG
-
-
-902
- `tf
-("<--Seq_cli:%4d, Ack_cli%4d, Len:%4d\n",
-
-903
- `e_bsw32
-(
-thdr
-->
-_q
-),
-
-904
- `e_bsw32
-(
-thdr
-->
-cv_ack
-),
-
-905 (
-_hdr
-->
-tٮ_ngth
- -(((
-thdr
-->
-da_off
- & 0xf0) >> 2))- 20));
-
-914 #ifde
-ALGDBG
-
-
-915
- `tf
-("In Data Channel \n");
-
-917
- `move_p_g_y
- (
-d_addr
-,
-d_pt
-);
-
-918
-cgt_xn_ack
-->
-hash_b_s
-[
-_posi
-].
-g_byss_ag
- =
-BYPASS
-;
-
-920
- }
-}
-
- @VIL/alg/lib_ftp_alg.h
-
-16 #ide
-__INCLUDE_LIB_FTP_ALG_H__
-
-
-17 
- #__INCLUDE_LIB_FTP_ALG_H__
-
-
- )
-
-18 
- ~"e_h.h
-"
-
-19 
- ~"e__t.h
-"
-
-21 
- #META_DATA_OFFSET
- 128
-
- )
-
-22 
- #ETHERNET_START
- (
-META_DATA_OFFSET
- +
-RTE_PKTMBUF_HEADROOM
-)
-
- )
-
-23 
- #ETH_HDR_SIZE
- 14
-
- )
-
-24 
- #IP_START
- (
-ETHERNET_START
- +
-ETH_HDR_SIZE
-)
-
- )
-
-25 
- #PROTOCOL_START
- (
-IP_START
- + 9)
-
- )
-
-26 
- #TCP_START
- (
-IP_START
- +
-IP_V4_HEADER_SIZE
-)
-
- )
-
-27 
- #TCP_MIN_HDR_SIZE
- 20
-
- )
-
-29 
- #RTE_TCP_PROTO_ID
- 6
-
- )
-
-30 
- #RTE_SP_DEFAULT_TTL
- 64
-
- )
-
-32 
- #RTE_SYNPROXY_MAX_SPOOFED_PKTS
- 64
-
- )
-
-34 
- #RTE_TCP_SYN
- 0x02
-
- )
-
-35 
- #RTE_TCP_ACK
- 0x10
-
- )
-
-36 
- #RTE_TCP_SYN_ACK
- (
-RTE_TCP_SYN
- |
-RTE_TCP_ACK
-)
-
- )
-
-37 
- #IP_VERSION_4
- 4
-
- )
-
-38 
- #IP_VERSION_6
- 6
-
- )
-
-39 
- #IPv4_HEADER_SIZE
- 20
-
- )
-
-40 
- #IPv6_HEADER_SIZE
- 40
-
- )
-
-44
- ep_g_byss
- {
-
-45
- mNO_BYPASS
-,
-
-46
- mBYPASS
-
-
-49
- ep_g_mode
- {
-
-50
- mFTP_ALG_PORT
-,
-
-51
- mFTP_ALG_PASV
-
-
-53
- ep_g_dei
- {
-
-54
- mSERVER_IN_PRIVATE
-,
-
-55
- mSERVER_IN_PUBLIC
-
-
-57
- ephy_pt
- {
-
-58
- mPRIVATE_PORT
-,
-
-59
- mPUBLIC_PORT
-
-
-62 
- sp_g_key
- {
-
-63
-ut32_t
-
- m_addss
-;
-
-64
-ut16_t
-
- ml4pt
-;
-
-65
-ut8_t
-
- mfr1
-;
-
-66
-ut8_t
-
- mfr2
-;
-
-68 
- sp_g_b_y
- {
-
-69
-ut32_t
-
- m_addss
-;
-
-70
-ut16_t
-
- ml4pt
-;
-
-71
-ut8_t
-
- mp_g_mode
-;
-
-72
-ut8_t
-
- mp_g_dei
-;
-
-73
-ut32_t
-
- mssi_id
-;
-
-74
-ut8_t
-
- mg_byss_ag
-;
-
-75
-ut8_t
-
- mdummy
-;
-
-76
-ut8_t
-
- mdummy1
-;
-
-78 }
- g__e_che_igd
-;
-
-80 
- #FTP_SERVER_PORT
- 21
-
- )
-
-81 
- #FTP_PORT_STRING
- "PORT"
-
- )
-
-82 
- #FTP_PORT_PARAMETER_STRING
- "PORT %hu,%hu,%hu,%hu,%hu,%hu\r\n"
-
- )
-
-83 
- #FTP_PORT_PARAMETER_COUNT
- 6
-
- )
-
-84 
- #FTP_PORT_RESPONSE_STRING
- "200 PORT commd sucssful.\r\n"
-
- )
-
-85 
- #FTP_PORT_STRING_END_MARKER
- '\n'
-
- )
-
-86 
- #FTP_MAXIMUM_PORT_STRING_LENGTH
- 60
-
- )
-
-87 
- #FTP_PASV_STRING
- "PASV"
-
- )
-
-88 
- #FTP_PASV_PARAMETER_STRING
- "%d Eg PassivMod(%hu,%hu,%hu,%hu,%hu,%hu)\r\n"
-
- )
-
-89 
- #FTP_PASV_PARAMETER_COUNT
- 7
-
- )
-
-90 
- #FTP_PASV_STRING_END_MARKER
- '\n'
-
- )
-
-91 
- #FTP_PASV_RETURN_CODE
- 227
-
- )
-
-93 
-p_g_dpi
-(
-
-94 
-pe_cgDZ
- *
-p_t
-,
-
-95 
-pe_cgDZ_y_key
- *
-t_y_key
-,
-
-96 
-e_mbuf
- *
-pkt
-,
-
-97 
-e__xn_ack
- *
-cgt_xn_ack
-,
-
-98
-t32_t
-
-_posi
-,
-
-99
-ut8_t
-
-dei
-);
-
-100 
-lib_p_g_
-();
-
-101
-t8_t
-
-e__vsi
-(*
-i_hdr
-);
-
- @VIL/alg/lib_sip_alg.c
-
-17 
- ~<dio.h
->
-
-18 
- ~<dlib.h
->
-
-19 
- ~<dt.h
->
-
-20 
- ~<rg.h
->
-
-21 
- ~<unid.h
->
-
-22 
- ~</.h
->
-
-23 
- ~<mh.h
->
-
-25 
- ~<p.h
->
-
-26 
- ~<e_comm.h
->
-
-27 
- ~<e_mloc.h
->
-
-28 
- ~<e_.h
->
-
-29 
- ~<e_udp.h
->
-
-30 
- ~<e_byd.h
->
-
-31 
- ~<e_b_m.h
->
-
-32 
- ~<e_b_hash.h
->
-
-33 
- ~<e_pe.h
->
-
-34 
- ~<e_p.h
->
-
-35 
- ~<e_icmp.h
->
-
-36 
- ~<e_hash.h
->
-
-37 
- ~<e_jhash.h
->
-
-38 
- ~<e_cyes.h
->
-
-40 
- ~"pe_ais_comm.h
-"
-
-41 
- ~"hash_func.h
-"
-
-42 
- ~"lib_s_g.h
-"
-
-43 
- ~"vnf_comm.h
-"
-
-44 
- ~"pe_comm_be.h
-"
-
-46 
- #SIP_ALG_SIP
- "SIP"
-
- )
-
-47 
- #SIP_ALG_200_OK
- "200 OK"
-
- )
-
-48 
- #SIP_ALG_INVITE
- "INVITE"
-
- )
-
-49 
- #SIP_ALG_BYE
- "BYE"
-
- )
-
-50 
- #SIP_ALG_TRYING
- "100 Tryg"
-
- )
-
-51 
- #SIP_ALG_RINGING
- "180 Rgg"
-
- )
-
-52 
- #SIP_ALG_ACK
- "ACK"
-
- )
-
-53 
- #SIP_ALG_CONTACT
- "Cڏ"
-
- )
-
-54 
- #SIP_ALG_CONTENT_LEN
- "Cڋ-Lgth"
-
- )
-
-55 
- #SIP_ALG_VIA
- "V"
-
- )
-
-56 
- #SIP_ALG_FROM
- "From"
-
- )
-
-57 
- #SIP_ALG_TO
- "To"
-
- )
-
-58 
- #SIP_ALG_CALLID
- "Cl-ID"
-
- )
-
-59 
- #SIP_ALG_RTP
- "RTP"
-
- )
-
-60 
- #SIP_ALG_RTCP
- "a=RTCP"
-
- )
-
-61 
- #SIP_ALG_CANCEL
- "CANCEL"
-
- )
-
-62 
- #SIP_ALG_CONTYPE
- "Cڋ-Ty"
-
- )
-
-63 
- #SIP_ALG_APPSDP
- "iti/sdp"
-
- )
-
-64 
- #SIP_ALG_CSEQ
- "CSeq"
-
- )
-
-65 
- #SIP_ALG_AUDIO
- "mudio"
-
- )
-
-66 
- #SIP_ALG_DOUBLE_CRLF
- "\r\n\r\n"
-
- )
-
-67 
- #SIP_ALG_CRLF
- "\r\n"
-
- )
-
-68 
- #SIP_ALG_AT
- "@"
-
- )
-
-69 
- #SIP_ALG_GREAT
- ">"
-
- )
-
-70 
- #SIP_ALG_OWNER
- "o="
-
- )
-
-71 
- #SIP_ALG_IPV4
- "IP4"
-
- )
-
-72 
- #SIP_ALG_CONN
- "c="
-
- )
-
-73 
- #SIP_ALG_REMOTE_PARTY_ID
- "Reme-Pty-ID"
-
- )
-
-74 
- #SIP_ALG_SPACE
- " "
-
- )
-
-75 
- #SIP_ALG_SEMICOLON
- ";"
-
- )
-
-77 
- #SIP_DEFAULT_L4PORT
- 5060
-
- )
-
-79 
- #SIP_ALG_INVITE_MSGTYPE
- 1
-
- )
-
-80 
- #SIP_ALG_BYE_MSGTYPE
- 2
-
- )
-
-81 
- #SIP_ALG_200_OK_INVITE_MSGTYPE
- 3
-
- )
-
-82 
- #SIP_ALG_200_OK_BYE_MSGTYPE
- 4
-
- )
-
-83 
- #SIP_ALG_TRYING_RINGING_MSGTYPE
- 5
-
- )
-
-84 
- #SIP_ALG_ACK_MSGTYPE
- 6
-
- )
-
-86 
- #MAX_NUM_SIP_ALG_ENTRIES
- 16384
-
- )
-
-88 
- #SIP_ALG_VIA_FIELD_IPADDR
- 14
-
- )
-
-89 
- #SIP_ALG_CTAC_FIELD_IPADDR
- 7
-
- )
-
-91 
- #ADDRESS_PORT_STRING
- 1
-
- )
-
-92 
- #PORT_STRING
- 2
-
- )
-
-94 
- #MAX_ADDR_PORT_SIZE
- 30
-
- )
-
-95 
- #MAX_ADDR_SIZE
- 20
-
- )
-
-96 
- #MAX_PORT_SIZE
- 10
-
- )
-
-97 
- #MAX_SIP_UDP_MSG_SIZE
- 2000
-
- )
-
-99 
- #ALG_DEBUG
- 0
-
- )
-
-101 um {
- mFALSE
-,
- mTRUE
- };
-
-103 
-e_mempo
- *
- glib_g_pktmbuf_tx_po
-;
-
-105 
-e_mbuf
- *
- glib_g_pkt
-;
-
-107 
-e_hash_ms
-
- gs_g_hash_ms
- = {
-
-108 .
-me
- =
-NULL
-,
-
-109 .
- gs
- =
-MAX_NUM_SIP_ALG_ENTRIES
-,
-
-110 .
- grved
- = 0,
-
-111 .
- gkey_n
- = (
-s_g_key
-),
-
-112 .
- ghash_func
- =
-e_jhash
-,
-
-113 .
- ghash_func__v
- = 0,
-
-114 .
- gexa_ag
- = 1,
-
-117 
-e_hash
- *
- gs_g_hash_b
-;
-
-119 
-s_g_b_y
- *
- gs_g_b
-[
-MAX_NUM_SIP_ALG_ENTRIES
-];
-
-121 *
-s_g_oss
-(
-e_mbuf
- *
-pkt
-,
-
-122
-ut16_t
-
-pkt_dei
-, ut16_
-_dei
-,
-
-123
-ut16_t
-
-msgTy
-,
-ut32_t
-
-modIp
-,
-
-124
-ut16_t
-
-modL4Pt
-,
-ut32_t
-
-pubIp
-,
-
-125
-ut16_t
-
-pubL4Pt
-, ut16_
-modRPt
-,
-
-126
-ut16_t
-
-modRtPt
-, ut16_*
-diffModSL
-);
-
-127 *
-gSClIdS
-(*
-pMsg
-);
-
-128 *
-tSAlgModifyPayldAddrPt
-(*
-pSMsg
-, **
-pSMsgEnd
-,
-
-129
-ut32_t
-
-dSL
-, ut32_*
-diffL
-,
-
-130
-ut32_t
-
-pub_
-,
-ut16_t
-
-pub_pt
-,
-
-131
-ut32_t
-
-ty
-);
-
-132 *
-tSAlgAdjuMsg
-(*
-pSMsg
-, **
-pSMsgEnd
-,
-
-133
-ut32_t
-
-wSL
-, ut32_
-dSL
-);
-
-137 
- $lib_s_g_
-()
-
-139 *
-s
- =
- `e_zmloc
-(
-NULL
-, 64,
-RTE_CACHE_LINE_SIZE
-);;
-
-140 
-sockid
- = 0;
-
-142 if(!
-s
-){
-
-143
- `tf
-("NAT SIP ALG Init failed\n");
-
-146
- `tf
-(
-s
-,
- `
-(s), "v4_s_g_hash_%d",
-sockid
-);
-
-147
- `tf
-("NAT SIP ALG initialization ...\n");
-
-150
-s_g_hash_ms
-.
-sock_id
- =
-SOCKET_ID_ANY
-;
-
-151
-s_g_hash_ms
-.
-me
- =
-s
-;
-
-152
-s_g_hash_b
- =
- `e_hash_
-(&
-s_g_hash_ms
-);
-
-154 i(
-s_g_hash_b
- =
-NULL
-) {
-
-155
- `tf
-("SIP ALGte_hash_create failed. socket %d ...\n",
-
-156
-s_g_hash_ms
-.
-sock_id
-);
-
-157
- `e_ex
-(0, "SIP ALGte_hash_create failed");
-
-159
- `tf
-("s_g_hash_b %p\n\n", (*)
-s_g_hash_b
-);
-
-162
- }
-}
-
-164 *
-
-(
-n
-);
-
-165 *
- $
-(
-n
-)
-
-167 
-n
- =
-n
- =0 ? 1 :
- `o
-(
- `log10l
-(
- `bs
-(n))) + 1;
-
-169 i(
-n
- < 0)
-
-170
-n
-++;
-
-172 *
-buf
- =
- `oc
-((),
-n
- + 1);
-
-173 if(
-buf
- !
-NULL
-)
-
-174
- `tf
-(
-buf
-,
-n
- + 1, "%ld",
-n
-);
-
-175 
-buf
-;
-
-176
- }
-}
-
-178 
-s_g_b_y
- *
-ve_s_g_y
-(
-
-179 
-s_g_key
- *
-g_key
-);
-
-181 
-s_g_b_y
- *
- $ve_s_g_y
-(
-
-182 
-s_g_key
- *
-g_key
-)
-
-184 
-s_g_b_y
- *
-s_g_da
- =
-NULL
-;
-
-186 
-t
- =
- `e_hash_lookup
-(
-s_g_hash_b
-,
-g_key
-);
-
-188 i(
-t
- < 0) {
-
-189 #ifde
-ALGDBG
-
-
-190
- `tf
-("alg-hashookup failedet %d, "
-
-192
-t
-,
-EINVAL
-,
-ENOENT
-);
-
-195
-s_g_da
- =
-s_g_b
-[
-t
-];
-
-196 
-s_g_da
-;
-
-199 
-NULL
-;
-
-200
- }
-}
-
-203 
- $move_s_g_y
-(
-ut32_t
-
-addr
-,
-ut16_t
-
-ptid
-)
-
-205 
-s_g_key
-
-g_key
-;
-
-206 *
-s_g_y_da
-;
-
-207 
-t
-;
-
-209
-g_key
-.
-l4pt
- =
-ptid
-;
-
-210
-g_key
-.
-_addss
- =
-addr
-;
-
-211
-g_key
-.
-fr1
- = 0;
-
-212
-g_key
-.
-fr2
- = 0;
-
-214 i(
-ALG_DEBUG
-)
-
-215
- `tf
-("move_s_y i%x,܈%d\n",
-g_key
-.
-_addss
-,
-
-216
-g_key
-.
-l4pt
-);
-
-218
-t
- =
- `e_hash_lookup
-(
-s_g_hash_b
-, &
-g_key
-);
-
-219 i(
-t
- < 0) {
-
-220 i(
-ALG_DEBUG
-)
-
-221
- `tf
-("removesipalgentry: "
-
-223
-t
-);
-
-227
-s_g_y_da
- =
-s_g_b
-[
-t
-];
-
-229
- `
-(
-s_g_y_da
-);
-
-230
- `e_hash_d_key
-(
-s_g_hash_b
-, &
-g_key
-);
-
-233
- }
-}
-
-239 
-puϋ_s_g_y
-(
-ut32_t
-
-addr
-,
-ut16_t
-
-ptid
-,
-
-240 *
-s__id
-,
-ut8_t
-
-_dei
-,
-
-241
-s_g_pt_ty
-
-pt_ty
-);
-
-242 
- $puϋ_s_g_y
-(
-ut32_t
-
-addr
-,
-ut16_t
-
-ptid
-,
-
-243 *
-s__id
-,
-ut8_t
-
-_dei
-,
-
-244
-s_g_pt_ty
-
-pt_ty
-)
-
-246 
-s_g_key
-
-g_key
-;
-
-248
-g_key
-.
-l4pt
- =
-ptid
-;
-
-249
-g_key
-.
-_addss
- =
-addr
-;
-
-250
-g_key
-.
-fr1
- = 0;
-
-251
-g_key
-.
-fr2
- = 0;
-
-252 
-t
-;
-
-254 i(
-ALG_DEBUG
-)
-
-255
- `tf
-("populate_sip_alg_entryort %d, ip %x\n",
-
-256
-g_key
-.
-l4pt
-,lg_key.
-_addss
-);
-
-258 
-s_g_b_y
- *
-w_g_da
- =
-
-259
- `ve_s_g_y
-(&
-g_key
-);
-
-261 i(
-w_g_da
-) {
-
-262 i(
-ALG_DEBUG
-)
-
-263
- `tf
-("sip_alg_entryxists ip%x,ort %d\n",
-
-264
-g_key
-.
-_addss
-,lg_key.
-l4pt
-);
-
-268
-w_g_da
- =
-NULL
-;
-
-269
-w_g_da
- = (
-s_g_b_y
- *)
-
-270
- `mloc
-((
-s_g_b_y
-));
-
-271 i(
-w_g_da
- =
-NULL
-) {
-
-272
- `tf
-("populate siplgntry:llocation failed\n");
-
-276
-w_g_da
-->
-l4pt
- =
-ptid
-;
-
-277
-w_g_da
-->
-_addss
- =
-addr
-;
-
-278
-w_g_da
-->
-l4pt_ty
- =
-pt_ty
-;
-
-279
-w_g_da
-->
-s_g__dei
- =
-_dei
-;
-
-280
- `ry
-((*)
-w_g_da
-->
-s_g__id
-, (*)
-s__id
-);
-
-281
-w_g_da
-->
-fr1
- = 0;
-
-282
-w_g_da
-->
-fr2
- = 0;
-
-283
-w_g_da
-->
-fr3
- = 0;
-
-285
-t
- =
- `e_hash_add_key
-(
-s_g_hash_b
-, &
-g_key
-);
-
-286 i(
-t
- < 0) {
-
-287
- `tf
-("puϋ s -_hash_add_key_dERROR %d\n",
-t
-);
-
-288
- `
-(
-w_g_da
-);
-
-292
-s_g_b
-[
-t
-] =
-w_g_da
-;
-
-294 i(
-ALG_DEBUG
-) {
-
-295
- `tf
-("SIP_ALG:able update - ip=%x onort=%det=%d\n",
-
-296
-g_key
-.
-_addss
-,
-ptid
-,
-t
-);
-
-299
- }
-}
-
-301 
- $s_g_dpi
-(
-e_mbuf
- *
-pkt
-,
-pkt_d
-
-pkt_dei
-,
-
-302
-ut32_t
-
-modIp
-,
-ut16_t
-
-modL4Pt
-,
-
-303
-ut32_t
-
-pubIp
-,
-ut16_t
-
-pubL4Pt
-,
-
-304
-ut16_t
-
-modRPt
-, ut16_
-modRtPt
-)
-
-306
-ut16_t
-
-msgTy
- = 0;
-
-307
-s_g__dei
-
-_dei
- = 0;
-
-308
-ut32_t
-
-_addss
- = 0;
-
-309
-ut16_t
-
-pt
- = 0;
-
-310 
-t
- = 0;
-
-311 
-v4_hdr
- *
-_h
-;
-
-312 
-h_hdr
- *
-h_h
- =
- `e_pktmbuf_mtod
-(
-pkt
-, ether_hdr *);
-
-313 
-udp_hdr
- *
-udp_h
-;
-
-314 *
-pSMsg
- =
-NULL
-;
-
-315 
-s_g_b_y
- *
-s_g_y
-;
-
-316 *
-s__id
- =
-NULL
-;
-
-317 
-pos
- = 0;
-
-318 
-s_g_key
-
-g_key
-;
-
-319
-ut16_t
-
-diffModSL
- = 0;
-
-321
-_h
- = (
-v4_hdr
- *)((*)
-h_h
- + (
-h_hdr
-));
-
-322
-udp_h
- = (
-udp_hdr
- *)((*)
-_h
- + (
-v4_hdr
-));
-
-323
-pSMsg
- = ((*)
-udp_h
- + (
-udp_hdr
-));
-
-325 i(
-ALG_DEBUG
-) {
-
-326
- `tf
-("%s:ackgth(%u), bufngth(%u)\n",
-__func__
-,
-
-327
- `e_pktmbuf_pkt_n
-(
-pkt
-),kt->
-buf_n
-);
-
-328
- `tf
-("%s:a segmaddr(%%p)\n",
-__func__
-,
-
-329
- `e_pktmbuf_ϡg
-(
-pkt
-),kt);
-
-330
- `tf
-("%s: dn(%u, %u)\n",
-__func__
-,
- `e_pktmbuf_da_n
-(
-pkt
-),
-
-331
- `e_pktmbuf_da_n
-(
- `e_pktmbuf_ϡg
-(
-pkt
-)));
-
-332
- `tf
-("%s: bufaddr(%p), da_off(%u),b_gs(%u)\n",
-__func__
-,
-
-333
-pkt
-->
-buf_addr
-,kt->
-da_off
-,kt->
-nb_gs
-);
-
-336 i(
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_INVITE
-)) {
-
-338 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_CALLID
-, &
-pos
-, 0) ==
-
-339
-TRUE
-)
-
-340
-s__id
- =
-
-341
- `gSClIdS
-(
-pSMsg
- +
-pos
- +
-
-342
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CALLID
-));
-
-344 i(
-ALG_DEBUG
-)
-
-345
- `tf
-("sgdpi: %d cid %s\n",
-__LINE__
-,
-
-346
-s__id
-);
-
-348 i(
-pkt_dei
- =
-PRIVATE
-) {
-
-349
-_dei
- =
-SIP_CALL_OUTGOING
-;
-
-350
-_addss
- =
- `e_bsw32
-(
-_h
-->
-c_addr
-);
-
-351
-pt
- =
- `e_bsw16
-(
-udp_h
-->
-c_pt
-);
-
-352 } i(
-pkt_dei
- =
-PUBLIC
-) {
-
-353
-_dei
- =
-SIP_CALL_INCOMING
-;
-
-354
-_addss
- =
-pubIp
-;
-
-355
-pt
- =
-pubL4Pt
-;
-
-358 i(
-ALG_DEBUG
-)
-
-359
- `tf
-("0=>sip_alg_dpi:kt_dir(%d), call_dir(%d), "
-
-361
-pkt_dei
-,
-_dei
-,
-_addss
-,
-pt
-);
-
-364
-t
- =
- `puϋ_s_g_y
-(
-_addss
-,
-pt
-,
-
-365
-s__id
-,
-_dei
-,
-
-366
-SIP_UDP
-);
-
-367 i(
-t
- < 0) {
-
-368
- `tf
-("sipalgdpi:populate SIPlg UDPntry failed\n");
-
-371 i(
-modRPt
- != 0) {
-
-372
-t
- =
- `puϋ_s_g_y
-(
-_addss
-,
-modRPt
-,
-
-373
-s__id
-,
-
-374
-_dei
-,
-SIP_RTP
-);
-
-375 i(
-t
- < 0) {
-
-376
- `tf
-("sipalgdpi: "
-
-381 i(
-modRtPt
- != 0) {
-
-382
-t
- =
- `puϋ_s_g_y
-(
-_addss
-,
-modRtPt
-,
-
-383
-s__id
-,
-
-384
-_dei
-,
-SIP_RTCP
-);
-
-385 i(
-t
- < 0) {
-
-386
- `tf
-("sipalgdpi: "
-
-393
-pSMsg
- =
-
-394
- `s_g_oss
-(
-pkt
-,
-pkt_dei
-,
-_dei
-,
-
-395
-SIP_ALG_INVITE_MSGTYPE
-,
-modIp
-,
-modL4Pt
-, 0,
-
-396 0,
-modRPt
-,
-modRtPt
-, &
-diffModSL
-);
-
-403 i(
-pkt_dei
- =
-PRIVATE
-) {
-
-404
-g_key
-.
-_addss
- =
- `e_bsw32
-(
-_h
-->
-c_addr
-);
-
-405
-g_key
-.
-l4pt
- =
- `e_bsw16
-(
-udp_h
-->
-c_pt
-);
-
-407
-g_key
-.
-_addss
- =
-pubIp
-;
-
-408
-g_key
-.
-l4pt
- =
-pubL4Pt
-;
-
-411
-g_key
-.
-fr1
- = 0;
-
-412
-g_key
-.
-fr2
- = 0;
-
-413
-s_g_y
- =
- `ve_s_g_y
-(&
-g_key
-);
-
-415 i(
-ALG_DEBUG
-) {
-
-416
- `tf
-("%s: s_g_y_r(%p)\n",
-__func__
-,
-
-417
-s_g_y
-);
-
-418
- `tf
-("1=>%s:kt_dir(%d), modIp(%x),modL4Port(%x), "
-
-420
-__func__
-,
-pkt_dei
-,
-modIp
-,
-modL4Pt
-,
-
-421
-modRPt
-,
-modRtPt
-,
-pubIp
-,
-pubL4Pt
-);
-
-424 i(
-s_g_y
-) {
-
-425
-_dei
- =
-s_g_y
-->
-s_g__dei
-;
-
-426 i(
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_BYE
-) ||
-
-427
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_CANCEL
-)) {
-
-428
-msgTy
- =
-SIP_ALG_BYE_MSGTYPE
-;
-
-430 
-sAlgPross
-;
-
-431 } i(
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_ACK
-)) {
-
-432
-msgTy
- =
-SIP_ALG_ACK_MSGTYPE
-;
-
-434 
-sAlgPross
-;
-
-437
-pSMsg
- += 8;
-
-439 i(
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_200_OK
-)) {
-
-441 i(
-tSAlgMsgFldPos
-
-
-442 (
-pSMsg
-,
-SIP_ALG_CSEQ
-, &
-pos
-, 0=
-TRUE
-) {
-
-443 *
-pBye
-;
-
-445
-pBye
- =
-
-446
-pSMsg
- +
-pos
- +
-
-447
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CSEQ
-);
-
-448
- `SKIP_SPACES
-(
-pBye
-);
-
-450 *
-pBye
- != ' ')
-
-451
-pBye
-++;
-
-452
- `SKIP_SPACES
-(
-pBye
-);
-
-453 i(
- `IS_STRING_SAME
-(
-pBye
-,
-SIP_ALG_BYE
-)
-
-455 (
-IS_STRING_SAME
-
-
-456 (
-pBye
-,
-SIP_ALG_CANCEL
-)))
-
-457
-msgTy
- =
-
-458
-SIP_ALG_200_OK_BYE_MSGTYPE
-;
-
-461
-msgTy
- =
-
-462
-SIP_ALG_200_OK_INVITE_MSGTYPE
-;
-
-464 } i(
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_TRYING
-) ||
-
-465
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_RINGING
-)) {
-
-466
-msgTy
- =
-SIP_ALG_TRYING_RINGING_MSGTYPE
-;
-
-469
-sAlgPross
-:
-
-470 i(
-ALG_DEBUG
-)
-
-471
- `tf
-("2=>%s:kt_dir(%d), call_dir(%d), "
-
-474
-__func__
-,
-pkt_dei
-,
-_dei
-,
-
-475
-msgTy
-,
-modIp
-,
-modL4Pt
-,
-modRPt
-,
-
-476
-modRtPt
-);
-
-478
-pSMsg
- =
-
-479
- `s_g_oss
-(
-pkt
-,
-pkt_dei
-,
-_dei
-,
-
-480
-msgTy
-,
-modIp
-,
-modL4Pt
-,
-pubIp
-,
-
-481
-pubL4Pt
-,
-modRPt
-,
-modRtPt
-,
-
-482 &
-diffModSL
-);
-
-484
-pSMsg
- =
-NULL
-;
-
-487 i(
-ALG_DEBUG
-)
-
-488
- `tf
-("%s: BefܐIPٮgth(%u), udngth(%u)\n",
-__func__
-,
-
-489
- `e_bsw16
-(
-_h
-->
-tٮ_ngth
-),_bsw16(
-udp_h
-->
-dgm_n
-));
-
-494
-ut16_t
-
-n
- = 0;
-
-495 i(
-diffModSL
- > 0) {
-
-496
-n
- =
- `e_bsw16
-(
-udp_h
-->
-dgm_n
-);
-
-497
-n
- +
-diffModSL
-;
-
-498
-udp_h
-->
-dgm_n
- =
- `e_bsw16
-(
-n
-);
-
-500
-n
- =
- `e_bsw16
-(
-_h
-->
-tٮ_ngth
-);
-
-501
-n
- +
-diffModSL
-;
-
-502
-_h
-->
-tٮ_ngth
- =
- `e_bsw16
-(
-n
-);
-
-504 i(
- `e_pktmbuf_nd
-(
-pkt
-,
-diffModSL
-=
-NULL
-)
-
-505
- `tf
-("%s:ktmbuf_nduNULL",
-__func__
-);
-
-509 i(
-ALG_DEBUG
-)
-
-510
- `tf
-("%s: After IPotalength(%u), udpength(%u), "
-
-511 "diffModSL(%u)\n",
-__func__
-,
-
-512
- `e_bsw16
-(
-_h
-->
-tٮ_ngth
-),
-
-513
- `e_bsw16
-(
-udp_h
-->
-dgm_n
-),
-
-514
-diffModSL
-);
-
-516 i(
-pSMsg
- !
-NULL
-)
-
-520
- }
-}
-
-522 *
- $s_g_oss
-(
-e_mbuf
- *
-pkt
-,
-ut16_t
-
-pkt_dei
-,
-
-523
-ut16_t
-
-_dei
-, ut16_
-msgTy
-,
-ut32_t
-
-modIp
-,
-
-524
-ut16_t
-
-modL4Pt
-,
-ut32_t
-
-pubIp
-, ut16_
-pubL4Pt
-,
-
-525
-ut16_t
-
-modRPt
-, ut16_
-modRtPt
-,
-
-526
-ut16_t
- *
-diffModSL
-)
-
-528 
-v4_hdr
- *
-_h
-;
-
-529 
-h_hdr
- *
-h_h
- =
- `e_pktmbuf_mtod
-(
-pkt
-, ether_hdr *);
-
-530 
-udp_hdr
- *
-udp_h
-;
-
-531 *
-pSMsg
-, *
-pS
-, *
-pEndP
-;
-
-532 
-pos
-;
-
-534
-ut32_t
-
-diffL
-,
-addrPtL
-;
-
-535 
-sdpMsgL
- = 0;
-
-536 
-s_msg_n
- = 0;
-
-538
-_h
- = (
-v4_hdr
- *)((*)
-h_h
- + (
-h_hdr
-));
-
-539
-udp_h
- = (
-udp_hdr
- *)((*)
-_h
- + (
-v4_hdr
-));
-
-540
-pSMsg
- = ((*)
-udp_h
- + (
-udp_hdr
-));
-
-541 *
-pTmpSMsg
- =
-pSMsg
-;
-
-542 *
-pSSMsg
- =
-pSMsg
-;
-
-544
-s_msg_n
- =
-
-545
- `e_bsw16
-(
-_h
-->
-tٮ_ngth
-- (
-v4_hdr
-) -
-
-546 (
-udp_hdr
-);
-
-548 i(
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_CONTENT_LEN
-, &
-pos
-, 0) ==
-
-549
-TRUE
-)
-
-550
-pTmpSMsg
- +(
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CONTENT_LEN
-));
-
-552
- `tf
-("sip_alg_process: Invalid Content Length\n");
-
-553 
-NULL
-;
-
-556
- `SKIP_SPACES
-(
-pTmpSMsg
-);
-
-557 
-sdpDaL
- =
- `
-(
-pTmpSMsg
-, &
-pS
-, 10);
-
-559
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-SIP_ALG_DOUBLE_CRLF
-, &
-pos
-, 0);
-
-560
-pTmpSMsg
- +(
-pos
- +
- `
-(
-SIP_ALG_DOUBLE_CRLF
-));
-
-562 i(
-sdpDaL
- != 0)
-
-563 i(
-tSAlgMsgFldPos
-
-
-564 (
-pTmpSMsg
-,
-SIP_ALG_REMOTE_PARTY_ID
-, &
-pos
-, 0=
-TRUE
-) {
-
-565
-pTmpSMsg
- +
-pos
- +
- `
-(
-SIP_ALG_REMOTE_PARTY_ID
-);
-
-567
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-568
-SIP_ALG_DOUBLE_CRLF
-, &
-pos
-,
-
-570
-pTmpSMsg
- +(
-pos
- +
- `
-(
-SIP_ALG_DOUBLE_CRLF
-));
-
-573 
-sMsgL
- = (
-pTmpSMsg
- -
-pSMsg
-);
-
-575 *
-pSMsgEnd
- =
-pSMsg
- +
-sMsgL
- +
-sdpDaL
-;
-
-577 i(
-ALG_DEBUG
-)
-
-578
- `tf
-("%s:SipMsg: %p,SipMsgEnd: %p, sipMsgLen: %d, "
-
-580
-__func__
-,
-pSMsg
-,
-pSMsgEnd
-,
-sMsgL
-,
-sdpDaL
-,
-
-581
-s_msg_n
-);
-
-583 i(
-_dei
- =
-SIP_CALL_OUTGOING
-) {
-
-584 i((
-msgTy
- =
-SIP_ALG_INVITE_MSGTYPE
-)
-
-585 || (
-msgTy
- =
-SIP_ALG_ACK_MSGTYPE
-)) {
-
-587 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_VIA
-, &
-pos
-, 0)
-
-588 =
-TRUE
-) {
-
-590
-pSMsg
- +=
-
-591 (
-pos
- +
- `
-(
-SIP_ALG_VIA
-) +
-
-592
-SIP_ALG_VIA_FIELD_IPADDR
-);
-
-593
-pTmpSMsg
- =
-pSMsg
-;
-
-595
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-596
-SIP_ALG_SEMICOLON
-, &
-pos
-,
-
-598
-pTmpSMsg
- +
-pos
-;
-
-599
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-601
- `tf
-("sip_alg_process; No valid VIA field\n");
-
-602 
-NULL
-;
-
-605
-pSMsg
- =
-
-606
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-607
-addrPtL
-,
-
-608 &
-diffL
-,
-modIp
-,
-
-609
-modL4Pt
-,
-
-610
-ADDRESS_PORT_STRING
-);
-
-612 *
-diffModSL
- +
-diffL
-;
-
-616 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_FROM
-, &
-pos
-, 0)
-
-617 =
-TRUE
-) {
-
-618
-pSMsg
- +
-pos
-;
-
-620
-pTmpSMsg
- =
-pSMsg
-;
-
-622
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-623 &
-pos
-, 0);
-
-624
-pTmpSMsg
- +
-pos
-;
-
-625
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-627
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-629
-pSMsg
- +
-pos
- + 1;
-
-631
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-633
-tf
-
-
-635 
-NULL
-;
-
-638
-pSMsg
- =
-
-639
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-640
-addrPtL
-,
-
-641 &
-diffL
-,
-modIp
-,
-
-642
-modL4Pt
-,
-
-643
-ADDRESS_PORT_STRING
-);
-
-645 *
-diffModSL
- +
-diffL
-;
-
-649 i(
-tSAlgMsgFldPos
-
-
-650 (
-pSMsg
-,
-SIP_ALG_CALLID
-, &
-pos
-, 0=
-TRUE
-) {
-
-651
-pSMsg
- +
-pos
-;
-
-653
-pTmpSMsg
- =
-pSMsg
-;
-
-655
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-656
-SIP_ALG_CRLF
-, &
-pos
-,
-
-658
-pTmpSMsg
- +
-pos
-;
-
-659
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-661
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-663
-pSMsg
- +
-pos
- + 1;
-
-664
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-666
- `tf
-("sip_alg_process; "
-
-668 
-NULL
-;
-
-672
-pSMsg
- =
-
-673
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-674
-addrPtL
-,
-
-675 &
-diffL
-,
-modIp
-, 0,
-
-676
-ADDRESS_PORT_STRING
-);
-
-678 *
-diffModSL
- +
-diffL
-;
-
-681 i(
-tSAlgMsgFldPos
-
-
-682 (
-pSMsg
-,
-SIP_ALG_CONTACT
-, &
-pos
-, 0=
-TRUE
-) {
-
-683
-pSMsg
- +
-pos
-;
-
-685
-pTmpSMsg
- =
-pSMsg
-;
-
-686
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-687
-SIP_ALG_CRLF
-, &
-pos
-,
-
-689
-pTmpSMsg
- +
-pos
-;
-
-691
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-693
-pSMsg
- +
-pos
- + 1;
-
-694
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-697
- `tf
-("sip_alg_process; "
-
-699 
-NULL
-;
-
-702
-pSMsg
- =
-
-703
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-704
-addrPtL
-,
-
-705 &
-diffL
-,
-modIp
-,
-
-706
-modL4Pt
-,
-
-707
-ADDRESS_PORT_STRING
-);
-
-709 *
-diffModSL
- +
-diffL
-;
-
-711 i(
-msgTy
- =
-SIP_ALG_INVITE_MSGTYPE
-) {
-
-713 i(
-tSAlgMsgFldPos
-
-
-714 (
-pSMsg
-,
-SIP_ALG_CONTYPE
-, &
-pos
-,
-
-715 0=
-TRUE
-) {
-
-716
-pSMsg
- +=
-
-717 (
-pos
- +
-
-718
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CONTYPE
-));
-
-719
- `SKIP_SPACES
-(
-pSMsg
-);
-
-721 i(!
-IS_STRING_SAME
-
-
-722 (
-pSMsg
-,
-SIP_ALG_APPSDP
-)) {
-
-723
- `tf
-("sip_alg_process "
-
-725 
-NULL
-;
-
-728
- `tf
-("sip_alg_process; "
-
-730 
-NULL
-;
-
-734
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-735
-SIP_ALG_CONTENT_LEN
-, &
-pos
-,
-
-737
-pSMsg
- +=
-
-738 (
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CONTENT_LEN
-));
-
-739
- `SKIP_SPACES
-(
-pSMsg
-);
-
-740
-sdpMsgL
- =
- `
-(
-pSMsg
-, &
-pEndP
-, 10);
-
-741 i(!
-sdpMsgL
-) {
-
-743 i(
-msgTy
- =
-SIP_ALG_ACK_MSGTYPE
-)
-
-744 
-sAlgProssEx
-;
-
-746
- `tf
-("sip_alg_process - "
-
-748 
-NULL
-;
-
-752 i(
-tSAlgMsgFldPos
-
-
-753 (
-pSMsg
-,
-SIP_ALG_OWNER
-, &
-pos
-,
-
-754 0=
-TRUE
-) {
-
-755
-pSMsg
- +
-pos
-;
-
-757
-pTmpSMsg
- =
-pSMsg
-;
-
-759
- `tSAlgMsgFldPosFdCf
-(
-pSMsg
-,
-
-760
-SIP_ALG_CRLF
-,
-
-761 &
-pos
-,
-
-763
-pTmpSMsg
- +
-pos
-;
-
-766
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-767
-SIP_ALG_IPV4
-, &
-pos
-,
-
-769
-pSMsg
- +(
-pos
- +
- `
-(
-SIP_ALG_IPV4
-));
-
-770
- `SKIP_SPACES
-(
-pSMsg
-);
-
-772
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-774
- `tf
-("sip_alg_processing: "
-
-776 
-NULL
-;
-
-779
-pSMsg
- =
-
-780
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-781 &
-pSMsgEnd
-,
-
-782
-addrPtL
-,
-
-783 &
-diffL
-,
-
-784
-modIp
-, 0,
-
-785
-ADDRESS_PORT_STRING
-);
-
-787 *
-diffModSL
- +
-diffL
-;
-
-788
-sdpMsgL
- +
-diffL
-;
-
-792 i(
-tSAlgMsgFldPos
-
-
-793 (
-pSMsg
-,
-SIP_ALG_CONN
-, &
-pos
-,
-
-794 0=
-TRUE
-) {
-
-795
-pSMsg
- +
-pos
-;
-
-796
-pTmpSMsg
- =
-pSMsg
-;
-
-798
- `tSAlgMsgFldPosFdCf
-(
-pSMsg
-,
-
-799
-SIP_ALG_CRLF
-,
-
-800 &
-pos
-,
-
-802
-pTmpSMsg
- +
-pos
-;
-
-805
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-806
-SIP_ALG_IPV4
-, &
-pos
-,
-
-808
-pSMsg
- +(
-pos
- +
- `
-(
-SIP_ALG_IPV4
-));
-
-809
- `SKIP_SPACES
-(
-pSMsg
-);
-
-811
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-813
- `tf
-("sip_alg_processing: "
-
-815 
-NULL
-;
-
-818
-pSMsg
- =
-
-819
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-820 &
-pSMsgEnd
-,
-
-821
-addrPtL
-,
-
-822 &
-diffL
-,
-
-823
-modIp
-, 0,
-
-824
-ADDRESS_PORT_STRING
-);
-
-826 *
-diffModSL
- +
-diffL
-;
-
-827
-sdpMsgL
- +
-diffL
-;
-
-831 i(
-tSAlgMsgFldPos
-
-
-832 (
-pSMsg
-,
-SIP_ALG_AUDIO
-, &
-pos
-,
-
-833 0=
-TRUE
-) {
-
-834
-pSMsg
- +=
-
-835 (
-pos
- +
-
-836
- `TAG_TO_DATAPOS
-(
-SIP_ALG_AUDIO
-));
-
-837
- `SKIP_SPACES
-(
-pSMsg
-);
-
-838
-pTmpSMsg
- =
-pSMsg
-;
-
-839
-tSAlgMsgFldPosFdS
-
-
-840 (
-pTmpSMsg
-,
-SIP_ALG_SPACE
-, &
-pos
-,
-
-842
-pTmpSMsg
- +
-pos
-;
-
-843
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-847
-pSMsg
- =
-
-848
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-849 &
-pSMsgEnd
-,
-
-850
-addrPtL
-,
-
-851 &
-diffL
-, 0,
-
-852
-modRPt
-,
-
-853
-PORT_STRING
-);
-
-855 *
-diffModSL
- +
-diffL
-;
-
-856
-sdpMsgL
- +
-diffL
-;
-
-860 i(
-tSAlgMsgFldPos
-
-
-861 (
-pSMsg
-,
-SIP_ALG_RTCP
-, &
-pos
-,
-
-862 0=
-TRUE
-) {
-
-863
-pSMsg
- +=
-
-864 (
-pos
- +
-
-865
- `TAG_TO_DATAPOS
-(
-SIP_ALG_RTCP
-));
-
-866
- `SKIP_SPACES
-(
-pSMsg
-);
-
-867
-pTmpSMsg
- =
-pSMsg
-;
-
-868
-tSAlgMsgFldPosFdS
-
-
-869 (
-pTmpSMsg
-,
-SIP_ALG_SPACE
-, &
-pos
-,
-
-871
-pTmpSMsg
- +
-pos
-;
-
-872
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-875
-pSMsg
- =
-
-876
-tSAlgModifyPayldAddrPt
-
-
-877 (
-pSMsg
-, &
-pSMsgEnd
-,
-addrPtL
-,
-
-878 &
-diffL
-, 0,
-modRtPt
-,
-
-879
-PORT_STRING
-);
-
-881 *
-diffModSL
- +
-diffL
-;
-
-882
-sdpMsgL
- +
-diffL
-;
-
-887 } i((
-msgTy
- =
-SIP_ALG_TRYING_RINGING_MSGTYPE
-)
-
-888 || (
-msgTy
- =
-SIP_ALG_200_OK_INVITE_MSGTYPE
-)) {
-
-890 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_VIA
-, &
-pos
-, 0)
-
-891 =
-TRUE
-) {
-
-893
-pSMsg
- +=
-
-894 (
-pos
- +
- `
-(
-SIP_ALG_VIA
-) +
-
-895
-SIP_ALG_VIA_FIELD_IPADDR
-);
-
-896
-pTmpSMsg
- =
-pSMsg
-;
-
-898
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-899
-SIP_ALG_SEMICOLON
-, &
-pos
-,
-
-901
-pTmpSMsg
- +
-pos
-;
-
-902
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-904
- `tf
-("sip_alg_process; No valid VIA field\n");
-
-905 
-NULL
-;
-
-908
-pSMsg
- =
-
-909
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-910
-addrPtL
-,
-
-911 &
-diffL
-,
-modIp
-,
-
-912
-modL4Pt
-,
-
-913
-ADDRESS_PORT_STRING
-);
-
-914 *
-diffModSL
- =
-diffL
-;
-
-917 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_FROM
-, &
-pos
-, 0)
-
-918 =
-TRUE
-) {
-
-919
-pSMsg
- +
-pos
-;
-
-921
-pTmpSMsg
- =
-pSMsg
-;
-
-923
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-924 &
-pos
-, 0);
-
-925
-pTmpSMsg
- +
-pos
-;
-
-928
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-930
-pSMsg
- +
-pos
- + 1;
-
-932
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-934
-tf
-
-
-936 
-NULL
-;
-
-939
-pSMsg
- =
-
-940
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-941
-addrPtL
-,
-
-942 &
-diffL
-,
-modIp
-,
-
-943
-modL4Pt
-,
-
-944
-ADDRESS_PORT_STRING
-);
-
-946 *
-diffModSL
- +
-diffL
-;
-
-950 i(
-tSAlgMsgFldPos
-
-
-951 (
-pSMsg
-,
-SIP_ALG_CALLID
-, &
-pos
-, 0=
-TRUE
-) {
-
-952
-pSMsg
- +
-pos
-;
-
-954
-pTmpSMsg
- =
-pSMsg
-;
-
-956
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-957
-SIP_ALG_CRLF
-, &
-pos
-,
-
-959
-pTmpSMsg
- +
-pos
-;
-
-962
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-964
-pSMsg
- +
-pos
- + 1;
-
-965
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-967
- `tf
-("sip_alg_process; "
-
-969 
-NULL
-;
-
-973
-pSMsg
- =
-
-974
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-975
-addrPtL
-,
-
-976 &
-diffL
-,
-modIp
-, 0,
-
-977
-ADDRESS_PORT_STRING
-);
-
-979 *
-diffModSL
- +
-diffL
-;
-
-981 } i(
-pkt_dei
- =
-PRIVATE
-
-
-982 &&
-msgTy
- =
-SIP_ALG_BYE_MSGTYPE
-) {
-
-986 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_VIA
-, &
-pos
-, 0)
-
-987 =
-TRUE
-) {
-
-989
-pSMsg
- +=
-
-990 (
-pos
- +
- `
-(
-SIP_ALG_VIA
-) +
-
-991
-SIP_ALG_VIA_FIELD_IPADDR
-);
-
-992
-pTmpSMsg
- =
-pSMsg
-;
-
-994
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-995
-SIP_ALG_SEMICOLON
-, &
-pos
-,
-
-997
-pTmpSMsg
- +
-pos
-;
-
-998
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1000
- `tf
-("sip_alg_process; No valid VIA field\n");
-
-1001 
-NULL
-;
-
-1004
-pSMsg
- =
-
-1005
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1006
-addrPtL
-,
-
-1007 &
-diffL
-,
-modIp
-, 0,
-
-1008
-ADDRESS_PORT_STRING
-);
-
-1009 *
-diffModSL
- =
-diffL
-;
-
-1012 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_FROM
-, &
-pos
-, 0)
-
-1013 =
-TRUE
-) {
-
-1014
-pSMsg
- +
-pos
-;
-
-1016
-pTmpSMsg
- =
-pSMsg
-;
-
-1018
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1019 &
-pos
-, 0);
-
-1020
-pTmpSMsg
- +
-pos
-;
-
-1021
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1023
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1025
-pSMsg
- +
-pos
- + 1;
-
-1027
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1029
-tf
-
-
-1031 
-NULL
-;
-
-1034
-pSMsg
- =
-
-1035
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1036
-addrPtL
-,
-
-1037 &
-diffL
-,
-modIp
-,
-
-1038
-modL4Pt
-,
-
-1039
-ADDRESS_PORT_STRING
-);
-
-1041 *
-diffModSL
- +
-diffL
-;
-
-1045 i(
-tSAlgMsgFldPos
-
-
-1046 (
-pSMsg
-,
-SIP_ALG_CALLID
-, &
-pos
-, 0=
-TRUE
-) {
-
-1047
-pSMsg
- +
-pos
-;
-
-1049
-pTmpSMsg
- =
-pSMsg
-;
-
-1051
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1052
-SIP_ALG_CRLF
-, &
-pos
-,
-
-1054
-pTmpSMsg
- +
-pos
-;
-
-1055
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1057
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1059
-pSMsg
- +
-pos
- + 1;
-
-1060
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1062
- `tf
-("sip_alg_process; "
-
-1064 
-NULL
-;
-
-1068
-pSMsg
- =
-
-1069
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1070
-addrPtL
-,
-
-1071 &
-diffL
-,
-modIp
-, 0,
-
-1072
-ADDRESS_PORT_STRING
-);
-
-1074 *
-diffModSL
- +
-diffL
-;
-
-1077 i(
-tSAlgMsgFldPos
-
-
-1078 (
-pSMsg
-,
-SIP_ALG_CONTACT
-, &
-pos
-, 0=
-TRUE
-) {
-
-1079
-pSMsg
- +
-pos
-;
-
-1081
-pTmpSMsg
- =
-pSMsg
-;
-
-1082
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1083
-SIP_ALG_CRLF
-, &
-pos
-, 0);
-
-1084
-pTmpSMsg
- +
-pos
-;
-
-1086 
-ag
- = 0;
-
-1087 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-,
-
-1088 &
-pos
-, 0=
-FALSE
-)
-
-1089
-ag
- = 1;
-
-1091 i(
-ag
-)
-
-1092 
-SMsgAdv2
-;
-
-1093
-pSMsg
- +
-pos
- + 1;
-
-1094
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1097
- `tf
-("sip_alg_process; "
-
-1099 
-NULL
-;
-
-1102
-pSMsg
- =
-
-1103
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1104
-addrPtL
-,
-
-1105 &
-diffL
-,
-modIp
-,
-
-1106
-modL4Pt
-,
-
-1107
-ADDRESS_PORT_STRING
-);
-
-1109 *
-diffModSL
- +
-diffL
-;
-
-1110 } i(
-pkt_dei
- =
-PUBLIC
-
-
-1111 &&
-msgTy
- =
-SIP_ALG_BYE_MSGTYPE
-) {
-
-1118
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-, 0);
-
-1119
-pSMsg
- +
-pos
- + 1;
-
-1120
-pTmpSMsg
- =
-pSMsg
-;
-
-1121
- `tSAlgMsgFldPosFdS
-(
-pTmpSMsg
-,
-SIP_ALG_SPACE
-,
-
-1122 &
-pos
-, 0);
-
-1123
-pTmpSMsg
- +
-pos
-;
-
-1124
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1126
-pSMsg
- =
-
-1127
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1128
-addrPtL
-,
-
-1129 &
-diffL
-,
-modIp
-,
-
-1130
-modL4Pt
-,
-
-1131
-ADDRESS_PORT_STRING
-);
-
-1132 *
-diffModSL
- +
-diffL
-;
-
-1136 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_TO
-, &
-pos
-, 0)
-
-1137 =
-TRUE
-) {
-
-1138
-pSMsg
- +
-pos
-;
-
-1139
-pTmpSMsg
- =
-pSMsg
-;
-
-1140
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1141 &
-pos
-, 0);
-
-1142
-pTmpSMsg
- +
-pos
-;
-
-1143
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1145
-pSMsg
- +
-pos
- + 1;
-
-1146
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1147
-pSMsg
- =
-
-1148
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1149 &
-pSMsgEnd
-,
-
-1150
-addrPtL
-,
-
-1151 &
-diffL
-,
-
-1152
-modIp
-,
-
-1153
-modL4Pt
-,
-
-1154
-ADDRESS_PORT_STRING
-);
-
-1155 *
-diffModSL
- +
-diffL
-;
-
-1160 i(
-tSAlgMsgFldPos
-
-
-1161 (
-pSMsg
-,
-SIP_ALG_CALLID
-, &
-pos
-, 0=
-TRUE
-) {
-
-1162
-pSMsg
- +
-pos
-;
-
-1164
-pTmpSMsg
- =
-pSMsg
-;
-
-1166
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1167
-SIP_ALG_CRLF
-, &
-pos
-,
-
-1169
-pTmpSMsg
- +
-pos
-;
-
-1172
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1174
-pSMsg
- +
-pos
- + 1;
-
-1175
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1177
- `tf
-("sip_alg_process; "
-
-1179 
-NULL
-;
-
-1183
-pSMsg
- =
-
-1184
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1185
-addrPtL
-,
-
-1186 &
-diffL
-,
-modIp
-, 0,
-
-1187
-ADDRESS_PORT_STRING
-);
-
-1189 *
-diffModSL
- +
-diffL
-;
-
-1190 } i(
-pkt_dei
- =
-PRIVATE
-
-
-1191 && (
-msgTy
- =
-SIP_ALG_200_OK_BYE_MSGTYPE
-)) {
-
-1197 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_TO
-, &
-pos
-, 0)
-
-1198 =
-TRUE
-) {
-
-1199
-pSMsg
- +
-pos
-;
-
-1201
-pTmpSMsg
- =
-pSMsg
-;
-
-1203
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1204 &
-pos
-, 0);
-
-1205
-pTmpSMsg
- +
-pos
-;
-
-1206
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1208
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1210
-pSMsg
- +
-pos
- + 1;
-
-1212
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1214
-tf
-
-
-1216 
-NULL
-;
-
-1219
-pSMsg
- =
-
-1220
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1221
-addrPtL
-,
-
-1222 &
-diffL
-,
-modIp
-,
-
-1223
-modL4Pt
-,
-
-1224
-ADDRESS_PORT_STRING
-);
-
-1226 *
-diffModSL
- =
-diffL
-;
-
-1230 i(
-tSAlgMsgFldPos
-
-
-1231 (
-pSMsg
-,
-SIP_ALG_CONTACT
-, &
-pos
-, 0=
-TRUE
-) {
-
-1232
-pSMsg
- +
-pos
-;
-
-1234
-pTmpSMsg
- =
-pSMsg
-;
-
-1235
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1236
-SIP_ALG_CRLF
-, &
-pos
-,
-
-1238
-pTmpSMsg
- +
-pos
-;
-
-1240 
-ag
- = 0;
-
-1241 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-,
-
-1242 &
-pos
-, 0=
-FALSE
-)
-
-1243
-ag
- = 1;
-
-1245 i(
-ag
-)
-
-1246 
-SMsgAdv2
-;
-
-1247
-pSMsg
- +
-pos
- + 1;
-
-1248
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1250
- `tf
-("sip_alg_process; "
-
-1252 
-NULL
-;
-
-1255
-pSMsg
- =
-
-1256
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1257
-addrPtL
-,
-
-1258 &
-diffL
-,
-modIp
-,
-
-1259
-modL4Pt
-,
-
-1260
-ADDRESS_PORT_STRING
-);
-
-1262 *
-diffModSL
- +
-diffL
-;
-
-1263 } i(
-pkt_dei
- =
-PUBLIC
-
-
-1264 && (
-msgTy
- =
-SIP_ALG_200_OK_BYE_MSGTYPE
-)) {
-
-1268 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_VIA
-, &
-pos
-, 0)
-
-1269 =
-TRUE
-) {
-
-1271
-pSMsg
- +=
-
-1272 (
-pos
- +
- `
-(
-SIP_ALG_VIA
-) +
-
-1273
-SIP_ALG_VIA_FIELD_IPADDR
-);
-
-1274
-pTmpSMsg
- =
-pSMsg
-;
-
-1276
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-1277
-SIP_ALG_SEMICOLON
-, &
-pos
-,
-
-1279
-pTmpSMsg
- +
-pos
-;
-
-1280
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1282
- `tf
-("sip_alg_process; No valid VIA field\n");
-
-1283 
-NULL
-;
-
-1286
-pSMsg
- =
-
-1287
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1288
-addrPtL
-,
-
-1289 &
-diffL
-,
-modIp
-, 0,
-
-1290
-ADDRESS_PORT_STRING
-);
-
-1291 *
-diffModSL
- =
-diffL
-;
-
-1294 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_FROM
-, &
-pos
-, 0)
-
-1295 =
-TRUE
-) {
-
-1296
-pSMsg
- +
-pos
-;
-
-1298
-pTmpSMsg
- =
-pSMsg
-;
-
-1300
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1301 &
-pos
-, 0);
-
-1302
-pTmpSMsg
- +
-pos
-;
-
-1303
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1305
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1307
-pSMsg
- +
-pos
- + 1;
-
-1309
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1311
-tf
-
-
-1313 
-NULL
-;
-
-1316
-pSMsg
- =
-
-1317
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1318
-addrPtL
-,
-
-1319 &
-diffL
-,
-modIp
-,
-
-1320
-modL4Pt
-,
-
-1321
-ADDRESS_PORT_STRING
-);
-
-1323 *
-diffModSL
- +
-diffL
-;
-
-1326 i(
-tSAlgMsgFldPos
-
-
-1327 (
-pSMsg
-,
-SIP_ALG_CALLID
-, &
-pos
-, 0=
-TRUE
-) {
-
-1328
-pSMsg
- +
-pos
-;
-
-1330
-pTmpSMsg
- =
-pSMsg
-;
-
-1331
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1332
-SIP_ALG_CRLF
-, &
-pos
-,
-
-1334
-pTmpSMsg
- +
-pos
-;
-
-1335
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1337
-pSMsg
- +
-pos
- + 1;
-
-1338
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1340
-pSMsg
- =
-
-1341
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1342 &
-pSMsgEnd
-,
-
-1343
-addrPtL
-,
-
-1344 &
-diffL
-,
-
-1345
-modIp
-, 0,
-
-1346
-ADDRESS_PORT_STRING
-);
-
-1348 *
-diffModSL
- +
-diffL
-;
-
-1351
- `tf
-("sip_alg_process; "
-
-1353 
-NULL
-;
-
-1357 } i(
-_dei
- =
-SIP_CALL_INCOMING
-) {
-
-1358 i((
-msgTy
- =
-SIP_ALG_INVITE_MSGTYPE
-)
-
-1359 || (
-msgTy
- =
-SIP_ALG_ACK_MSGTYPE
-)) {
-
-1362 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-, 0)
-
-1363 =
-TRUE
-) {
-
-1364
-pSMsg
- +
-pos
- + 1;
-
-1365
-pTmpSMsg
- =
-pSMsg
-;
-
-1366
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_SIP
-,
-
-1367 &
-pos
-, 0);
-
-1368
-pTmpSMsg
- +(
-pos
- - 1);
-
-1370
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1372
-tf
-
-
-1374
-__LINE__
-);
-
-1375 
-NULL
-;
-
-1378
-pSMsg
- =
-
-1379
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1380
-addrPtL
-,
-
-1381 &
-diffL
-,
-modIp
-,
-
-1382
-modL4Pt
-,
-
-1383
-ADDRESS_PORT_STRING
-);
-
-1384 *
-diffModSL
- +
-diffL
-;
-
-1388 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_TO
-, &
-pos
-, 0)
-
-1389 =
-TRUE
-) {
-
-1390
-pSMsg
- +
-pos
-;
-
-1391
-pTmpSMsg
- =
-pSMsg
-;
-
-1392
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1393 &
-pos
-, 0);
-
-1394
-pTmpSMsg
- +
-pos
-;
-
-1395
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1397
-pSMsg
- +
-pos
- + 1;
-
-1398
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1400
- `tf
-("sip_alg_processing; "
-
-1402
-__LINE__
-);
-
-1403 
-NULL
-;
-
-1406
-pSMsg
- =
-
-1407
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1408
-addrPtL
-,
-
-1409 &
-diffL
-,
-modIp
-,
-
-1410
-modL4Pt
-,
-
-1411
-ADDRESS_PORT_STRING
-);
-
-1412 *
-diffModSL
- +
-diffL
-;
-
-1414 } i((
-msgTy
- =
-SIP_ALG_TRYING_RINGING_MSGTYPE
-)
-
-1415 || (
-msgTy
- =
-SIP_ALG_200_OK_INVITE_MSGTYPE
-)) {
-
-1418 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_TO
-, &
-pos
-, 0)
-
-1419 =
-TRUE
-) {
-
-1420
-pSMsg
- +
-pos
-;
-
-1421
-pTmpSMsg
- =
-pSMsg
-;
-
-1422
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1423 &
-pos
-, 0);
-
-1424
-pTmpSMsg
- +
-pos
-;
-
-1425
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1427
-pSMsg
- +
-pos
- + 1;
-
-1428
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1429
-pSMsg
- =
-
-1430
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1431 &
-pSMsgEnd
-,
-
-1432
-addrPtL
-,
-
-1433 &
-diffL
-,
-
-1434
-modIp
-,
-
-1435
-modL4Pt
-,
-
-1436
-ADDRESS_PORT_STRING
-);
-
-1437 *
-diffModSL
- +
-diffL
-;
-
-1440 i(
-msgTy
- =
-SIP_ALG_200_OK_INVITE_MSGTYPE
-) {
-
-1444 i(
-tSAlgMsgFldPos
-
-
-1445 (
-pSMsg
-,
-SIP_ALG_CONTACT
-, &
-pos
-,
-
-1446 0=
-TRUE
-) {
-
-1447
-pSMsg
- +
-pos
-;
-
-1449
-pTmpSMsg
- =
-pSMsg
-;
-
-1450
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-1451
-SIP_ALG_SEMICOLON
-,
-
-1452 &
-pos
-, 0);
-
-1453
-pTmpSMsg
- +
-pos
-;
-
-1455 
-ag
- = 0;
-
-1456 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-1457
-SIP_ALG_AT
-, &
-pos
-,
-
-1458 30=
-FALSE
-)
-
-1459
-ag
- = 1;
-
-1461 i(
-ag
-)
-
-1462 
-SMsgAdv
-;
-
-1464
-pSMsg
- +
-pos
- + 1;
-
-1465
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1467
- `tf
-("sip_alg_process; "
-
-1469 
-NULL
-;
-
-1472
-pSMsg
- =
-
-1473
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1474 &
-pSMsgEnd
-,
-
-1475
-addrPtL
-,
-
-1476 &
-diffL
-,
-
-1477
-modIp
-,
-
-1478
-modL4Pt
-,
-
-1479
-ADDRESS_PORT_STRING
-);
-
-1481 *
-diffModSL
- +
-diffL
-;
-
-1482
-SMsgAdv
-:
-
-1484
-pTmpSMsg
- =
-pSMsg
-;
-
-1485 i(
-tSAlgMsgFldPos
-
-
-1486 (
-pSMsg
-,
-SIP_ALG_REMOTE_PARTY_ID
-, &
-pos
-,
-
-1487 0=
-TRUE
-) {
-
-1488
-pSMsg
- +
-pos
- +
-
-1489
- `
-(
-SIP_ALG_REMOTE_PARTY_ID
-);
-
-1490
-pTmpSMsg
- =
-pSMsg
-;
-
-1491
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-1492
-SIP_ALG_GREAT
-,
-
-1493 &
-pos
-, 0);
-
-1494
-pTmpSMsg
- +
-pos
-;
-
-1495
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-1496
-SIP_ALG_AT
-, &
-pos
-,
-
-1498
-pSMsg
- +
-pos
- + 1;
-
-1499
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1501
-pSMsg
- =
-
-1502
-tSAlgModifyPayldAddrPt
-
-
-1503 (
-pSMsg
-, &
-pSMsgEnd
-,
-addrPtL
-,
-
-1504 &
-diffL
-,
-modIp
-,
-modL4Pt
-,
-
-1505
-ADDRESS_PORT_STRING
-);
-
-1506
-diffModSL
- +
-diffL
-;
-
-1508
- `tf
-("sip_alg_process: "
-
-1510
-pSMsg
- =
-pTmpSMsg
-;
-
-1514 i(
-tSAlgMsgFldPos
-
-
-1515 (
-pSMsg
-,
-SIP_ALG_OWNER
-, &
-pos
-,
-
-1516 0=
-TRUE
-) {
-
-1517
-pSMsg
- +
-pos
-;
-
-1519
-pTmpSMsg
- =
-pSMsg
-;
-
-1521
- `tSAlgMsgFldPosFdCf
-(
-pSMsg
-,
-
-1522
-SIP_ALG_CRLF
-,
-
-1523 &
-pos
-,
-
-1525
-pTmpSMsg
- +
-pos
-;
-
-1528
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-1529
-SIP_ALG_IPV4
-, &
-pos
-,
-
-1531
-pSMsg
- +(
-pos
- +
- `
-(
-SIP_ALG_IPV4
-));
-
-1532
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1534
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1536
- `tf
-("sip_alg_processing: "
-
-1538 
-NULL
-;
-
-1541
-pSMsg
- =
-
-1542
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1543 &
-pSMsgEnd
-,
-
-1544
-addrPtL
-,
-
-1545 &
-diffL
-,
-
-1546
-modIp
-, 0,
-
-1547
-ADDRESS_PORT_STRING
-);
-
-1549 *
-diffModSL
- +
-diffL
-;
-
-1550
-sdpMsgL
- +
-diffL
-;
-
-1554 i(
-tSAlgMsgFldPos
-
-
-1555 (
-pSMsg
-,
-SIP_ALG_CONN
-, &
-pos
-,
-
-1556 0=
-TRUE
-) {
-
-1557
-pSMsg
- +
-pos
-;
-
-1558
-pTmpSMsg
- =
-pSMsg
-;
-
-1560
- `tSAlgMsgFldPosFdCf
-(
-pSMsg
-,
-
-1561
-SIP_ALG_CRLF
-,
-
-1562 &
-pos
-,
-
-1564
-pTmpSMsg
- +
-pos
-;
-
-1567
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-1568
-SIP_ALG_IPV4
-, &
-pos
-,
-
-1570
-pSMsg
- +(
-pos
- +
- `
-(
-SIP_ALG_IPV4
-));
-
-1571
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1573
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1575
- `tf
-("sip_alg_processing: "
-
-1577 
-NULL
-;
-
-1580
-pSMsg
- =
-
-1581
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1582 &
-pSMsgEnd
-,
-
-1583
-addrPtL
-,
-
-1584 &
-diffL
-,
-
-1585
-modIp
-, 0,
-
-1586
-ADDRESS_PORT_STRING
-);
-
-1588 *
-diffModSL
- +
-diffL
-;
-
-1589
-sdpMsgL
- +
-diffL
-;
-
-1593 i(
-tSAlgMsgFldPos
-
-
-1594 (
-pSMsg
-,
-SIP_ALG_AUDIO
-, &
-pos
-,
-
-1595 0=
-TRUE
-) {
-
-1596
-pSMsg
- +=
-
-1597 (
-pos
- +
- `
-(
-SIP_ALG_AUDIO
-));
-
-1598
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1599
-pTmpSMsg
- =
-pSMsg
-;
-
-1600
-tSAlgMsgFldPosFdS
-
-
-1601 (
-pTmpSMsg
-,
-SIP_ALG_SPACE
-, &
-pos
-,
-
-1603
-pTmpSMsg
- +
-pos
-;
-
-1604
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1608
-pSMsg
- =
-
-1609
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1610 &
-pSMsgEnd
-,
-
-1611
-addrPtL
-,
-
-1612 &
-diffL
-, 0,
-
-1613
-modRPt
-,
-
-1614
-PORT_STRING
-);
-
-1616 *
-diffModSL
- +
-diffL
-;
-
-1617
-sdpMsgL
- +
-diffL
-;
-
-1620 } i(
-pkt_dei
- =
-PUBLIC
-
-
-1621 &&
-msgTy
- =
-SIP_ALG_BYE_MSGTYPE
-) {
-
-1625
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-, 0);
-
-1626
-pSMsg
- +
-pos
- + 1;
-
-1627
-pTmpSMsg
- =
-pSMsg
-;
-
-1628
- `tSAlgMsgFldPosFdS
-(
-pTmpSMsg
-,
-SIP_ALG_SPACE
-,
-
-1629 &
-pos
-, 0);
-
-1630
-pTmpSMsg
- +
-pos
-;
-
-1631
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1633
-pSMsg
- =
-
-1634
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1635
-addrPtL
-,
-
-1636 &
-diffL
-,
-modIp
-,
-
-1637
-modL4Pt
-,
-
-1638
-ADDRESS_PORT_STRING
-);
-
-1639 *
-diffModSL
- +
-diffL
-;
-
-1643 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_TO
-, &
-pos
-, 0)
-
-1644 =
-TRUE
-) {
-
-1645
-pSMsg
- +
-pos
-;
-
-1646
-pTmpSMsg
- =
-pSMsg
-;
-
-1647
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1648 &
-pos
-, 0);
-
-1649
-pTmpSMsg
- +
-pos
-;
-
-1650
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1652
-pSMsg
- +
-pos
- + 1;
-
-1653
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1654
-pSMsg
- =
-
-1655
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-,
-
-1656 &
-pSMsgEnd
-,
-
-1657
-addrPtL
-,
-
-1658 &
-diffL
-,
-
-1659
-modIp
-,
-
-1660
-modL4Pt
-,
-
-1661
-ADDRESS_PORT_STRING
-);
-
-1662 *
-diffModSL
- +
-diffL
-;
-
-1665
-tf
-
-
-1667 
-NULL
-;
-
-1669 } i(
-pkt_dei
- =
-PRIVATE
-
-
-1670 &&
-msgTy
- =
-SIP_ALG_BYE_MSGTYPE
-) {
-
-1674 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_VIA
-, &
-pos
-, 0)
-
-1675 =
-TRUE
-) {
-
-1677
-pSMsg
- +=
-
-1678 (
-pos
- +
- `
-(
-SIP_ALG_VIA
-) +
-
-1679
-SIP_ALG_VIA_FIELD_IPADDR
-);
-
-1680
-pTmpSMsg
- =
-pSMsg
-;
-
-1682
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-1683
-SIP_ALG_SEMICOLON
-, &
-pos
-,
-
-1685
-pTmpSMsg
- +
-pos
-;
-
-1686
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1688
- `tf
-("sip_alg_process; No valid VIA field\n");
-
-1689 
-NULL
-;
-
-1692
-pSMsg
- =
-
-1693
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1694
-addrPtL
-,
-
-1695 &
-diffL
-,
-modIp
-, 0,
-
-1696
-ADDRESS_PORT_STRING
-);
-
-1697 *
-diffModSL
- =
-diffL
-;
-
-1700 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_FROM
-, &
-pos
-, 0)
-
-1701 =
-TRUE
-) {
-
-1702
-pSMsg
- +
-pos
-;
-
-1704
-pTmpSMsg
- =
-pSMsg
-;
-
-1706
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1707 &
-pos
-, 0);
-
-1708
-pTmpSMsg
- +
-pos
-;
-
-1709
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1711
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1713
-pSMsg
- +
-pos
- + 1;
-
-1715
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1717
-tf
-
-
-1719 
-NULL
-;
-
-1722
-pSMsg
- =
-
-1723
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1724
-addrPtL
-,
-
-1725 &
-diffL
-,
-modIp
-,
-
-1726
-modL4Pt
-,
-
-1727
-ADDRESS_PORT_STRING
-);
-
-1729 *
-diffModSL
- +
-diffL
-;
-
-1731 } i(
-pkt_dei
- =
-PRIVATE
-
-
-1732 &&
-msgTy
- =
-SIP_ALG_200_OK_BYE_MSGTYPE
-) {
-
-1736 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_VIA
-, &
-pos
-, 0)
-
-1737 =
-TRUE
-) {
-
-1739
-pSMsg
- +=
-
-1740 (
-pos
- +
- `
-(
-SIP_ALG_VIA
-) +
-
-1741
-SIP_ALG_VIA_FIELD_IPADDR
-);
-
-1742
-pTmpSMsg
- =
-pSMsg
-;
-
-1744
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-
-1745
-SIP_ALG_SEMICOLON
-, &
-pos
-,
-
-1747
-pTmpSMsg
- +
-pos
-;
-
-1748
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1750
- `tf
-("sip_alg_process; No valid VIA field\n");
-
-1751 
-NULL
-;
-
-1754
-pSMsg
- =
-
-1755
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1756
-addrPtL
-,
-
-1757 &
-diffL
-,
-modIp
-, 0,
-
-1758
-ADDRESS_PORT_STRING
-);
-
-1759 *
-diffModSL
- =
-diffL
-;
-
-1762 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-
-1763
-SIP_ALG_FROM
-, &
-pos
-, 0=
-TRUE
-) {
-
-1764
-pSMsg
- +
-pos
-;
-
-1766
-pTmpSMsg
- =
-pSMsg
-;
-
-1768
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1769 &
-pos
-, 0);
-
-1770
-pTmpSMsg
- +
-pos
-;
-
-1771
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1773
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1775
-pSMsg
- +
-pos
- + 1;
-
-1777
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1779
-tf
-
-
-1781 
-NULL
-;
-
-1784
-pSMsg
- =
-
-1785
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1786
-addrPtL
-,
-
-1787 &
-diffL
-,
-modIp
-,
-
-1788
-modL4Pt
-,
-
-1789
-ADDRESS_PORT_STRING
-);
-
-1791 *
-diffModSL
- +
-diffL
-;
-
-1793 } i(
-pkt_dei
- =
-PUBLIC
-
-
-1794 &&
-msgTy
- =
-SIP_ALG_200_OK_BYE_MSGTYPE
-) {
-
-1796 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_TO
-, &
-pos
-, 0)
-
-1797 =
-TRUE
-) {
-
-1798
-pSMsg
- +
-pos
-;
-
-1800
-pTmpSMsg
- =
-pSMsg
-;
-
-1802
- `tSAlgMsgFldPos
-(
-pTmpSMsg
-,
-SIP_ALG_GREAT
-,
-
-1803 &
-pos
-, 0);
-
-1804
-pTmpSMsg
- +
-pos
-;
-
-1805
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1807
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1809
-pSMsg
- +
-pos
- + 1;
-
-1811
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1813
-tf
-
-
-1815 
-NULL
-;
-
-1818
-pSMsg
- =
- `tSAlgModifyPayldAddrPt
-(pSipMsg,
-
-1819 &
-pSMsgEnd
-,
-
-1820
-addrPtL
-,
-
-1821 &
-diffL
-,
-modIp
-,
-
-1822
-modL4Pt
-,
-
-1823
-ADDRESS_PORT_STRING
-);
-
-1825 *
-diffModSL
- =
-diffL
-;
-
-1829 i(
-tSAlgMsgFldPos
-
-
-1830 (
-pSMsg
-,
-SIP_ALG_CONTACT
-, &
-pos
-, 0=
-TRUE
-) {
-
-1831
-pSMsg
- +
-pos
-;
-
-1833
-pTmpSMsg
- =
-pSMsg
-;
-
-1834
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1835
-SIP_ALG_CRLF
-, &
-pos
-,
-
-1837
-pTmpSMsg
- +
-pos
-;
-
-1839
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AT
-, &
-pos
-,
-
-1841
-pSMsg
- +
-pos
- + 1;
-
-1842
-addrPtL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1844
- `tf
-("sip_alg_process; "
-
-1846 
-NULL
-;
-
-1849
-pSMsg
- =
-
-1850
- `tSAlgModifyPayldAddrPt
-(
-pSMsg
-, &
-pSMsgEnd
-,
-
-1851
-addrPtL
-,
-
-1852 &
-diffL
-,
-modIp
-,
-
-1853
-modL4Pt
-,
-
-1854
-ADDRESS_PORT_STRING
-);
-
-1856 *
-diffModSL
- +
-diffL
-;
-
-1860
-SMsgAdv2
-:
-
-1862 i(
-_dei
- =
-SIP_CALL_OUTGOING
-) {
-
-1864 i(
-pkt_dei
- =
-PRIVATE
-) {
-
-1865 i(
-msgTy
- =
-SIP_ALG_200_OK_BYE_MSGTYPE
-) {
-
-1866 i(
-move_s_g_y
-
-
-1867 (
- `e_bsw32
-(
-_h
-->
-c_addr
-),
-
-1868
- `e_bsw16
-(
-udp_h
-->
-c_pt
-)) < 0)
-
-1869
- `tf
-("removesipalgentry failed: "
-
-1871
-_h
-->
-c_addr
-,
-udp_h
-->
-c_pt
-);
-
-1875 i(
-pkt_dei
- =
-PUBLIC
-) {
-
-1876 i(
-msgTy
- =
-SIP_ALG_200_OK_BYE_MSGTYPE
-) {
-
-1877 i(
- `move_s_g_y
-(
-pubIp
-,
-pubL4Pt
-) < 0)
-
-1878
- `tf
-("removesipalgentry failed: "
-
-1880
-pubIp
-,
-pubL4Pt
-);
-
-1886 i((
-sdpMsgL
- > 0&& (
-sdpDaL
- > 0)) {
-
-1887
-pSMsg
- =
-pSSMsg
-;
-
-1888 *
-tmpSdpL
- =
-NULL
-;
-
-1890
-sdpMsgL
- +
-sdpDaL
-;
-
-1891
-tmpSdpL
- =
- `
-(
-sdpMsgL
-);
-
-1892 
-tmpSL
- =
- `
-(
-tmpSdpL
-);
-
-1895 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_CONTENT_LEN
-, &
-pos
-, 0)
-
-1896 =
-TRUE
-) {
-
-1897
-pSMsg
- +(
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CONTENT_LEN
-));
-
-1898
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1899
-pTmpSMsg
- =
-pSMsg
-;
-
-1900
- `tSAlgMsgFldPosFdCf
-(
-pTmpSMsg
-,
-
-1901
-SIP_ALG_DOUBLE_CRLF
-, &
-pos
-,
-
-1903
-pTmpSMsg
- +
-pos
-;
-
-1904
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1905
-diffL
- =
-pTmpSMsg
- -
-pSMsg
-;
-
-1906
- `tSAlgAdjuMsg
-(
-pSMsg
-, &
-pSMsgEnd
-,
-tmpSL
-,
-
-1907
-diffL
-);
-
-1908
- `y
-(
-pSMsg
-,
-tmpSdpL
-,
-tmpSL
-);
-
-1910
- `tf
-("sip_alg_process: Invalid Content Length\n");
-
-1911 
-NULL
-;
-
-1915
-sAlgProssEx
-:
-
-1917 
-pSSMsg
-;
-
-1918
- }
-}
-
-1924 
- $tSAlgGAudioPts
-(
-e_mbuf
- *
-pkt
-,
-ut16_t
- *
-pPt
-,
-
-1925
-ut16_t
- *
-Pt
-)
-
-1927 
-v4_hdr
- *
-_h
-;
-
-1928 
-h_hdr
- *
-h_h
- =
- `e_pktmbuf_mtod
-(
-pkt
-, ether_hdr *);
-
-1929 
-udp_hdr
- *
-udp_h
-;
-
-1930 *
-pSMsg
-, *
-pEndP
-;
-
-1931 
-pos
-,
-sdpMsgL
-;
-
-1933
-_h
- = (
-v4_hdr
- *)((*)
-h_h
- + (
-h_hdr
-));
-
-1934
-udp_h
- = (
-udp_hdr
- *)((*)
-_h
- + (
-v4_hdr
-));
-
-1935
-pSMsg
- = ((*)
-udp_h
- + (
-udp_hdr
-));
-
-1938 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_CONTYPE
-, &
-pos
-, 0=
-FALSE
-)
-
-1941
-pSMsg
- +(
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CONTYPE
-));
-
-1942
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1945 i(!
- `IS_STRING_SAME
-(
-pSMsg
-,
-SIP_ALG_APPSDP
-)) {
-
-1946
- `tf
-("sip_alg_getAudioPort Invalid Contentype\n");
-
-1951
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_CONTENT_LEN
-, &
-pos
-, 0);
-
-1952
-pSMsg
- +(
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_CONTENT_LEN
-));
-
-1953
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1954
-sdpMsgL
- =
- `
-(
-pSMsg
-, &
-pEndP
-, 10);
-
-1955 i(!
-sdpMsgL
-) {
-
-1956
- `tf
-("sipAlggetAudioport - sdpMsgLen is 0\n");
-
-1961 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_AUDIO
-, &
-pos
-, 0) ==
-
-1962
-TRUE
-) {
-
-1963
-pSMsg
- +(
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_AUDIO
-));
-
-1964
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1965 *
-pPt
- =
- `
-(
-pSMsg
-, &
-pEndP
-, 10);
-
-1967 *
-pPt
- = 0;
-
-1970 i(
- `tSAlgMsgFldPos
-(
-pSMsg
-,
-SIP_ALG_RTCP
-, &
-pos
-, 0) ==
-
-1971
-TRUE
-) {
-
-1972
-pSMsg
- +(
-pos
- +
- `TAG_TO_DATAPOS
-(
-SIP_ALG_RTCP
-));
-
-1973
- `SKIP_SPACES
-(
-pSMsg
-);
-
-1974 *
-Pt
- =
- `
-(
-pSMsg
-, &
-pEndP
-, 10);
-
-1976 *
-Pt
- = 0;
-
-1978 i(
-ALG_DEBUG
-)
-
-1979
- `tf
-(" sipAlgGetAudioPort;tpPort %d,tcpPort %d\n",
-
-1980 *
-pPt
-, *
-Pt
-);
-
-1982
- }
-}
-
-1986
- $tSAlgMsgFldPosFdS
-(*
-pDa
-, cڡ *
-pIdS
-, *
-pPos
-,
-
-1987 
-chL
-)
-
-1989 *
-pS
- =
-pDa
-;
-
-1990 
-i
- = 0;
-
-1992 i(!
-pIdS
-)
-
-1993 
-FALSE
-;
-
-1995 i(!
-chL
-)
-
-1996
-chL
- = 1500;
-
-1998 
-TRUE
-) {
-
-1999 *
-pDa
- != ' ') {
-
-2000
-pDa
-++;
-
-2001
-i
-++;
-
-2004 i(
-i
- >
-chL
-) {
-
-2005
- `tf
-("SIP ALG Find Field Pos: "
-
-2007
-chL
-);
-
-2008 *
-pPos
- =
-chL
-;
-
-2009 
-FALSE
-;
-
-2012 i(
- `bcmp
-(
-pDa
-,
-pIdS
-,
- `
-(pIdStr)) == 0)
-
-2016 *
-pPos
- =
-pDa
- -
-pS
-;
-
-2017 
-TRUE
-;
-
-2018
- }
-}
-
-2021 
- $tSAlgMsgFldPosFdCf
-(
-
-2022 *
-pDa
-,
-
-2023 cڡ *
-pIdS
-,
-
-2024 *
-pPos
-,
-
-2025 
-chL
-)
-
-2027 *
-pS
- =
-pDa
-;
-
-2028 
-i
- = 0;
-
-2030 i(!
-pIdS
-)
-
-2031 
-FALSE
-;
-
-2033 i(!
-chL
-)
-
-2034
-chL
- = 1500;
-
-2036 
-TRUE
-) {
-
-2037 *
-pDa
- != '\r' && *(pData + 1) != '\n') {
-
-2038
-pDa
-++;
-
-2039
-i
-++;
-
-2041 i(
-i
- >
-chL
-) {
-
-2042
- `tf
-("SIP ALG Find Field Pos: "
-
-2044
-chL
-);
-
-2045 *
-pPos
- =
-chL
-;
-
-2046 
-FALSE
-;
-
-2049 i(
- `bcmp
-(
-pDa
-,
-pIdS
-,
- `
-(pIdStr)) == 0)
-
-2053 *
-pPos
- =
-pDa
- -
-pS
-;
-
-2054 
-TRUE
-;
-
-2055
- }
-}
-
-2058 
- $tSAlgMsgFldPos
-(*
-pDa
-,
-
-2059 cڡ *
-pIdS
-,
-
-2060 *
-pPos
-,
-
-2061 
-chL
-)
-
-2063 *
-pS
- =
-pDa
-;
-
-2064 
-i
- = 0,
-j
- = 0;
-
-2066 i(!
-pIdS
-)
-
-2067 
-FALSE
-;
-
-2069 i(!
-chL
-)
-
-2070
-chL
- = 1500;
-
-2072 
-TRUE
-) {
-
-2073 *
-pDa
- != '\r' && *(pData + 1) != '\n') {
-
-2076 *
-pDa
- == ' ') {
-
-2077
-pDa
-++;
-
-2078
-j
-++;
-
-2081 i(*
-pDa
- == '\r' && *(pData + 1) == '\n')
-
-2084 i(
- `bcmp
-(
-pDa
-,
-pIdS
-,
- `
-(pIdStr)) == 0) {
-
-2085 *
-pPos
- =
-pDa
- -
-pS
-;
-
-2086 
-TRUE
-;
-
-2089
-pDa
-++;
-
-2090
-j
-++;
-
-2092 i(
-j
- >
-chL
-) {
-
-2093 *
-pPos
- =
-pDa
- -
-pS
-;
-
-2094 
-FALSE
-;
-
-2101 
-i
- = 0; i < (
-chL
- - 1); i++) {
-
-2102 i(
-pDa
-[
-i
-] == '\r')
-
-2103 i(
-pDa
-[
-i
- + 1] == '\n')
-
-2107 i(
-i
- >
-chL
-) {
-
-2108
- `tf
-("SIP ALG Find Field Pos: "
-
-2110
-chL
-);
-
-2111 *
-pPos
- =
-chL
-;
-
-2112 
-FALSE
-;
-
-2115
-pDa
- +
-i
- + 2;
-
-2116
-chL
- -(
-i
- + 2);
-
-2118 i((
-pDa
-[0] == '\r' &&Data[1] == '\n') ||
-
-2119 (
-chL
- <= 0)) {
-
-2122 i(
-chL
- > 0) {
-
-2123
-pDa
- += 2;
-
-2127 *
-pPos
- =
-pDa
- -
-pS
-;
-
-2129 
-FALSE
-;
-
-2133 *
-pPos
- =
-pDa
- -
-pS
-;
-
-2134 
-TRUE
-;
-
-2135
- }
-}
-
-2138 *
- $gSClIdS
-(*
-pMsg
-)
-
-2140 *
-pS
-;
-
-2141 *
-pClId
- =
-NULL
-;
-
-2142 
-i
-;
-
-2144
-pS
- =
-pMsg
-;
-
-2145 
-i
- = 0; i < 200; i++) {
-
-2146 i(*
-pMsg
- != '\r')
-
-2147
-pMsg
-++;
-
-2151 i(
-i
- >= 200) {
-
-2152
- `tf
-("SIP_ALG: getCallid wrong string format\n");
-
-2153 
-NULL
-;
-
-2156
-size_t
-
-size
- =
- `RTE_CACHE_LINE_ROUNDUP
-(
-pMsg
- -
-pS
- + 1);
-
-2158
-pClId
- =
- `e_zmloc
-(
-NULL
-,
-size
-,
-RTE_CACHE_LINE_SIZE
-);
-
-2159 i(!
-pClId
-)
-
-2160 
-NULL
-;
-
-2162
- `bcy
-(
-pS
-,
-pClId
-,
-pMsg
- -Start);
-
-2163 *(
-pClId
- + (
-pMsg
- -
-pS
-)) = 0;
-
-2165 i(
-ALG_DEBUG
-)
-
-2166
- `tf
-("%s: %s\n",
-__func__
-,
-pClId
-);
-
-2168 
-pClId
-;
-
-2169
- }
-}
-
-2171 *
- $tSAlgModifyPayldAddrPt
-(
-
-2172 *
-pSMsg
-, **
-pSMsgEnd
-,
-
-2173
-ut32_t
-
-dSL
-, ut32_*
-diffL
-,
-
-2174
-ut32_t
-
-modIp
-,
-ut16_t
-
-modPt
-, ut32_
-ty
-)
-
-2176 
-addt
-[
-MAX_ADDR_PORT_SIZE
-];
-
-2177 
-_addr
-
-Addr
-;
-
-2178
-ut32_t
-
-wSL
- = 0;
-
-2179 *
-tmpPt
- =
-NULL
-;
-
-2181 i(
-modPt
- != 0)
-
-2182
-tmpPt
- =
- `
-(
-modPt
-);
-
-2184 *
-diffL
- = 0;
-
-2185 i(
-ty
- =
-ADDRESS_PORT_STRING
-) {
-
-2186
-Addr
-.
-s_addr
- =
- `htl
-(
-modIp
-);
-
-2187 *
-tmpAddr
- =
- `_
-(
-Addr
-);
-
-2189 i(
-modPt
- != 0)
-
-2190
- `rtf
-(
-addt
-, "%s:%s",
-tmpAddr
-,
-tmpPt
-);
-
-2192
- `rtf
-(
-addt
-, "%s",
-tmpAddr
-);
-
-2194
-wSL
- =
- `
-(
-addt
-);
-
-2196 i(
- `abs
-(
-wSL
- -
-dSL
-) > 0) {
-
-2201
- `tSAlgAdjuMsg
-(
-pSMsg
-,
-pSMsgEnd
-,
-
-2202
-wSL
-,
-dSL
-);
-
-2206
- `y
-(
-pSMsg
-,
-addt
-,
- `
-(addrport));
-
-2207 } i(
-ty
- =
-PORT_STRING
-) {
-
-2208 if(
-tmpPt
-)
-
-2209
-wSL
- =
- `
-(
-tmpPt
-);
-
-2211 i(
- `abs
-(
-wSL
- -
-dSL
-) > 0) {
-
-2216
- `tSAlgAdjuMsg
-(
-pSMsg
-,
-pSMsgEnd
-,
-
-2217
-wSL
-,
-dSL
-);
-
-2221 if(
-tmpPt
-)
-
-2222
- `y
-(
-pSMsg
-,
-tmpPt
-,
- `
-(tmpPort));
-
-2225 i(
-wSL
- >
-dSL
-)
-
-2226 *
-diffL
- =
-wSL
- -
-dSL
-;
-
-2228 
-pSMsg
-;
-
-2229
- }
-}
-
-2231 *
- $tSAlgAdjuMsg
-(*
-pSMsg
-, **
-pSMsgEnd
-,
-
-2232
-ut32_t
-
-wSL
-, ut32_
-dSL
-)
-
-2234 
-MsgBufr
-[
-MAX_SIP_UDP_MSG_SIZE
-];
-
-2236 i(
-wSL
- >
-dSL
-) {
-
-2237
-pSMsg
- +
-dSL
-;
-
-2238 
-msgL
- = *
-pSMsgEnd
- -
-pSMsg
-;
-
-2240
- `y
-(
-MsgBufr
-,
-pSMsg
-,
-msgL
-);
-
-2241
-pSMsg
- +(
-wSL
- -
-dSL
-);
-
-2242
- `y
-(
-pSMsg
-,
-MsgBufr
-,
-msgL
-);
-
-2244 i(
-ALG_DEBUG
-)
-
-2245
- `tf
-("tSAlgAdjuMsg: %u\n",
-msgL
-);
-
-2248 *
-pSMsgEnd
- +(
-wSL
- -
-dSL
-);
-
-2251
- `memt
-(
-pSMsg
-, ' ',
-dSL
-);
-
-2254 
-pSMsg
-;
-
-2255
- }
-}
-
- @VIL/alg/lib_sip_alg.h
-
-17 #ide
-__INCLUDE_LIB_ALG_H__
-
-
-18 
- #__INCLUDE_LIB_ALG_H__
-
-
- )
-
-20 
- ~"e_h.h
-"
-
-22
-ut16_t
-
- gs_ssi_numb
-;
-
-23 
- #IS_STRING_SAME
-(
-pS
-,
-rId
-(
- `bcmp
-(S), sId,
- `
-(rId)=0)
-
- )
-
-24 
- #TAG_TO_DATAPOS
-(
-r
-(
- `
-(r+ 1)
-
- )
-
-25 
- #SKIP_SPACES
-(
-pS
-) \
-
-27 *(*)(
-pS
-) == ' ') \
-
-28 (*)(
-pS
-)++; \
-
-29 }
-
- )
-
-31
- epkt_d
- {
- mPRIVATE
-,
- mPUBLIC
-};
-
-34
- es_g__dei
- {
-
-35
- mSIP_CALL_INCOMING
-,
-
-36
- mSIP_CALL_OUTGOING
-
-
-40
- es_g_pt_ty
- {
-
-41
- mSIP_UDP
-,
-
-42
- mSIP_RTP
-,
-
-43
- mSIP_RTCP
-
-
-50 
- ss_g_key
- {
-
-55
-ut32_t
-
- m_addss
-;
-
-56
-ut16_t
-
- ml4pt
-;
-
-57
-ut8_t
-
- mfr1
-;
-
-58
-ut8_t
-
- mfr2
-;
-
-65 
- ss_g_b_y
- {
-
-66
-ut32_t
-
- m_addss
-;
-
-71
-ut16_t
-
- ml4pt
-;
-
-72
-ut8_t
-
- ms_g__dei
-;
-
-74
-ut8_t
-
- ms_g__id
-[100];
-
-75
-ut8_t
-
- ml4pt_ty
-;
-
-76
-ut8_t
-
- mfr1
-;
-
-77
-ut16_t
-
- mfr2
-;
-
-78
-ut32_t
-
- mfr3
-;
-
-79 }
- g__e_che_igd
-;
-
-94 
-lib_s_g_
-();
-
-117 
-s_g_dpi
-(
-e_mbuf
- *
-pkt
-,
-pkt_d
-
-pkt_dei
-,
-
-118
-ut32_t
-
-modIp
-,
-ut16_t
-
-modL4Pt
-,
-
-119
-ut32_t
-
-pubIp
-,
-ut16_t
-
-pubL4Pt
-,
-
-120
-ut16_t
-
-modRPt
-, ut16_
-modRtPt
-);
-
-133 
-tSAlgGAudioPts
-(
-
-134 
-e_mbuf
- *
-pkt
-,
-
-135
-ut16_t
- *
-pPt
-,
-
-136
-ut16_t
- *
-_pt
-);
-
-137 
-tSAlgMsgFldPos
-(
-
-138 *
-pDa
-,
-
-139 cڡ *
-pIdS
-,
-
-140 *
-pos
-,
-
-141 
-chL
-);
-
-142 
-tSAlgMsgFldPosFdCf
-(
-
-143 *
-pDa
-,
-
-144 cڡ *
-pIdS
-,
-
-145 *
-pPos
-,
-
-146 
-chL
-);
-
-147 
-tSAlgMsgFldPosFdS
-(
-
-148 *
-pDa
-,
-
-149 cڡ *
-pIdS
-,
-
-150 *
-pPos
-,
-
-151 
-chL
-);
-
-152 
-move_s_g_y
-(
-
-153
-ut32_t
-
-addr
-,
-
-154
-ut16_t
-
-ptid
-);
-
- @VIL/conntrack/rte_cnxn_tracking.c
-
-17 
- ~<e_h.h
->
-
-18 
- ~<e_etch.h
->
-
-19 
- ~<e_cyes.h
->
-
-20 
- ~<e_mloc.h
->
-
-21 
- ~<e_memy.h
->
-
-22 
- ~<e_tim.h
->
-
-23 
- ~<e_lock.h
->
-
-24 
- ~"e_xn_ackg.h
-"
-
-25 
- ~"e__t.h
-"
-
-27 
- #CNXN_TRX_DEBUG
- 0
-
- )
-
-28 
- #TESTING_TIMERS
- 0
-
- )
-
-29 
- #RTE_CT_TIMER_EXPIRED_DUMP
- 0
-
- )
-
-31 
- #META_DATA_OFFSET
- 128
-
- )
-
-32 
- #ETHERNET_START
- (
-META_DATA_OFFSET
- +
-RTE_PKTMBUF_HEADROOM
-)
-
- )
-
-33 
- #ETH_HDR_SIZE
- 14
-
- )
-
-34 
- #IP_START
- (
-ETHERNET_START
- +
-ETH_HDR_SIZE
-)
-
- )
-
-35 
- #PROTOCOL_START
- (
-IP_START
- + 9)
-
- )
-
-36 
- #SRC_ADDR_START
- (
-IP_START
- + 12)
-
- )
-
-37 
- #TCP_START
- (
-IP_START
- + 20)
-
- )
-
-40 
- #PROTOCOL_START_IPV6
- (
-IP_START
- + 6)
-
- )
-
-41 
- #SRC_ADDR_START_IPV6
- (
-IP_START
- + 8)
-
- )
-
-42 
- #TCP_START_IPV6
- (
-IP_START
- + 40)
-
- )
-
-44 
- #TCP_PROTOCOL
- 6
-
- )
-
-45 
- #UDP_PROTOCOL
- 17
-
- )
-
-46 
- #TCP_FW_IPV4_KEY_SIZE
- 16
-
- )
-
-48 
- #TCP_FW_IPV6_KEY_SIZE
- 40
-
- )
-
-50 
- #IPv4_HEADER_SIZE
- 20
-
- )
-
-51 
- #IPv6_HEADER_SIZE
- 40
-
- )
-
-53 
- #IP_VERSION_4
- 4
-
- )
-
-54 
- #IP_VERSION_6
- 6
-
- )
-
-57
-e__xn_ack_bch_lookup_basic_ty
-(
-
-58 
-e__xn_ack
- *
-
-,
-
-59 
-e_mbuf
- **
-pkts
-,
-
-60
-ut64_t
- *
-pkts_mask
-,
-
-61
-ut64_t
-
-no_w_xn_mask
-,
-
-62
-ut64_t
- *
-y_pkt_mask
-,
-
-63
-ut64_t
- *
-hijack_mask
-,
-
-64
-ut8_t
-
-_hdr_size_bys
-);
-
-74
- $e__xn_t_pkt
-(
-e_mbuf
- *
-pkt
-,
-ut8_t
-
-ty
-)
-
-76 
-i
-;
-
-77
-ut8_t
- *
-rd
- =
- `RTE_MBUF_METADATA_UINT8_PTR
-(
-pkt
-,
-IP_START
-);
-
-79
- `tf
-("\n");
-
-80
- `tf
-("IPnd TCP/UDP headers:\n");
-
-82 i(
-ty
- =
-IP_VERSION_4
-) {
-
-83 
-i
- = 0; i < 40; i++) {
-
-84
- `tf
-("%02x ",
-rd
-[
-i
-]);
-
-85 i((
-i
- & 3) == 3)
-
-86
- `tf
-("\n");
-
-88
- `tf
-("\n");
-
-91 i(
-ty
- =
-IP_VERSION_6
-) {
-
-92 
-i
- = 0; i < 60; i++) {
-
-93
- `tf
-("%02x ",
-rd
-[
-i
-]);
-
-94 i((
-i
- & 3) == 3)
-
-95
- `tf
-("\n");
-
-97
- `tf
-("\n");
-
-100
- }
-}
-
-103
- $e_xn__ty
-(
-ut8_t
- *
-ty
-, 
-e_mbuf
- *
-pkt
-)
-
-106 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-pkt
-);
-
-108 i(
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-)
-
-109 *
-ty
- =
-IP_VERSION_4
-;
-
-111 i(
-_hdr_size_bys
- =
-IPv6_HEADER_SIZE
-)
-
-112 *
-ty
- =
-IP_VERSION_6
-;
-
-113
- }
-}
-
-116
- $e__t_hashkey
-(
-ut32_t
- *
-key
-)
-
-118
- `tf
-("Key: %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x \\\n",
-
-119
-key
-[0], key[1], key[2], key[3],
-
-120
-key
-[4], key[5], key[6], key[7], key[8], key[9]);
-
-121
- }
-}
-
-133
-ut8_t
-
-
-134
- $e___xn_hashkey
-(
-
-135
-ut32_t
- *
-c_addr
-,
-
-136
-ut32_t
- *
-d_addr
-,
-
-137
-ut16_t
-
-c_pt
-,
-
-138
-ut16_t
-
-d_pt
-,
-
-139
-ut8_t
-
-o
-,
-
-140
-ut32_t
- *
-key
-,
-
-141
-ut8_t
-
-ty
-)
-
-143
-ut8_t
-
-hash_d_ig_dei
- = 1;
-
-145
-key
-[9] =
-o
-;
-
-147 i(
-ty
- =
-IP_VERSION_4
-) {
-
-148
-ut32_t
-
-sour
- = *
-c_addr
-;
-
-149
-ut32_t
-
-de
- = *
-d_addr
-;
-
-151
-key
-[3] = key[4] = key[5] = key[6] = key[7] = key[8] = 0;
-
-153 i((
-sour
- <
-de
-)
-
-154 || ((
-sour
- =
-de
-&& (
-c_pt
- <
-d_pt
-))) {
-
-155
-key
-[0] =
-sour
-;
-
-156
-key
-[1] =
-de
-;
-
-157
-key
-[2] = (
-c_pt
- << 16|
-d_pt
-;
-
-159
-key
-[0] =
-de
-;
-
-160
-key
-[1] =
-sour
-;
-
-161
-key
-[2] = (
-d_pt
- << 16|
-c_pt
-;
-
-162
-hash_d_ig_dei
- = 0;
-
-166 i(
-ty
- =
-IP_VERSION_6
-) {
-
-167 
-_cmp
- =
- `memcmp
-(
-c_addr
-,
-d_addr
-, 16);
-
-168
-ut32_t
- *
-lo_addr
-;
-
-169
-ut32_t
- *
-hi_addr
-;
-
-171 i((
-_cmp
- < 0|| ((_cm=0&& (
-c_pt
- <
-d_pt
-))) {
-
-172
-lo_addr
- =
-c_addr
-;
-
-173
-hi_addr
- =
-d_addr
-;
-
-174
-key
-[8] = (
-c_pt
- << 16|
-d_pt
-;
-
-176
-lo_addr
- =
-d_addr
-;
-
-177
-hi_addr
- =
-c_addr
-;
-
-178
-key
-[8] = (
-d_pt
- << 16|
-c_pt
-;
-
-179
-hash_d_ig_dei
- = 0;
-
-181
-key
-[0] =
-lo_addr
-[0];
-
-182
-key
-[1] =
-lo_addr
-[1];
-
-183
-key
-[2] =
-lo_addr
-[2];
-
-184
-key
-[3] =
-lo_addr
-[3];
-
-185
-key
-[4] =
-hi_addr
-[0];
-
-186
-key
-[5] =
-hi_addr
-[1];
-
-187
-key
-[6] =
-hi_addr
-[2];
-
-188
-key
-[7] =
-hi_addr
-[3];
-
-191 #ifde
-ALGDBG
-
-
-192
- `e__t_hashkey
-(
-key
-);
-
-194 
-hash_d_ig_dei
-;
-
-195
- }
-}
-
-199
- $e__g_IP_hdr_size
-(
-e_mbuf
- *
-pkt
-)
-
-207
-ut8_t
-
-hdr_chk
- =
- `RTE_MBUF_METADATA_UINT8
-(
-pkt
-,
-IP_START
-);
-
-209
-hdr_chk
- = hdr_chk >> 4;
-
-211 i(
-hdr_chk
- =
-IP_VERSION_4
-)
-
-212 
-IPv4_HEADER_SIZE
-;
-
-214 i(
-hdr_chk
- =
-IP_VERSION_6
-)
-
-215 
-IPv6_HEADER_SIZE
-;
-
-224
- }
-}
-
-227
- $e__t_tim_f_w_xn
-(
-
-228 
-e__xn_ack
- *
-
-,
-
-229 
-e__xn_da
- *
-cd
-)
-
-231
-cd
-->
-e_ud_f_tim
- =
-RTE_CT_TCP_NONE
-;
-
-232
- `e__t_xn_tim_f_t
-(
-
-,
-cd
-,
-RTE_CT_TCP_SYN_SENT
-);
-
-233
- }
-}
-
-264 
-le
- 
-
-265
- $e__memb_w_ci
-(
-
-266 
-e__xn_ack
- *
-
-,
-
-267 
-e__xn_da
- *
-y
-)
-
-269
-
-->
-ϋ_ci
-++;
-
-270
-
-->
-w_cis
-[->
-ϋ_ci
-] =
-y
-;
-
-271
- }
-}
-
-273 
-e__xn_da
- *
-
-274
- $e__ch_w_cis
-(
-e__xn_ack
- *
-
-,
-ut32_t
- *
-key
-)
-
-276 
-i
-;
-
-278 
-i
- = 0; i <
-
-->
-ϋ_ci
-; i++) {
-
-279
-ut32_t
- *
-xn_key
- =
-
-->
-w_cis
-[
-i
-]->
-key
-;
-
-280 
-key_cmp
- =
- `memcmp
-(
-xn_key
-,
-key
-,
-
-281 (
-
-->
-w_cis
-[
-i
-]->
-key
-));
-
-283 i(
-key_cmp
- == 0)
-
-284 
-
-->
-w_cis
-[
-i
-];
-
-286 
-NULL
-;
-
-287
- }
-}
-
-289 
-le
- 
- $e__fg_w_cis
-(
-e__xn_ack
- *
-
-)
-
-291
-
-->
-ϋ_ci
- = -1;
-
-292
- }
-}
-
-297 
-e__ck_ai
-
-
-298
- $e__hd_t_lookup
-(
-
-299 
-e__xn_ack
- *
-
-,
-
-300 
-e_mbuf
- *
-ck
-,
-
-301
-ut8_t
-
-pkt_num
-,
-
-302
-ut8_t
-
-key_is__d
-,
-
-303
-ut32_t
- *
-key
-,
-
-304 
-hash_b_y
-,
-
-305 
-no_w_xn
-,
-
-306
-ut8_t
-
-_hdr_size_bys
-)
-
-308 
-e__xn_da
-
-w_xn_da
-;
-
-310
- `memt
-(&
-w_xn_da
-, 0, (
-e__xn_da
-));
-
-311
-e__ck_ai
-
-ck_ai
-;
-
-313 #ifde
-CT_CGNAT
-
-
-314
-t32_t
-
-posi
- =
-hash_b_y
-;
-
-315
-
-->
-posis
-[
-pkt_num
-] =
-posi
-;
-
-319 i(
-hash_b_y
- >= 0) {
-
-325 
-e__xn_da
- *
-y
- =
-
-326 &
-
-->
-hash_b_s
-[
-hash_b_y
-];
-
-328
-ck_ai
- =
- `e__vify_t_ck
-(
-
-,
-y
-,
-ck
-,
-
-329
-key_is__d
-,
-_hdr_size_bys
-);
-
-331 
-ck_ai
-) {
-
-333 
-RTE_CT_FORWARD_PACKET
-:
-
-334
-y
-->
-cous
-.
-cks_fwded
-++;
-
-337 
-RTE_CT_DROP_PACKET
-:
-
-338
-y
-->
-cous
-.
-cks_drݳd
-++;
-
-339 
-RTE_CT_DROP_PACKET
-;
-
-341 
-RTE_CT_REOPEN_CNXN_AND_FORWARD_PACKET
-:
-
-348 i(
- `e__t_w_ci
-(
-
-, &
-w_xn_da
-,
-
-349
-ck
-, 0,
-_hdr_size_bys
-) !=
-
-350
-RTE_CT_DROP_PACKET
-) {
-
-351
- `e_memy
-(&
-y
-->
-_oc
-.
-t__da
-,
-
-352 &
-w_xn_da
-.
-_oc
-.
-t__da
-,
-
-353 (
-w_xn_da
-.
-_oc
-.
-t__da
-));
-
-354
- `e__t_tim_f_w_xn
-(
-
-,
-y
-);
-
-355 i(
-
-->
-cous
-->
-ssis_aived
- > 0)
-
-356
-
-->
-cous
-->
-ssis_aived
---;
-
-361 
-RTE_CT_SEND_SERVER_SYN
-:
-
-362
-
-->
-cous
-->
-pkts_fwded
-++;
-
-364 
-RTE_CT_SEND_SERVER_SYN
-;
-
-366 
-RTE_CT_SEND_SERVER_ACK
-:
-
-367
-
-->
-cous
-->
-pkts_fwded
-++;
-
-369 
-RTE_CT_SEND_SERVER_ACK
-;
-
-371 
-RTE_CT_HIJACK
-:
-
-372
-
-->
-cous
-->
-pkts_fwded
-++;
-
-376 
-RTE_CT_HIJACK
-;
-
-378 
-RTE_CT_DESTROY_CNXN_AND_FORWARD_PACKET
-:
-
-396 i(
- `e_hash_d_key
-(
-
-->
-rhash
-,
-y
-->
-key
-) >= 0) {
-
-407
-
-->
-cous
-->
-ssis_od
-++;
-
-408 i(
-
-->
-cous
-->
-cut_aive_ssis
- > 0)
-
-409
-
-->
-cous
-->
-cut_aive_ssis
---;
-
-410
- `e__nl_xn_tim
-(
-y
-);
-
-412
-y
-->
-cous
-.
-cks_fwded
-++;
-
-420 
-e__xn_da
- *
-w_hash_y
-;
-
-422 i(
-no_w_xn
-) {
-
-423
-
-->
-cous
-->
-pkts_dr_vid_cn
-++;
-
-424 
-RTE_CT_DROP_PACKET
-;
-
-427
-ck_ai
- =
- `e__t_w_ci
-(
-
-, &
-w_xn_da
-,
-
-428
-ck
-,
-
-->
-misc_tis
-.
-syroxy_abd
-,
-
-429
-_hdr_size_bys
-);
-
-431 i(
- `uiky
-(
-ck_ai
- =
-RTE_CT_DROP_PACKET
-)) {
-
-432
-
-->
-cous
-->
-pkts_dr_vid_cn
-++;
-
-433 
-RTE_CT_DROP_PACKET
-;
-
-437
-t32_t
-
-posi
- =
- `e_hash_add_key
-(
-
-->
-rhash
-,
-key
-);
-
-438 i(
-posi
- < 0) {
-
-439
-tf
-
-
-441
-posi
-,
-pkt_num
-);
-
-442 
-RTE_CT_DROP_PACKET
-;
-
-444 #ifde
-CT_CGNAT
-
-
-445
-
-->
-posis
-[
-pkt_num
-] =
-posi
-;
-
-447
-w_hash_y
- = &
-
-->
-hash_b_s
-[
-posi
-];
-
-451
- `memy
-(
-w_xn_da
-.
-key
-, key, (new_cnxn_data.key));
-
-452
-w_xn_da
-.
-key_is__d
- = key_is_client_order;
-
-453
-w_xn_da
-.
-oc
- =
-TCP_PROTOCOL
-;
-
-454
- `e_xn__ty
-(&
-w_xn_da
-.
-ty
-,
-ck
-);
-
-455
- `e_memy
-(
-w_hash_y
-, &
-w_xn_da
-,
-
-456 (
-e__xn_da
-));
-
-457
-w_hash_y
-->
-cous
-.
-cks_fwded
- = 1;
-
-458
-w_hash_y
-->
-cous
-.
-cks_drݳd
- = 0;
-
-459
-
-->
-cous
-->
-cut_aive_ssis
-++;
-
-460
-
-->
-cous
-->
-ssis_aived
-++;
-
-462 i(
-ck_ai
- =
-RTE_CT_SEND_CLIENT_SYNACK
-) {
-
-466
- `e__r_tis
-(
-ck
-,
-w_hash_y
-);
-
-473
- `e__cvt_to_ood__syck
-(
-w_hash_y
-,
-
-474
-ck
-);
-
-481
-ck_ai
- =
- `e__vify_t_ck
-(
-
-,
-
-482
-w_hash_y
-,
-ck
-,
-
-483 !
-key_is__d
-,
-
-484
-_hdr_size_bys
-);
-
-486 i(
- `uiky
-(
-ck_ai
- !
-RTE_CT_FORWARD_PACKET
-)) {
-
-488
- `tf
-("Seriousrror in synproxy generating ");
-
-489
- `tf
-("SYN/ACK\n");
-
-490 
-RTE_CT_DROP_PACKET
-;
-
-492
-
-->
-cous
-->
-pkts_fwded
-++;
-
-494 
-RTE_CT_SEND_CLIENT_SYNACK
-;
-
-496
- `e__t_tim_f_w_xn
-(
-
-,
-w_hash_y
-);
-
-508
-
-->
-cous
-->
-pkts_fwded
-++;
-
-509 
-RTE_CT_FORWARD_PACKET
-;
-
-510
- }
-}
-
-512 
-ut64_t
-
-
-513
- $e__xn_ack_bch_lookup_basic
-(
-
-514 
-e__xn_ack
- *
-
-,
-
-515 
-e_mbuf
- **
-pkts
-,
-
-516
-ut64_t
-
-pkts_mask
-,
-
-517
-ut64_t
-
-no_w_xn_mask
-,
-
-518
-ut64_t
- *
-y_pkt_mask
-,
-
-519
-ut64_t
- *
-hijack_mask
-)
-
-522
-ut64_t
-
-pkts_to_oss
- =
-pkts_mask
-;
-
-524
-ut64_t
-
-vid_cks
- =
-pkts_mask
-;
-
-525
-ut8_t
-
-comg_m
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-527
-ut8_t
-
-key_ig_d
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-528
-ut32_t
-
-cks_f_lookup
- = 0;
-
-529
-t32_t
-
-posis
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-530
-ut32_t
-
-i
-;
-
-531 
-e__xn_da
-
-w_xn_da
-;
-
-533 i(
-CNXN_TRX_DEBUG
- > 1) {
-
-534
- `tf
-("E cnxack %p",
-
-);
-
-535
- `tf
-(" synproxy batchookup withacket mask %p\n",
-
-536 (*)
-pkts_mask
-);
-
-539
- `e__fg_w_cis
-(
-
-);
-
-540 *
-y_pkt_mask
- = 0;
-
-541 *
-hijack_mask
- = 0;
-
-548 ;
-pkts_to_oss
-;) {
-
-549
-ut8_t
-
-pos
- = (ut8_t
- `__but_z
-(
-pkts_to_oss
-);
-
-551
-ut64_t
-
-pkt_mask
- = 1LLU <<
-pos
-;
-
-553
-pkts_to_oss
- &~
-pkt_mask
-;
-
-555 
-e_mbuf
- *
-pkt
- =
-pkts
-[
-pos
-];
-
-557 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-pkt
-);
-
-559 i(
- `uiky
-(
-_hdr_size_bys
- < 0)) {
-
-564 *
-_hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-569 
-t_hdr
- *
-thdr
- =
-
-570 (
-t_hdr
- *)
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-571 (
-IP_START
- +
-_hdr_size_bys
-));
-
-572
-ut16_t
-
-c_pt
- =
- `e_bsw16
-(
-thdr
-->src_port);
-
-573
-ut16_t
-
-d_pt
- =
- `e_bsw16
-(
-thdr
-->dst_port);
-
-575 i(
-_hdr_size_bys
- =
-IPv4_HEADER_SIZE
-) {
-
-576 
-v4_hdr
- *
-ihdr
- = (v4_hd*)
-_hdr
-;
-
-577
-ut8_t
-
-o
- =
-ihdr
-->
-xt_o_id
-;
-
-579 i(!(
-o
- =
-TCP_PROTOCOL
- ||r=
-UDP_PROTOCOL
-)) {
-
-590
-ut32_t
-
-c_addr
- =
- `e_bsw32
-(
-ihdr
-->src_addr);
-
-591
-ut32_t
-
-d_addr
- =
- `e_bsw32
-(
-ihdr
-->dst_addr);
-
-593 i(
-CNXN_TRX_DEBUG
- > 2) {
-
-594 i(
-CNXN_TRX_DEBUG
- > 4)
-
-595
- `e__xn_t_pkt
-(
-pkt
-,
-
-596
-IP_VERSION_4
-);
-
-602
-comg_m
-[
-cks_f_lookup
-] =
-pos
-;
-
-603
-key_ig_d
-[
-cks_f_lookup
-] =
-
-604
- `e___xn_hashkey
-(&
-c_addr
-, &
-d_addr
-,
-
-605
-c_pt
-,
-d_pt
-,
-
-606
-o
-,
-
-607 &
-
-->
-hash_keys
-
-
-608 [
-cks_f_lookup
-][0],
-
-609
-IP_VERSION_4
-);
-
-610
-cks_f_lookup
-++;
-
-613 i(
-_hdr_size_bys
- =
-IPv6_HEADER_SIZE
-) {
-
-614 
-v6_hdr
- *
-ihdr
- = (v6_hd*)
-_hdr
-;
-
-615
-ut8_t
-
-o
- =
-ihdr
-->proto;
-
-617 i(!(
-o
- =
-TCP_PROTOCOL
- ||r=
-UDP_PROTOCOL
-)) {
-
-622 i(
-CNXN_TRX_DEBUG
- > 2) {
-
-623 i(
-CNXN_TRX_DEBUG
- > 4)
-
-624
- `e__xn_t_pkt
-(
-pkt
-,
-
-625
-IP_VERSION_6
-);
-
-632
-comg_m
-[
-cks_f_lookup
-] =
-pos
-;
-
-633
-key_ig_d
-[
-cks_f_lookup
-] =
-
-634
- `e___xn_hashkey
-(
-
-635 (
-ut32_t
- *
-ihdr
-->
-c_addr
-,
-
-636 (
-ut32_t
- *
-ihdr
-->
-d_addr
-,
-
-637
-c_pt
-,
-d_pt
-,
-
-638
-o
-,
-
-639 &
-
-->
-hash_keys
-
-
-640 [
-cks_f_lookup
-][0],
-
-641
-IP_VERSION_6
-);
-
-642
-cks_f_lookup
-++;
-
-647 i(
- `uiky
-(
-cks_f_lookup
- == 0))
-
-648 
-vid_cks
-;
-
-651
- `memt
-(&
-w_xn_da
-, 0, (
-e__xn_da
-));
-
-655 
-lookup_su
- =
-
-656
- `e_hash_lookup_bulk
-(
-
-->
-rhash
-, (cڡ **)&->
-hash_key_rs
-,
-
-657
-cks_f_lookup
-, &
-posis
-[0]);
-
-659 i(
- `uiky
-(
-lookup_su
- < 0)) {
-
-661
- `tf
-("Unexpected hashableroblem, discardingllackets");
-
-664 #ifde
-ALGDBG
-
-
-665 
-i
- = 0; i <
-cks_f_lookup
-; i++) {
-
-666 i(
-posis
-[
-i
-] >= 0)
-
-667
- `tf
-("@CTositions[i]= %d, compacting_map[i]= %d\n",
-
-668
-posis
-[
-i
-],
-comg_m
-[i]);
-
-671 
-i
- = 0; i <
-cks_f_lookup
-; i++) {
-
-673 
-hash_b_y
- =
-posis
-[
-i
-];
-
-675
-ut8_t
-
-pkt_dex
- =
-comg_m
-[
-i
-];
-
-677
-ut64_t
-
-pkt_mask
- = 1LLU <<
-pkt_dex
-;
-
-678
-ut8_t
-
-key_is__d
- =
-key_ig_d
-[
-i
-];
-
-679
-ut32_t
- *
-key
- =
-
-->
-hash_key_rs
-[
-pkt_dex
-];
-
-680
-ut8_t
-
-oc
- = *(
-key
- + 9);
-
-681 
-e_mbuf
- *
-ck
- =
-pkts
-[
-pkt_dex
-];
-
-682 
-no_w_xn
- = (
-pkt_mask
- &
-no_w_xn_mask
-) != 0;
-
-686 i(
-oc
- =
-TCP_PROTOCOL
-) {
-
-687
-e__ck_ai
-
-t_pkt_ai
-;
-
-689 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-ck
-);
-
-690
-t_pkt_ai
- =
- `e__hd_t_lookup
-(
-
-,
-ck
-,
-
-691
-pkt_dex
-,
-key_is__d
-,
-
-692
-key
-,
-hash_b_y
-,
-no_w_xn
-,
-
-693
-_hdr_size_bys
-);
-
-695 
-t_pkt_ai
-) {
-
-697 
-RTE_CT_SEND_CLIENT_SYNACK
-:
-
-698 
-RTE_CT_SEND_SERVER_ACK
-:
-
-702 *
-y_pkt_mask
- |
-pkt_mask
-;
-
-705 
-RTE_CT_SEND_SERVER_SYN
-:
-
-706 
-RTE_CT_FORWARD_PACKET
-:
-
-709 
-RTE_CT_HIJACK
-:
-
-710 *
-hijack_mask
- |
-pkt_mask
-;
-
-715
-vid_cks
- ^
-pkt_mask
-;
-
-716
-
-->
-cous
-->
-pkts_dr
-++;
-
-723 i(
-hash_b_y
- >= 0) {
-
-729 
-e__xn_da
- *
-y
- =
-
-730 &
-
-->
-hash_b_s
-[
-hash_b_y
-];
-
-732 i(
-e__udp_ck
-
-
-733 (
-
-,
-y
-,
-pkts
-[
-pkt_dex
-],
-
-734
-key_is__d
-)) {
-
-735
-y
-->
-cous
-.
-cks_fwded
-++;
-
-736
-
-->
-cous
-->
-pkts_fwded
-++;
-
-744 
-e__xn_da
- *
-_y
- =
-
-745
- `e__ch_w_cis
-(
-
-,
-key
-);
-
-747 i(
-_y
- !
-NULL
-) {
-
-748 i(
- `e__udp_ck
-(
-
-,
-_y
-,
-
-749
-pkts
-[
-pkt_dex
-],
-
-750
-key_is__d
-)) {
-
-751
-_y
-->
-cous
-.
-
-752
-cks_fwded
-++;
-
-753
-
-->
-cous
-->
-pkts_fwded
-++;
-
-760 i(
-no_w_xn
-) {
-
-764
-vid_cks
- ^
-pkt_mask
-;
-
-765
-
-->
-cous
-->
-pkts_dr
-++;
-
-766
-
-->
-cous
-->
-
-767
-pkts_dr_vid_cn
-++;
-
-771 i(
- `e__udp_w_ci
-(
-
-,
-
-772 &
-w_xn_da
-,
-
-773
-pkts
-[
-pkt_dex
-])) {
-
-777
-t32_t
-
-posi
- =
-
-778
- `e_hash_add_key
-(
-
-779
-
-->
-rhash
-,
-key
-);
-
-781 i(
-posi
- < 0)
-
-784 
-e__xn_da
-
-
-785 *
-w_hash_y
- = &
-
-->
-
-786
-hash_b_s
-[
-posi
-];
-
-793
- `memy
-(
-w_xn_da
-.
-key
-, key,
-
-794 (
-w_xn_da
-.
-key
-));
-
-796
-w_xn_da
-.
-
-797
-key_is__d
-
-
-798
-key_is__d
-;
-
-799
-w_xn_da
-.
-oc
- =
-
-800
-UDP_PROTOCOL
-;
-
-801
- `e_xn__ty
-(
-
-802 &
-w_xn_da
-.
-ty
-,
-
-803
-ck
-);
-
-804
- `e_memy
-(
-w_hash_y
-,
-
-805 &
-w_xn_da
-,
-
-807
-e__xn_da
-));
-
-809
-w_hash_y
-->
-cous
-.
-
-810
-cks_fwded
- = 1;
-
-811
-
-->
-cous
-->
-pkts_fwded
-++;
-
-812
-w_hash_y
-->
-cous
-.
-
-813
-cks_drݳd
- = 0;
-
-814
-
-->
-cous
-->
-pkts_dr
- = 0;
-
-815
-
-->
-cous
-->
-
-816
-cut_aive_ssis
-++;
-
-817
-
-->
-cous
-->
-
-818
-ssis_aived
-++;
-
-820
-w_hash_y
-->
-
-821
-e_ud_f_tim
-
-
-822
-RTE_CT_UDP_NONE
-;
-
-823
- `e__t_xn_tim_f_udp
-(
-
-824
-
-,
-
-825
-w_hash_y
-,
-
-826
-RTE_CT_UDP_UNREPLIED
-);
-
-828
- `e__memb_w_ci
-(
-
-829
-
-,
-
-830
-w_hash_y
-);
-
-839 i(
-CNXN_TRX_DEBUG
- > 1) {
-
-840
- `tf
-("Exit cnxnracker synproxy batchookup with");
-
-841
- `tf
-("ack mask %p\n", (*)
-vid_cks
-);
-
-844 
-vid_cks
-;
-
-845
- }
-}
-
-847
-ut64_t
-
-
-848
- $e__xn_ack_bch_lookup_wh_syroxy
-(
-
-849 
-e__xn_ack
- *
-
-,
-
-850 
-e_mbuf
- **
-pkts
-,
-
-851
-ut64_t
-
-pkts_mask
-,
-
-852 
-e_syroxy_hr
- *
-_hr
-)
-
-854 
- `e__xn_ack_bch_lookup_basic
-(
-
-,
-pkts
-,
-pkts_mask
-, 0,
-
-855 &
-_hr
-->
-y_pkt_mask
-, &_hr->
-hijack_mask
-);
-
-856
- }
-}
-
-857 #ifde
-CT_CGNAT
-
-
-858
-ut64_t
-
- $cgDZ__oss
-(
-
-859 
-e__xn_ack
- *
-
-,
-
-860 
-e_mbuf
- **
-pkts
-,
-
-861
-ut64_t
-
-pkts_mask
-,
-
-862 
-e_CT_hr
- *
-_hr
-)
-
-865
- `e__dib_syroxy
-(
-
-);
-
-866 
- `e__xn_ack_bch_lookup_basic
-(
-
-,
-pkts
-,
-pkts_mask
-,
-
-867
-_hr
-->
-no_w_xn_mask
-,
-
-868 &
-_hr
-->
-y_pkt_mask
-,
-
-869 &
-_hr
-->
-hijack_mask
-);
-
-870
- }
-}
-
-872
-ut64_t
-
-
-873
- $e__xn_ack_bch_lookup
-(
-
-874 
-e__xn_ack
- *
-
-,
-
-875 
-e_mbuf
- **
-pkts
-,
-
-876
-ut64_t
-
-pkts_mask
-,
-
-877 
-e_CT_hr
- *
-_hr
-)
-
-880 
- `e__xn_ack_bch_lookup_basic
-(
-
-,
-pkts
-,
-pkts_mask
-,
-
-881
-_hr
-->
-no_w_xn_mask
-,
-
-882 &
-_hr
-->
-y_pkt_mask
-, &_hr->
-hijack_mask
-);
-
-883
- }
-}
-
-886 
- $e__xn_ack_bch_lookup_ty
-(
-
-887 
-e__xn_ack
- *
-
-,
-
-888 
-e_mbuf
- **
-pkts
-,
-
-889
-ut64_t
- *
-pkts_mask
-,
-
-890 
-e_CT_hr
- *
-_hr
-,
-
-891
-ut8_t
-
-_hdr_size_bys
-)
-
-894
- `e__xn_ack_bch_lookup_basic_ty
-(
-
-,
-pkts
-,
-pkts_mask
-,
-
-895
-_hr
-->
-no_w_xn_mask
-,
-
-896 &
-_hr
-->
-y_pkt_mask
-, &_hr->
-hijack_mask
-,
-
-897
-_hdr_size_bys
-);
-
-898
- }
-}
-
-902
-ut64_t
-
-
-903
- $e__xn_ack_bch_lookup_wh_w_xn_cڌ
-(
-
-904 
-e__xn_ack
- *
-
-,
-
-905 
-e_mbuf
- **
-pkts
-,
-
-906
-ut64_t
-
-pkts_mask
-,
-
-907
-ut64_t
-
-no_w_xn_mask
-)
-
-909
-ut64_t
-
-dt_
-;
-
-911 
- `e__xn_ack_bch_lookup_basic
-(
-
-,
-pkts
-,
-pkts_mask
-,
-
-912
-no_w_xn_mask
-,
-
-913 &
-dt_
-, &dont_care);
-
-914
- }
-}
-
-918
- $e__lize_deu_timeouts
-(
-e__xn_ack
- *
-w_xn_ack
-)
-
-923
-ut64_t
-
-htz
- =
- `e_g_tsc_hz
-();
-
-925
-w_xn_ack
-->
-htz
- = hertz;
-
-926
-w_xn_ack
-->
-timg_cyes_r_timg_
- =
-htz
- / 10;
-
-927
-w_xn_ack
-->
-timg_100ms_s_evious
- = 0;
-
-928
-w_xn_ack
-->
-timg_100ms_s
- = 0;
-
-929
-w_xn_ack
-->
-timg_ϡ_time
- =
- `e_g_tsc_cyes
-();
-
-932
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-933 [
-RTE_CT_TCP_SYN_SENT
-] = 120 *
-htz
-;
-
-934
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-935 [
-RTE_CT_TCP_SYN_RECV
-] = 60 *
-htz
-;
-
-937
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-938 [
-RTE_CT_TCP_ESTABLISHED
-] = 60 * 60 * 24 * 5 *
-htz
-;
-
-940
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-941 [
-RTE_CT_TCP_FIN_WAIT
-] = 120 *
-htz
-;
-
-942
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-943 [
-RTE_CT_TCP_CLOSE_WAIT
-] = 60 *
-htz
-;
-
-944
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-945 [
-RTE_CT_TCP_LAST_ACK
-] = 30 *
-htz
-;
-
-946
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-947 [
-RTE_CT_TCP_TIME_WAIT
-] = 120 *
-htz
-;
-
-948
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-949 [
-RTE_CT_TCP_CLOSE
-] = 10 *
-htz
-;
-
-950
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-951 [
-RTE_CT_TCP_SYN_SENT_2
-] = 120 *
-htz
-;
-
-952
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-953 [
-RTE_CT_TCP_RETRANS
-] = 300 *
-htz
-;
-
-954
-w_xn_ack
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-
-
-955 [
-RTE_CT_TCP_UNACK
-] = 300 *
-htz
-;
-
-957
-w_xn_ack
-->
-_timeout
-.
-udimeout
-.
-udp_timeouts
-
-
-958 [
-RTE_CT_UDP_UNREPLIED
-] = 30 *
-htz
-;
-
-959
-w_xn_ack
-->
-_timeout
-.
-udimeout
-.
-udp_timeouts
-
-
-960 [
-RTE_CT_UDP_REPLIED
-] = 180 *
-htz
-;
-
-962
-w_xn_ack
-->
-misc_tis
-.
-t_max_s
- =
-
-963
-RTE_CT_TCP_MAX_RETRANS
-;
-
-964
-w_xn_ack
-->
-misc_tis
-.
-t_loo
- = 0;
-
-965
-w_xn_ack
-->
-misc_tis
-.
-t_be_lib
- = 0;
-
-966 #ifde
-CT_CGNAT
-
-
-967 
-i
-;
-
-968 
-i
-=0; i <
-RTE_HASH_LOOKUP_BULK_MAX
- ;i ++ )
-
-969
-w_xn_ack
-->
-posis
-[
-i
-] = -1;
-
-973
- }
-}
-
-975 
-e_CT_cou_block
-
- ge_CT_cou_b
-[
-MAX_CT_INSTANCES
-]
-
-976
- g__e_che_igd
-;
-
-977 
- ge_CT_hi_cou_block__u
- = -1;
-
-980
- $e__lize_xn_ack_wh_syroxy
-(
-
-981 
-e__xn_ack
- *
-w_xn_ack
-,
-
-982
-ut32_t
-
-max_ci_cou
-,
-
-983 *
-me
-,
-
-984
-ut16_t
-
-por_offt
-)
-
-986
-ut32_t
-
-i
-;
-
-987
-ut32_t
-
-size
-;
-
-988 
-e_CT_cou_block
- *
-cou_r
-;
-
-995
-w_xn_ack
-->
-por_offt
- =ointer_offset;
-
-997
- `memt
-(
-w_xn_ack
-->
-me
-, '\0', (new_cnxn_tracker->name));
-
-998
- `y
-(
-w_xn_ack
-->
-me
-,ame,
- `
-(new_cnxn_tracker->name));
-
-1001
-ut32_t
-
-numb_of_s
- =
-max_ci_cou
-;
-
-1003
-size
- =
- `RTE_CACHE_LINE_ROUNDUP
-((
-e__xn_da
-) *
-
-1004
-numb_of_s
-);
-
-1005
-w_xn_ack
-->
-hash_b_s
- =
-
-1006
- `e_zmloc
-(
-NULL
-,
-size
-,
-RTE_CACHE_LINE_SIZE
-);
-
-1007 i(
-w_xn_ack
-->
-hash_b_s
- =
-NULL
-) {
-
-1008
- `tf
-(" Notnough memory, or invalidrguments\n");
-
-1011
-w_xn_ack
-->
-num_xn_s
- =
-numb_of_s
-;
-
-1015 
-i
- = 0; i <
-numb_of_s
-; i++)
-
-1016
- `e_tim_
-(&
-w_xn_ack
-->
-hash_b_s
-[
-i
-].
-tim
-);
-
-1019 
-i
- = 0; i <
-RTE_HASH_LOOKUP_BULK_MAX
-; i++)
-
-1020
-w_xn_ack
-->
-hash_key_rs
-[
-i
-] =
-
-1021 &
-w_xn_ack
-->
-hash_keys
-[
-i
-][0];
-
-1028 i(
-e_CT_hi_cou_block__u
- =
-MAX_CT_INSTANCES
-)
-
-1031
-e_CT_hi_cou_block__u
-++;
-
-1032
-cou_r
- = &
-e_CT_cou_b
-[
-e_CT_hi_cou_block__u
-];
-
-1034
-w_xn_ack
-->
-cous
- =
-cou_r
-;
-
-1037 
-e_hash_ms
-
-rhash_rms
- = {
-
-1038 .
-me
- =ame,
-
-1039 .
-s
- =
-numb_of_s
-,
-
-1040 .
-hash_func
- =
-NULL
-,
-
-1041 .
-key_n
- = 40,
-
-1042 .
-hash_func__v
- = 0,
-
-1043 .
-sock_id
- =
- `e_sock_id
-(),
-
-1044 .
-exa_ag
- = 1
-
-1047
-w_xn_ack
-->
-rhash
- =
- `e_hash_
-(&
-rhash_rms
-);
-
-1050
- }
-}
-
-1053
- $e__lize_xn_ack
-(
-
-1054 
-e__xn_ack
- *
-w_xn_ack
-,
-
-1055
-ut32_t
-
-max_ci_cou
-,
-
-1056 *
-me
-)
-
-1058 
- `e__lize_xn_ack_wh_syroxy
-(
-w_xn_ack
-,
-
-1059
-max_ci_cou
-,
-me
-, 0);
-
-1060
- }
-}
-
-1063
- $e___xn_ack_sours
-(
-e__xn_ack
- *
-d_xn_ack
-)
-
-1065
- `e_
-(
-d_xn_ack
-->
-hash_b_s
-);
-
-1066
- `e_hash_
-(
-d_xn_ack
-->
-rhash
-);
-
-1068
- }
-}
-
-1071
- $e__g_xn_ack_size
-()
-
-1073  (
-e__xn_ack
-);
-
-1074
- }
-}
-
-1077
-e__xn_tim_exped
-(
-e_tim
- *
-
-, *
-g
-);
-
-1080
- $e__t_xn_tim
-(
-
-1081 
-e__xn_ack
- *
-
-,
-
-1082 
-e__xn_da
- *
-cd
-,
-
-1083
-ut64_t
-
-ticks_u_timeout
-)
-
-1090 
-e_tim
- *
-
- = (e_tim *)
-cd
-;
-
-1091 #ifde
-CT_CGNAT
-
-
-1093
-ut32_t
-
-ce_id
- =
- `g_tim_ce_id
-();
-
-1096
-ut32_t
-
-ce_id
- =
- `e_lce_id
-();
-
-1101 
-sucss
- =
- `e_tim_t
-(
-
-,
-ticks_u_timeout
-,
-SINGLE
-,
-ce_id
-,
-
-1102
-e__xn_tim_exped
-,
-
-);
-
-1104 i(
-sucss
- < 0) {
-
-1108
- `tf
-("CNXN_TRACKER: Failedo set connectionimer.\n");
-
-1110
- }
-}
-
-1118
- $e__t_xn_tim_f_t
-(
-
-1119 
-e__xn_ack
- *
-
-,
-
-1120 
-e__xn_da
- *
-cd
-,
-
-1121
-ut8_t
-
-t_e
-)
-
-1124
-cd
-->
-exed_timeout
- =
-
-1125 (
-
-->
-timg_100ms_s
- * ct->
-timg_cyes_r_timg_
-) +
-
-1126
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-t_e
-];
-
-1128 i(
-t_e
- =
-cd
-->
-e_ud_f_tim
-) {
-
-1141 i(
-TESTING_TIMERS
-)
-
-1142
- `tf
-("S Tim f ci %d s %s\n",
-cd
-,
-
-1143
-e__t_mes
-[
-t_e
-]);
-
-1145
- `e__t_xn_tim
-(
-
-,
-cd
-,
-
-1146
-
-->
-_timeout
-.
-
-1147
-ttimeout
-.
-t_timeouts
-[
-t_e
-]);
-
-1148
-cd
-->
-e_ud_f_tim
- =
-t_e
-;
-
-1149
- }
-}
-
-1158
- $e__t_xn_tim_f_udp
-(
-
-1159 
-e__xn_ack
- *
-
-,
-
-1160 
-e__xn_da
- *
-cd
-,
-
-1161
-ut8_t
-
-udp_e
-)
-
-1164
-cd
-->
-exed_timeout
- = (
-
-->
-timg_cyes_r_timg_
-) +
-
-1165
-
-->
-_timeout
-.
-udimeout
-.
-udp_timeouts
-[
-udp_e
-];
-
-1167 i(
-udp_e
- =
-cd
-->
-e_ud_f_tim
-) {
-
-1180 i(
-TESTING_TIMERS
-)
-
-1181
- `tf
-("S Tim f ci %d s %s\n",
-cd
-,
-
-1182
-e__udp_mes
-[
-udp_e
-]);
-
-1183
- `e__t_xn_tim
-(
-
-,
-cd
-,
-
-1184
-
-->
-_timeout
-.
-
-1185
-udimeout
-.
-udp_timeouts
-[
-udp_e
-]);
-
-1186
-cd
-->
-e_ud_f_tim
- =
-udp_e
-;
-
-1187
- }
-}
-
-1193
- $e__nl_xn_tim
-(
-e__xn_da
- *
-cd
-)
-
-1195 i(
-TESTING_TIMERS
-)
-
-1196
- `tf
-("Cancel Timer\n");
-
-1198
- `e_tim_
-(&
-cd
-->
-tim
-);
-
-1199
- }
-}
-
-1202
- $e__hd_exped_tims
-(
-e__xn_ack
- *
-
-)
-
-1209
-ut64_t
-
-w_time
- =
- `e_g_tsc_cyes
-();
-
-1210
-ut64_t
-
-time_diff
- =
-w_time
- -
-
-->
-timg_ϡ_time
-;
-
-1212 i(
-time_diff
- >
-
-->
-timg_cyes_r_timg_
-) {
-
-1213
-
-->
-timg_ϡ_time
- =
-w_time
-;
-
-1214
-
-->
-timg_100ms_s
-++;
-
-1217 i(
-
-->
-timg_100ms_s
- !->
-timg_100ms_s_evious
-) {
-
-1218
- `e_tim_mage
-();
-
-1219
-
-->
-timg_100ms_s_evious
- = ct->
-timg_100ms_s
-;
-
-1221
- }
-}
-
-1226
- $e__xn_tim_exped
-(
-e_tim
- *
-
-, *
-g
-)
-
-1231 
-e__xn_da
- *
-cd
- = (e__xn_d*)
-
-;
-
-1232 
-e__xn_ack
- *
-
- = (e__xn_ack *)
-g
-;
-
-1233 
-sucss
- = 0;
-
-1241
-ut64_t
-
-cut_time
- =
-
-->
-timg_100ms_s
- *
-
-1242
-
-->
-timg_cyes_r_timg_
-;
-
-1244 i(
-cd
-->
-exed_timeout
- >
-cut_time
-) {
-
-1245
-ut64_t
-
-time_diff
- =
-cd
-->
-exed_timeout
- -
-cut_time
-;
-
-1247
- `e__t_xn_tim
-(
-
-,
-cd
-,
-time_diff
-);
-
-1251 i(
-cd
-->
-oc
- =
-TCP_PROTOCOL
-) {
-
-1252 i(
-cd
-->
-e_ud_f_tim
- =
-RTE_CT_TCP_TIME_WAIT
- ||
-
-1253
-cd
-->
-e_ud_f_tim
- =
-RTE_CT_TCP_CLOSE
-)
-
-1254
-
-->
-cous
-->
-ssis_od
-++;
-
-1256
-
-->
-cous
-->
-ssis_timedout
-++;
-
-1261 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
-)
-
-1262
- `e__a_bufd_cks
-(
-
-,
-cd
-);
-
-1264 } i(
-cd
-->
-oc
- =
-UDP_PROTOCOL
-)
-
-1265
-
-->
-cous
-->
-ssis_od
-++;
-
-1266 i(
-
-->
-cous
-->
-cut_aive_ssis
- > 0)
-
-1267
-
-->
-cous
-->
-cut_aive_ssis
---;
-
-1269 i(
-RTE_CT_TIMER_EXPIRED_DUMP
-) {
-
-1270
-ut64_t
-
-r
- = (
-cd
-->
-cous
-.
-cks_drݳd
- * 10000) /
-
-1271 (
-cd
-->
-cous
-.
-cks_fwded
- +
-
-1272
-cd
-->
-cous
-.
-cks_drݳd
-);
-
-1274 i(
-cd
-->
-oc
- =
-TCP_PROTOCOL
-) {
-
-1275
- `tf
-("CnxnTrkr %s,imed-out TCP Connection: %p,",
-
-1276
-
-->
-me
-,
-cd
-);
-
-1277
- `tf
-(" %s,kts forwarded %"
-
-1278
-PRIu64
- ",kts dropped %" PRIu64
-
-1280
-e__t_mes
-[
-cd
-->
-e_ud_f_tim
-],
-
-1281
-cd
-->
-cous
-.
-cks_fwded
-,
-
-1282
-cd
-->
-cous
-.
-cks_drݳd
-,
-
-1283 (
-ut32_t
-(
-r
- / 100),
-
-1284 (
-ut32_t
-(
-r
- % 100));
-
-1285 } i(
-cd
-->
-oc
- =
-UDP_PROTOCOL
-) {
-
-1286
- `tf
-("CnxnTrkr %s, Timed-out UDP Connection: %p,",
-
-1287
-
-->
-me
-,
-cd
-);
-
-1288
- `tf
-(" %s,ktfwded %"
-PRIu64
-
-
-1289 ",ktdrݳd %"
-PRIu64
- ", drop%% %u.%u\n",
-
-1290
-e__udp_mes
-[
-cd
-->
-e_ud_f_tim
-],
-
-1291
-cd
-->
-cous
-.
-cks_fwded
-,
-
-1292
-cd
-->
-cous
-.
-cks_drݳd
-,
-
-1293 (
-ut32_t
-(
-r
- / 100),
-
-1294 (
-ut32_t
-(
-r
- % 100));
-
-1298
-sucss
- =
- `e_hash_d_key
-(
-
-->
-rhash
-, &
-cd
-->
-key
-);
-
-1300 i(
-sucss
- < 0) {
-
-1302
- `e__t_hashkey
-(
-cd
-->
-key
-);
-
-1305
- }
-}
-
-1307 
-e_CT_cou_block
- *
-
-1308
- $e__g_cou_addss
-(
-e__xn_ack
- *
-
-)
-
-1310 
-
-->
-cous
-;
-
-1311
- }
-}
-
-1314
- $e__t_cfiguti_tis
-(
-e__xn_ack
- *
-
-,
-
-1315 *
-me
-, *
-vue
-)
-
-1318 
-iv
- =
- `oi
-(
-vue
-);
-
-1321 i(
- `rcmp
-(
-me
-, "tcp_loose") == 0) {
-
-1322
-
-->
-misc_tis
-.
-t_loo
- =
-iv
-;
-
-1327 i(
- `rcmp
-(
-me
-, "tcp_be_liberal") == 0) {
-
-1328
-
-->
-misc_tis
-.
-t_be_lib
- =
-iv
-;
-
-1333 i(
- `rcmp
-(
-me
-, "tcp_max_retrans") == 0) {
-
-1334
-
-->
-misc_tis
-.
-t_max_s
- =
-iv
-;
-
-1338
-ut64_t
-
-time_vue
- =
-iv
- *
-
-->
-htz
-;
-
-1344 i(
- `rcmp
-(
-me
-, "tcp_syn_sent") == 0) {
-
-1345 i(
-time_vue
- == 0)
-
-1347
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_SYN_SENT
-] =
-
-1348
-time_vue
-;
-
-1353 i(
- `rcmp
-(
-me
-, "tcp_syn_recv") == 0) {
-
-1354 i(
-time_vue
- == 0)
-
-1356
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_SYN_RECV
-] =
-
-1357
-time_vue
-;
-
-1362 i(
- `rcmp
-(
-me
-, "tcp_established") == 0) {
-
-1363 i(
-time_vue
- == 0)
-
-1365
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_ESTABLISHED
-] =
-
-1366
-time_vue
-;
-
-1371 i(
- `rcmp
-(
-me
-, "tcp_fin_wait") == 0) {
-
-1372 i(
-time_vue
- == 0)
-
-1374
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_FIN_WAIT
-] =
-
-1375
-time_vue
-;
-
-1380 i(
- `rcmp
-(
-me
-, "tcp_close_wait") == 0) {
-
-1381 i(
-time_vue
- == 0)
-
-1383
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_CLOSE_WAIT
-] =
-
-1384
-time_vue
-;
-
-1389 i(
- `rcmp
-(
-me
-, "tcp_last_ack") == 0) {
-
-1390 i(
-time_vue
- == 0)
-
-1392
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_LAST_ACK
-] =
-
-1393
-time_vue
-;
-
-1398 i(
- `rcmp
-(
-me
-, "tcp_time_wait") == 0) {
-
-1399 i(
-time_vue
- == 0)
-
-1401
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_TIME_WAIT
-] =
-
-1402
-time_vue
-;
-
-1407 i(
- `rcmp
-(
-me
-, "tcp_close") == 0) {
-
-1408 i(
-time_vue
- == 0)
-
-1410
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_CLOSE
-] =
-
-1411
-time_vue
-;
-
-1416 i(
- `rcmp
-(
-me
-, "tcp_syn_sent_2") == 0) {
-
-1417 i(
-time_vue
- == 0)
-
-1419
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_SYN_SENT_2
-] =
-
-1420
-time_vue
-;
-
-1425 i(
- `rcmp
-(
-me
-, "tcp_retrans") == 0) {
-
-1426 i(
-time_vue
- == 0)
-
-1428
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_RETRANS
-] =
-
-1429
-time_vue
-;
-
-1434 i(
- `rcmp
-(
-me
-, "tcp_unack") == 0) {
-
-1435 i(
-time_vue
- == 0)
-
-1437
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-RTE_CT_TCP_UNACK
-] =
-
-1438
-time_vue
-;
-
-1443 i(
- `rcmp
-(
-me
-, "udp_unreplied") == 0) {
-
-1444 i(
-time_vue
- == 0)
-
-1446
-
-->
-_timeout
-.
-udimeout
-.
-udp_timeouts
-[
-RTE_CT_UDP_UNREPLIED
-] =
-
-1447
-time_vue
-;
-
-1452 i(
- `rcmp
-(
-me
-, "udp_replied") == 0) {
-
-1453 i(
-time_vue
- == 0)
-
-1455
-
-->
-_timeout
-.
-udimeout
-.
-udp_timeouts
-[
-RTE_CT_UDP_REPLIED
-] =
-
-1456
-time_vue
-;
-
-1460
- }
-}
-
-1463
- $e__xn_ack_bch_lookup_basic_ty
-(
-
-1464 
-e__xn_ack
- *
-
-,
-
-1465 
-e_mbuf
- **
-pkts
-,
-
-1466
-ut64_t
- *
-pkts_mask
-,
-
-1467
-ut64_t
-
-no_w_xn_mask
-,
-
-1468
-ut64_t
- *
-y_pkt_mask
-,
-
-1469
-ut64_t
- *
-hijack_mask
-,
-
-1470
-ut8_t
-
-_hdr_size_bys
-)
-
-1473
-ut64_t
-
-pkts_to_oss
- = *
-pkts_mask
-;
-
-1475
-ut8_t
-
-comg_m
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-1477
-ut8_t
-
-key_ig_d
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-1478
-ut32_t
-
-cks_f_lookup
- = 0;
-
-1479
-t32_t
-
-posis
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-1480
-ut32_t
-
-i
-;
-
-1481 
-e__xn_da
-
-w_xn_da
-;
-
-1483 i(
-CNXN_TRX_DEBUG
- > 1) {
-
-1484
- `tf
-("E cnxack %p",
-
-);
-
-1485
- `tf
-(" synproxy batchookup withacket mask %p\n",
-
-1486 (*)*
-pkts_mask
-);
-
-1489
- `e__fg_w_cis
-(
-
-);
-
-1490 *
-y_pkt_mask
- = 0;
-
-1491 *
-hijack_mask
- = 0;
-
-1498 
-_hdr_size_bys
-) {
-
-1499 
-IPv4_HEADER_SIZE
-:
-
-1500 ;
-pkts_to_oss
-;) {
-
-1501
-ut8_t
-
-pos
- = (ut8_t
- `__but_z
-(
-
-1502
-pkts_to_oss
-);
-
-1504
-ut64_t
-
-pkt_mask
- = 1LLU <<
-pos
-;
-
-1506
-pkts_to_oss
- &~
-pkt_mask
-;
-
-1508 
-e_mbuf
- *
-pkt
- =
-pkts
-[
-pos
-];
-
-1514 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-1515
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-1516 (
-IP_START
- +
-_hdr_size_bys
-));
-
-1517
-ut16_t
-
-c_pt
- =
- `e_bsw16
-(
-thdr
-->src_port);
-
-1518
-ut16_t
-
-d_pt
- =
- `e_bsw16
-(
-thdr
-->dst_port);
-
-1520 
-v4_hdr
- *
-ihdr
- = (ipv4_hdr *)
-
-1521
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-1522
-ut8_t
-
-o
- =
-ihdr
-->
-xt_o_id
-;
-
-1524 i(!(
-o
- =
-TCP_PROTOCOL
- ||r=
-UDP_PROTOCOL
-)) {
-
-1535
-ut32_t
-
-c_addr
- =
- `e_bsw32
-(
-ihdr
-->src_addr);
-
-1536
-ut32_t
-
-d_addr
- =
- `e_bsw32
-(
-ihdr
-->dst_addr);
-
-1538 i(
-CNXN_TRX_DEBUG
- > 2) {
-
-1539 i(
-CNXN_TRX_DEBUG
- > 4)
-
-1540
- `e__xn_t_pkt
-(
-pkt
-,
-
-1541
-IP_VERSION_4
-);
-
-1547
-comg_m
-[
-cks_f_lookup
-] =
-pos
-;
-
-1548
-key_ig_d
-[
-cks_f_lookup
-] =
-
-1549
- `e___xn_hashkey
-(&
-c_addr
-, &
-d_addr
-,
-
-1550
-c_pt
-,
-d_pt
-,
-
-1551
-o
-,
-
-1552 &
-
-->
-hash_keys
-
-
-1553 [
-cks_f_lookup
-][0],
-
-1554
-IP_VERSION_4
-);
-
-1555
-cks_f_lookup
-++;
-
-1558 
-IPv6_HEADER_SIZE
-:
-
-1559 ;
-pkts_to_oss
-;) {
-
-1560
-ut8_t
-
-pos
- = (ut8_t
- `__but_z
-(
-
-1561
-pkts_to_oss
-);
-
-1563
-ut64_t
-
-pkt_mask
- = 1LLU <<
-pos
-;
-
-1565
-pkts_to_oss
- &~
-pkt_mask
-;
-
-1567 
-e_mbuf
- *
-pkt
- =
-pkts
-[
-pos
-];
-
-1570 *
-_hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-1571
-IP_START
-);
-
-1576 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-1577
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-1578 (
-IP_START
- +
-_hdr_size_bys
-));
-
-1579
-ut16_t
-
-c_pt
- =
- `e_bsw16
-(
-thdr
-->src_port);
-
-1580
-ut16_t
-
-d_pt
- =
- `e_bsw16
-(
-thdr
-->dst_port);
-
-1582 
-v6_hdr
- *
-ihdr
- = (v6_hd*)
-_hdr
-;
-
-1583
-ut8_t
-
-o
- =
-ihdr
-->proto;
-
-1585 i(!(
-o
- =
-TCP_PROTOCOL
- ||r=
-UDP_PROTOCOL
-)) {
-
-1590 i(
-CNXN_TRX_DEBUG
- > 2) {
-
-1591 i(
-CNXN_TRX_DEBUG
- > 4)
-
-1592
- `e__xn_t_pkt
-(
-pkt
-,
-
-1593
-IP_VERSION_6
-);
-
-1600
-comg_m
-[
-cks_f_lookup
-] =
-pos
-;
-
-1601
-key_ig_d
-[
-cks_f_lookup
-] =
-
-1602
- `e___xn_hashkey
-(
-
-1603 (
-ut32_t
- *
-ihdr
-->
-c_addr
-,
-
-1604 (
-ut32_t
- *
-ihdr
-->
-d_addr
-,
-
-1605
-c_pt
-,
-d_pt
-,
-
-1606
-o
-,
-
-1607 &
-
-->
-hash_keys
-
-
-1608 [
-cks_f_lookup
-][0],
-
-1609
-IP_VERSION_6
-);
-
-1610
-cks_f_lookup
-++;
-
-1616 i(
- `uiky
-(
-cks_f_lookup
- == 0))
-
-1620
- `memt
-(&
-w_xn_da
-, 0, (
-e__xn_da
-));
-
-1624 
-lookup_su
- =
- `e_hash_lookup_bulk
-(
-
-->
-rhash
-,
-
-1625 (cڡ **)&
-
-->
-hash_key_rs
-,
-
-1626
-cks_f_lookup
-, &
-posis
-[0]);
-
-1628 i(
- `uiky
-(
-lookup_su
- < 0)) {
-
-1630
- `tf
-("Unexpected hashableroblem, discardingllackets");
-
-1631 *
-pkts_mask
- = 0;
-
-1634 
-i
- = 0; i <
-cks_f_lookup
-; i++) {
-
-1636 
-hash_b_y
- =
-posis
-[
-i
-];
-
-1638
-ut8_t
-
-pkt_dex
- =
-comg_m
-[
-i
-];
-
-1640
-ut64_t
-
-pkt_mask
- = 1LLU <<
-pkt_dex
-;
-
-1641
-ut8_t
-
-key_is__d
- =
-key_ig_d
-[
-i
-];
-
-1642
-ut32_t
- *
-key
- =
-
-->
-hash_key_rs
-[
-pkt_dex
-];
-
-1643
-ut8_t
-
-oc
- = *(
-key
- + 9);
-
-1644 
-e_mbuf
- *
-ck
- =
-pkts
-[
-pkt_dex
-];
-
-1645 
-no_w_xn
- = (
-pkt_mask
- &
-no_w_xn_mask
-) != 0;
-
-1649 i(
-oc
- =
-TCP_PROTOCOL
-) {
-
-1650
-e__ck_ai
-
-t_pkt_ai
-;
-
-1652
-t_pkt_ai
- =
- `e__hd_t_lookup
-(
-
-,
-ck
-,
-
-1653
-pkt_dex
-,
-key_is__d
-,
-
-1654
-key
-,
-hash_b_y
-,
-no_w_xn
-,
-
-1655
-_hdr_size_bys
-);
-
-1657 
-t_pkt_ai
-) {
-
-1659 
-RTE_CT_SEND_CLIENT_SYNACK
-:
-
-1660 
-RTE_CT_SEND_SERVER_ACK
-:
-
-1664 *
-y_pkt_mask
- |
-pkt_mask
-;
-
-1667 
-RTE_CT_SEND_SERVER_SYN
-:
-
-1668 
-RTE_CT_FORWARD_PACKET
-:
-
-1671 
-RTE_CT_HIJACK
-:
-
-1672 *
-hijack_mask
- |
-pkt_mask
-;
-
-1677 *
-pkts_mask
- ^
-pkt_mask
-;
-
-1678
-
-->
-cous
-->
-pkts_dr
-++;
-
-1685 i(
-hash_b_y
- >= 0) {
-
-1691 
-e__xn_da
- *
-y
- =
-
-1692 &
-
-->
-hash_b_s
-[
-hash_b_y
-];
-
-1694 i(
-e__udp_ck
-
-
-1695 (
-
-,
-y
-,
-pkts
-[
-pkt_dex
-],
-
-1696
-key_is__d
-)) {
-
-1697
-y
-->
-cous
-.
-cks_fwded
-++;
-
-1698
-
-->
-cous
-->
-pkts_fwded
-++;
-
-1706 
-e__xn_da
- *
-_y
- =
-
-1707
- `e__ch_w_cis
-(
-
-,
-key
-);
-
-1709 i(
-_y
- !
-NULL
-) {
-
-1710 i(
- `e__udp_ck
-(
-
-,
-_y
-,
-
-1711
-pkts
-[
-pkt_dex
-],
-
-1712
-key_is__d
-)) {
-
-1713
-_y
-->
-cous
-.
-
-1714
-cks_fwded
-++;
-
-1715
-
-->
-cous
-->
-pkts_fwded
-++;
-
-1722 i(
-no_w_xn
-) {
-
-1726 *
-pkts_mask
- ^
-pkt_mask
-;
-
-1727
-
-->
-cous
-->
-pkts_dr
-++;
-
-1728
-
-->
-cous
-->
-
-1729
-pkts_dr_vid_cn
-++;
-
-1733 i(
- `e__udp_w_ci
-(
-
-,
-
-1734 &
-w_xn_da
-,
-pkts
-[
-pkt_dex
-])) {
-
-1738
-t32_t
-
-posi
- =
-
-1739
- `e_hash_add_key
-(
-
-->
-
-1740
-rhash
-,
-key
-);
-
-1742 i(
-posi
- < 0)
-
-1745 
-e__xn_da
-
-
-1746 *
-w_hash_y
- = &
-
-->
-
-1747
-hash_b_s
-[
-posi
-];
-
-1754
- `memy
-(
-w_xn_da
-.
-key
-, key,
-
-1755 (
-w_xn_da
-.
-key
-));
-
-1757
-w_xn_da
-.
-
-1758
-key_is__d
-
-
-1759
-key_is__d
-;
-
-1760
-w_xn_da
-.
-oc
- =
-
-1761
-UDP_PROTOCOL
-;
-
-1762
- `e_xn__ty
-(
-
-1763 &
-w_xn_da
-.
-ty
-,
-
-1764
-ck
-);
-
-1765
- `e_memy
-(
-w_hash_y
-,
-
-1766 &
-w_xn_da
-,
-
-1768
-e__xn_da
-));
-
-1770
-w_hash_y
-->
-cous
-.
-
-1771
-cks_fwded
- = 1;
-
-1772
-
-->
-cous
-->
-pkts_fwded
-++;
-
-1773
-w_hash_y
-->
-cous
-.
-
-1774
-cks_drݳd
- = 0;
-
-1775
-
-->
-cous
-->
-pkts_dr
- = 0;
-
-1776
-
-->
-cous
-->
-
-1777
-cut_aive_ssis
-++;
-
-1778
-
-->
-cous
-->
-
-1779
-ssis_aived
-++;
-
-1781
-w_hash_y
-->
-
-1782
-e_ud_f_tim
-
-
-1783
-RTE_CT_UDP_NONE
-;
-
-1784
- `e__t_xn_tim_f_udp
-(
-
-1785
-
-,
-
-1786
-w_hash_y
-,
-
-1787
-RTE_CT_UDP_UNREPLIED
-);
-
-1789
- `e__memb_w_ci
-(
-
-1790
-
-,
-
-1791
-w_hash_y
-);
-
-1800 i(
-CNXN_TRX_DEBUG
- > 1) {
-
-1801
- `tf
-("Exit cnxnracker synproxy batchookup with");
-
-1802
- `tf
-("ack mask %p\n", (*)*
-pkts_mask
-);
-
-1804
- }
-}
-
- @VIL/conntrack/rte_cnxn_tracking.h
-
-17 #ide
-_CNXN_TRACKING_H
-
-
-18 
- #_CNXN_TRACKING_H
-
-
- )
-
-20 
- ~<dlib.h
->
-
-21 
- ~<rg.h
->
-
-22 
- ~<ys.h
->
-
-23 
- ~<dbo.h
->
-
-26 
- ~<e_hash.h
->
-
-27 
- ~<e_h.h
->
-
-29 
- ~"e__t.h
-"
-
-54 
-e__xn_ack
-
- g__e_che_igd
-;
-
-56 
-e_CT_hi_cou_block__u
-;
-
-58 
- se_CT_cou_block
- {
-
-60
-ut64_t
-
- mcut_aive_ssis
-;
-
-61
-ut64_t
-
- mssis_aived
-;
-
-63
-ut64_t
-
- mssis_aived
-;
-
-65
-ut64_t
-
- mssis_eablished
-;
-
-66
-ut64_t
-
- mssis_od
-;
-
-67
-ut64_t
-
- mssis_timedout
-;
-
-68
-ut64_t
-
- mpkts_fwded
-;
-
-69
-ut64_t
-
- mpkts_dr
-;
-
-70
-ut64_t
-
- mpkts_dr_vid_cn
-;
-
-71
-ut64_t
-
- mpkts_dr_vid_e
-;
-
-72
-ut64_t
-
- mpkts_dr_vid_r
-;
-
-73
-ut64_t
-
- mpkts_dr_outof_wdow
-;
-
-74 }
- g__e_che_igd
-;
-
-76 
- se_syroxy_hr
- {
-
-77
-ut64_t
-
- my_pkt_mask
-;
-
-78
-ut64_t
-
- mhijack_mask
-;
-
-79 
-e_mbuf
- **
- mbufd_pkts_to_fwd
-;
-
-80
-ut8_t
-
- mnum_bufd_pkts_to_fwd
-;
-
-83 
- se_CT_hr
- {
-
-84
-ut64_t
-
- mno_w_xn_mask
-;
-
-85
-ut64_t
-
- my_pkt_mask
-;
-
-86
-ut64_t
-
- mhijack_mask
-;
-
-87 
-e_mbuf
- **
- mbufd_pkts_to_fwd
-;
-
-88
-ut8_t
-
- mnum_bufd_pkts_to_fwd
-;
-
-91 
- #MAX_CT_INSTANCES
- 24
-
- )
-
-93 
-e_CT_cou_block
-
-e_CT_cou_b
-[
-MAX_CT_INSTANCES
-]
-
-94
-__e_che_igd
-;
-
-122
-ut64_t
-
-
-123
-e__xn_ack_bch_lookup
-(
-
-124 
-e__xn_ack
- *
-
-,
-
-125 
-e_mbuf
- **
-pkts
-,
-
-126
-ut64_t
-
-pkts_mask
-,
-
-127 
-e_CT_hr
- *
-_hr
-);
-
-130
-e__xn_ack_bch_lookup_ty
-(
-
-131 
-e__xn_ack
- *
-
-,
-
-132 
-e_mbuf
- **
-pkts
-,
-
-133
-ut64_t
- *
-pkts_mask
-,
-
-134 
-e_CT_hr
- *
-_hr
-,
-
-135
-ut8_t
-
-_hdr_size_bys
-);
-
-169
-ut64_t
-
-
-170
-e__xn_ack_bch_lookup_wh_w_xn_cڌ
-(
-
-171 
-e__xn_ack
- *
-
-,
-
-172 
-e_mbuf
- **
-pkts
-,
-
-173
-ut64_t
-
-pkts_mask
-,
-
-174
-ut64_t
-
-no_w_xn_mask
-);
-
-205
-ut64_t
-
-
-206
-e__xn_ack_bch_lookup_wh_syroxy
-(
-
-207 
-e__xn_ack
- *
-
-,
-
-208 
-e_mbuf
- **
-pkts
-,
-
-209
-ut64_t
-
-pkts_mask
-,
-
-210 
-e_syroxy_hr
- *
-_hr
-);
-
-239 
-e_mbuf
- *
-
-240
-e__g_bufd_syroxy_cks
-(
-e__xn_ack
- *
-
-);
-
-259
-e__lize_xn_ack_wh_syroxy
-(
-
-260 
-e__xn_ack
- *
-w_xn_ack
-,
-
-261
-ut32_t
-
-max_ci_cou
-,
-
-262 *
-me
-,
-
-263
-ut16_t
-
-por_offt
-);
-
-283
-e__lize_xn_ack
-(
-
-284 
-e__xn_ack
- *
-w_xn_ack
-,
-
-285
-ut32_t
-
-max_ci_cou
-,
-
-286 *
-me
-);
-
-301
-e___xn_ack_sours
-(
-
-302 
-e__xn_ack
- *
-d_xn_ack
-);
-
-313
-e__g_xn_ack_size
-();
-
-323 
-e_CT_cou_block
-*
-
-324
-e__g_cou_addss
-(
-e__xn_ack
- *
-
-);
-
-346
-e__t_cfiguti_tis
-(
-
-347 
-e__xn_ack
- *
-
-,
-
-348 *
-me
-,
-
-349 *
-vue
-);
-
-363
-e__hd_exped_tims
-(
-e__xn_ack
- *
-
-);
-
-367
-e__g_IP_hdr_size
-(
-e_mbuf
- *
-pkt
-);
-
-378
-e__ab_syroxy
-(
-e__xn_ack
- *
-
-);
-
-389
-e__dib_syroxy
-(
-e__xn_ack
- *
-
-);
-
-391
-e__lize_deu_timeouts
-(
-
-392 
-e__xn_ack
- *
-w_xn_ack
-);
-
-394
-ut8_t
-
-
-395
-e___xn_hashkey
-(
-
-396
-ut32_t
- *
-c_addr
-,
-
-397
-ut32_t
- *
-d_addr
-,
-
-398
-ut16_t
-
-c_pt
-,
-
-399
-ut16_t
-
-d_pt
-,
-
-400
-ut8_t
-
-o
-,
-
-401
-ut32_t
- *
-key
-,
-
-402
-ut8_t
-
-ty
-);
-
-405 #ifde
-CT_CGNAT
-
-
-406
-ut32_t
-
-g_tim_ce_id
-();
-
-407
-ut64_t
-
-cgDZ__oss
-(
-
-408 
-e__xn_ack
- *
-
-,
-
-409 
-e_mbuf
- **
-pkts
-,
-
-410
-ut64_t
-
-pkts_mask
-,
-
-411 
-e_CT_hr
- *
-_hr
-);
-
- @VIL/conntrack/rte_ct_synproxy.c
-
-17 
- ~<dio.h
->
-
-18 
- ~<dlib.h
->
-
-19 
- ~<dt.h
->
-
-20 
- ~<ddef.h
->
-
-21 
- ~<rg.h
->
-
-22 
- ~<unid.h
->
-
-24 
- ~<e_comm.h
->
-
-25 
- ~<e_mloc.h
->
-
-26 
- ~<e_h.h
->
-
-27 
- ~<e_.h
->
-
-28 
- ~<e_udp.h
->
-
-29 
- ~<e_icmp.h
->
-
-30 
- ~<e_byd.h
->
-
-31 
- ~<e_cyes.h
->
-
-33 
- ~"e__t.h
-"
-
-71 
- #META_DATA_OFFSET
- 128
-
- )
-
-72 
- #ETHERNET_START
- (
-META_DATA_OFFSET
- +
-RTE_PKTMBUF_HEADROOM
-)
-
- )
-
-73 
- #ETH_HDR_SIZE
- 14
-
- )
-
-74 
- #IP_START
- (
-ETHERNET_START
- +
-ETH_HDR_SIZE
-)
-
- )
-
-75 
- #PROTOCOL_START
- (
-IP_START
- + 9)
-
- )
-
-76 
- #IP_V4_HEADER_SIZE
- 20
-
- )
-
-77 
- #IP_V6_HEADER_SIZE
- 40
-
- )
-
-78 
- #TCP_START
- (
-IP_START
- +
-IP_V4_HEADER_SIZE
-)
-
- )
-
-79 
- #TCP_MIN_HDR_SIZE
- 20
-
- )
-
-81 
- #RTE_TCP_PROTO_ID
- 6
-
- )
-
-82 
- #RTE_SP_DEFAULT_TTL
- 64
-
- )
-
-84 
- #RTE_SYNPROXY_MAX_SPOOFED_PKTS
- 64
-
- )
-
-86 
- #RTE_TCP_SYN
- 0x02
-
- )
-
-87 
- #RTE_TCP_ACK
- 0x10
-
- )
-
-88 
- #RTE_TCP_SYN_ACK
- (
-RTE_TCP_SYN
- |
-RTE_TCP_ACK
-)
-
- )
-
-90 
- #RTE_SP_DEFAULT_WINDOW
- 29200
-
- )
-
-91 
- #RTE_CT_DEBUG_SPOOFED_SEQ
- 0
-
- )
-
-92 
- #RTE_DPDK_IS_16_4
- 0
-
- )
-
-94 
- #IP_VERSION_4
- 4
-
- )
-
-95 
- #IP_VERSION_6
- 6
-
- )
-
-101 
-e_syroxy_tis
-
- gdeu_v4_syroxy_tis
- = {
-
-102 .
-tis
- =
-RTE_SP_OPTIONS_MSS
- |
-
-103
-RTE_SP_OPTIONS_SACK_PERM
- |
-
-104
-RTE_SP_OPTIONS_WINDOW_SCALE
-,
-
-105 .
- gmss
- = 1460,
-
-106 .
- gwdow_s
- = 7,
-
-107 .
- gl_wdow
- =
-RTE_SP_DEFAULT_WINDOW
-
-
-111 
-e_syroxy_tis
-
- gdeu_v6_syroxy_tis
- = {
-
-112 .
-tis
- =
-RTE_SP_OPTIONS_MSS
- |
-
-113
-RTE_SP_OPTIONS_SACK_PERM
- |
-
-114
-RTE_SP_OPTIONS_WINDOW_SCALE
-,
-
-115 .
- gmss
- = 1440,
-
-116 .
- gwdow_s
- = 7,
-
-117 .
- gl_wdow
- =
-RTE_SP_DEFAULT_WINDOW
-
-
-121 
-__e_unud
- 
-
-122
- $e__syroxy_t_pkt_fo
-(
-e_mbuf
- *
-pkt
-)
-
-124 
-v4_hdr
- *
-ihdr4
- = (ipv4_hdr *)
-
-125
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-126
-__e_unud
- 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-127
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-TCP_START
-);
-
-128
-ut32_t
-
-ck_ngth
- =
- `e_pktmbuf_pkt_n
-(
-pkt
-);
-
-130
- `tf
-("\ackgth %u, ingth %u\n",
-ck_ngth
-,
-
-131
- `e_bsw16
-(
-ihdr4
-->
-tٮ_ngth
-));
-
-132
- `e_pktmbuf_dump
-(
-dout
-,
-pkt
-, 80);
-
-133
- }
-}
-
-135 
-le
- 
-
-136
- $e__eml_t_chksum_upde_32
-(
-
-137
-ut32_t
-
-num_befe
-,
-
-138
-ut32_t
-
-num_a
-,
-
-140
-ut16_t
- *
-chksum
-)
-
-142
-ut32_t
-
-sum
-;
-
-144
-sum
- = ~
- `e_bsw16
-(*
-chksum
-) & 0xffff;
-
-145
-num_befe
- = ~num_before;
-
-146
-sum
- +(
-num_befe
- >> 16) + (num_before & 0xffff);
-
-147
-sum
- +(
-num_a
- >> 16) + (num_after & 0xffff);
-
-148
-sum
- = (sum >> 16) + (sum & 0xffff);
-
-149
-sum
- += (sum >> 16);
-
-150 *
-chksum
- =
- `e_bsw16
-(~
-sum
- & 0xffff);
-
-151
- }
-}
-
-155 
-le
-
-ut32_t
-
-
-156
- $e__g_ndom_q_numb
-()
-
-158 
- `e_g_tsc_cyes
-();
-
-159
- }
-}
-
-162 
-t8_t
-
- $e__vsi
-(*
-i_hdr
-)
-
-164
-ut8_t
- *
-ihdr
- = (ut8_*)
-i_hdr
-;
-
-165
-t8_t
-
-hdr_chk
- = *
-ihdr
-;
-
-167
-hdr_chk
- = hdr_chk >> 4;
-
-168 i(
-hdr_chk
- =
-IP_VERSION_4
- || hdr_chk =
-IP_VERSION_6
-)
-
-169 
-hdr_chk
-;
-
-172
- }
-}
-
-174 
-le
- 
-
-175
- $e_syroxy_adju_pkt_ngth
-(
-e_mbuf
- *
-pkt
-)
-
-177
-ut16_t
-
-pkt_ngth
- = 0;
-
-178 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-pkt
-);
-
-179 *
-hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-181 i(
-_hdr_size_bys
- =
-IP_V4_HEADER_SIZE
-) {
-
-182 
-v4_hdr
- *
-ihdr4
- = (v4_hd*)
-hdr
-;
-
-184
-pkt_ngth
- =
- `e_bsw16
-(
-ihdr4
-->
-tٮ_ngth
-+
-ETH_HDR_SIZE
-;
-
-185 } i(
-_hdr_size_bys
- =
-IP_V6_HEADER_SIZE
-) {
-
-186 
-v6_hdr
- *
-ihdr6
- = (v6_hd*)
-hdr
-;
-
-188
-pkt_ngth
- =
- `e_bsw16
-(
-ihdr6
-->
-yld_n
-) +
-
-189
-IP_V6_HEADER_SIZE
- +
-ETH_HDR_SIZE
-;
-
-191
-ut16_t
-
-mbuf_pkt_ngth
- =
- `e_pktmbuf_pkt_n
-(
-pkt
-);
-
-193 i(
-pkt_ngth
- =
-mbuf_pkt_ngth
-)
-
-196 i(
-pkt_ngth
- <
-mbuf_pkt_ngth
-) {
-
-197
- `e_pktmbuf_im
-(
-pkt
-,
-mbuf_pkt_ngth
- -
-pkt_ngth
-);
-
-202
- `e_pktmbuf_nd
-(
-pkt
-,
-pkt_ngth
- -
-mbuf_pkt_ngth
-);
-
-203
- }
-}
-
-206
- $e_syroxy_bud_v4_hd
-(
-
-207 
-v4_hdr
- *
-hdr4
-,
-
-208
-ut32_t
-
-c_addr
-,
-
-209
-ut32_t
-
-d_addr
-,
-
-210
-ut16_t
-
-t_ngth
-)
-
-214
-hdr4
-->
-vsi_ihl
- = 0x45;
-
-215
-hdr4
-->
-ty_of_rvi
- = 0;
-
-216
-hdr4
-->
-tٮ_ngth
- =
- `e_bsw16
-(
-t_ngth
- +
-IP_V4_HEADER_SIZE
-);
-
-217
-hdr4
-->
-ck_id
- = 0;
-
-219
-hdr4
-->
-agmt_offt
- = 0x0040;
-
-220
-hdr4
-->
-time_to_live
- =
-RTE_SP_DEFAULT_TTL
-;
-
-221
-hdr4
-->
-xt_o_id
- =
-RTE_TCP_PROTO_ID
-;
-
-223
-hdr4
-->
-c_addr
- =
- `e_bsw32
-(src_addr);
-
-224
-hdr4
-->
-d_addr
- =
- `e_bsw32
-(dst_addr);
-
-225
- }
-}
-
-229
- $e_syroxy_bud_v6_hd
-(
-
-230 
-v6_hdr
- *
-hdr6
-,
-
-231
-ut8_t
- *
-c_addr
-,
-
-232
-ut8_t
- *
-d_addr
-,
-
-233
-ut16_t
-
-t_ngth
-)
-
-237
-ut8_t
-
-mp_c
-[16];
-
-238
-ut8_t
-
-mp_d
-[16];
-
-240
-hdr6
-->
-vtc_ow
- = 0x60;
-
-241
-hdr6
-->
-yld_n
- =
- `e_bsw16
-(
-t_ngth
-);
-
-242
-hdr6
-->
-o
- =
-RTE_TCP_PROTO_ID
-;
-
-243
-hdr6
-->
-h_lims
- =
-RTE_SP_DEFAULT_TTL
-;
-
-247
- `e_mov16
-(
-mp_c
-,
-c_addr
-);
-
-248
- `e_mov16
-(
-mp_d
-,
-d_addr
-);
-
-249
- `e_mov16
-(
-hdr6
-->
-c_addr
-,
-mp_c
-);
-
-250
- `e_mov16
-(
-hdr6
-->
-d_addr
-,
-mp_d
-);
-
-251
- }
-}
-
-255 
-ut16_t
-
-
-256
- $e__add_t_tis
-(
-t_hdr
- *
-thdr
-,
-
-257 cڡ 
-e_syroxy_tis
- *
-t_ts
-)
-
-259
-ut32_t
- *
-tis_r
- = (ut32_*)(
-thdr
- + 1);
-
-260
-ut32_t
- *
-ved_r
- =
-tis_r
-;
-
-261
-ut8_t
-
-tis
- =
-t_ts
-->options;
-
-262
-ut32_t
-
-ti_bys
-;
-
-264 i(
-tis
- &
-RTE_SP_OPTIONS_MSS
-) {
-
-265
-ti_bys
- = (
-RTE_CT_TCPOPT_MSS
- << 24) |
-
-266 (
-RTE_CT_TCPOLEN_MSS
- << 16|
-t_ts
-->
-mss
-;
-
-267 *
-tis_r
-++ =
- `e_bsw32
-(
-ti_bys
-);
-
-270 i(
-tis
- &
-RTE_SP_OPTIONS_TIMESTAMP
-) {
-
-274 i(
-tis
- &
-RTE_SP_OPTIONS_SACK_PERM
-)
-
-275
-ti_bys
- = (
-RTE_CT_TCPOPT_SACK_PERM
- << 24) |
-
-276 (
-RTE_CT_TCPOLEN_SACK_PERM
- << 16);
-
-278
-ti_bys
- = (
-RTE_CT_TCPOPT_NOP
- << 24) |
-
-279 (
-RTE_CT_TCPOPT_NOP
- << 16);
-
-281
-ti_bys
- |(
-RTE_CT_TCPOPT_TIMESTAMP
- << 8) |
-
-282
-RTE_CT_TCPOLEN_TIMESTAMP
-;
-
-283 *
-tis_r
-++ =
- `e_bsw32
-(
-ti_bys
-);
-
-284 *
-tis_r
-++ =
- `e_bsw32
-(
-t_ts
-->
-ts_v
-);
-
-285 *
-tis_r
-++ =
- `e_bsw32
-(
-t_ts
-->
-ts_echo_y
-);
-
-286 } i(
-tis
- &
-RTE_SP_OPTIONS_SACK_PERM
-) {
-
-287
-ti_bys
- = (
-RTE_CT_TCPOPT_NOP
- << 24) |
-
-288 (
-RTE_CT_TCPOPT_NOP
- << 16) |
-
-289 (
-RTE_CT_TCPOPT_SACK_PERM
- << 8) |
-
-290
-RTE_CT_TCPOLEN_SACK_PERM
-;
-
-291 *
-tis_r
-++ =
- `e_bsw32
-(
-ti_bys
-);
-
-294 i(
-tis
- &
-RTE_SP_OPTIONS_WINDOW_SCALE
-) {
-
-295
-ti_bys
- = (
-RTE_CT_TCPOPT_NOP
- << 24) |
-
-296 (
-RTE_CT_TCPOPT_WINDOW
- << 16) |
-
-297 (
-RTE_CT_TCPOLEN_WINDOW
- << 8) |
-
-298
-t_ts
-->
-wdow_s
-;
-
-299 *
-tis_r
-++ =
- `e_bsw32
-(
-ti_bys
-);
-
-306
-ut16_t
-
-da_offt_bys
- = (ut16_t)
- `RTE_PTR_DIFF
-(
-tis_r
-,
-
-307
-ved_r
-+ (
-t_hdr
-);
-
-308
-thdr
-->
-da_off
- = (
-da_offt_bys
- >> 2) << 4;
-
-310 
-da_offt_bys
-;
-
-311
- }
-}
-
-318 
-le
-
-ut16_t
-
-
-319
- $e_syroxy_bud_t_hd
-(
-
-320
-__e_unud
- 
-e_mbuf
- *
-d_pkt
-,
-
-321 
-t_hdr
- *
-t_hdr
-,
-
-322
-ut16_t
-
-c_pt
-,
-
-323
-ut16_t
-
-d_pt
-,
-
-324
-ut32_t
-
-q
-,
-
-325
-ut32_t
-
-ack
-,
-
-326
-ut8_t
-
-ags
-,
-
-327 cڡ 
-e_syroxy_tis
- *
-t_ts
-,
-
-328
-ut8_t
-
-add_tis
-)
-
-330
-t_hdr
-->
-c_pt
- =
- `e_bsw16
-(src_port);
-
-331
-t_hdr
-->
-d_pt
- =
- `e_bsw16
-(dst_port);
-
-332
-t_hdr
-->
-_q
- =
- `e_bsw32
-(
-q
-);
-
-333
-t_hdr
-->
-cv_ack
- =
- `e_bsw32
-(
-ack
-);
-
-335
-t_hdr
-->
-t_ags
- =
-ags
-;
-
-336
-t_hdr
-->
-rx_w
- =
-t_ts
-->
-l_wdow
-;
-
-338
-t_hdr
-->
-t_u
- = 0;
-
-342
-ut16_t
-
-w_t_hdr_size
- =
-TCP_MIN_HDR_SIZE
-;
-
-344 i(
-add_tis
-)
-
-345
-w_t_hdr_size
- =
- `e__add_t_tis
-(
-t_hdr
-,
-t_ts
-);
-
-347
-t_hdr
-->
-da_off
- = (
-TCP_MIN_HDR_SIZE
- >> 2) << 4;
-
-349 
-w_t_hdr_size
-;
-
-350
- }
-}
-
-353
- $e_syroxy_compu_checksums
-(*
-i_hdr
-, 
-t_hdr
- *
-t_hdr
-)
-
-364
-t8_t
-
-hdr_chk
- =
- `e__vsi
-(
-i_hdr
-);
-
-366
-t_hdr
-->
-cksum
- = 0;
-
-368 i(
-hdr_chk
- =
-IP_VERSION_4
-) {
-
-369 
-v4_hdr
- *
-i4_hdr
- = (v4_hd*)
-i_hdr
-;
-
-371
-i4_hdr
-->
-hdr_checksum
- = 0;
-
-372
-t_hdr
-->
-cksum
- =
- `e_v4_ud_cksum
-(
-i4_hdr
-,_hdr);
-
-373
-i4_hdr
-->
-hdr_checksum
- =
- `e_v4_cksum
-(i4_hdr);
-
-374 } i(
-hdr_chk
- =
-IP_VERSION_6
-) {
-
-375 
-v6_hdr
- *
-i6_hdr
- = (v6_hd*)
-i_hdr
-;
-
-377
-t_hdr
-->
-cksum
- =
- `e_v6_ud_cksum
-(
-i6_hdr
-,_hdr);
-
-379
- }
-}
-
-391
- $e__cvt_to_ood__syck
-(
-e__xn_da
- *
-cd
-,
-
-392 
-e_mbuf
- *
-d_pkt
-)
-
-398 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-d_pkt
-);
-
-399 *
-hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-d_pkt
-,
-IP_START
-);
-
-400 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-401
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-d_pkt
-,
-IP_START
- +
-
-402
-_hdr_size_bys
-);
-
-403
-ut16_t
-
-t_hd_size
-;
-
-406
-ut32_t
-
-w_q
- =
- `e__g_ndom_q_numb
-();
-
-408 i(
-RTE_CT_DEBUG_SPOOFED_SEQ
-)
-
-409
-w_q
- = 10;
-
-411
-cd
-->
-_oc
-.
-syroxy_da
-.
-ig_ood_q
- =
-w_q
-;
-
-414
-t_hd_size
- =
- `e_syroxy_bud_t_hd
-(
-d_pkt
-,
-thdr
-,
-
-415
- `e_bsw16
-(
-thdr
-->
-d_pt
-),
-
-416
- `e_bsw16
-(
-thdr
-->
-c_pt
-),
-
-417
-w_q
-,
- `e_bsw32
-(
-thdr
-->
-_q
-) + 1,
-
-418
-RTE_TCP_SYN_ACK
-,
-
-419
-_hdr_size_bys
- =
-IP_V4_HEADER_SIZE
- ?
-
-420 &
-deu_v4_syroxy_tis
- :
-
-421 &
-deu_v6_syroxy_tis
-, 1);
-
-424 i(
-_hdr_size_bys
- =
-IP_V4_HEADER_SIZE
-) {
-
-425 
-v4_hdr
- *
-ihdr4
- = (v4_hd*)
-hdr
-;
-
-427
- `e_syroxy_bud_v4_hd
-(
-ihdr4
-,
-
-428
- `e_bsw32
-(
-ihdr4
-->
-d_addr
-),
-
-429
- `e_bsw32
-(
-ihdr4
-->
-c_addr
-),
-t_hd_size
-);
-
-431 } i(
-_hdr_size_bys
- =
-IP_V6_HEADER_SIZE
-) {
-
-432 
-v6_hdr
- *
-ihdr6
- = (v6_hd*)
-hdr
-;
-
-434
- `e_syroxy_bud_v6_hd
-(
-ihdr6
-,
-
-435 (
-ut8_t
- *)
-ihdr6
-->
-d_addr
-,
-
-436 (
-ut8_t
- *)
-ihdr6
-->
-c_addr
-,
-t_hd_size
-);
-
-438
- `e_syroxy_adju_pkt_ngth
-(
-d_pkt
-);
-
-440
- `e_syroxy_compu_checksums
-(
-hdr
-,
-thdr
-);
-
-442
- }
-}
-
-446
- $e__cvt_to_ood_rv_syn
-(
-e__xn_da
- *
-cd
-,
-
-447 
-e_mbuf
- *
-d_pkt
-)
-
-453 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-d_pkt
-);
-
-454 *
-hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-d_pkt
-,
-IP_START
-);
-
-455 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-456
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-d_pkt
-,
-IP_START
-
-
-457 +
-_hdr_size_bys
-);
-
-458
-ut16_t
-
-t_hd_size
-;
-
-460
-t_hd_size
- =
- `e_syroxy_bud_t_hd
-(
-d_pkt
-,
-thdr
-,
-
-461
- `e_bsw16
-(
-thdr
-->
-c_pt
-),
-
-462
- `e_bsw16
-(
-thdr
-->
-d_pt
-),
-
-463
- `e_bsw32
-(
-thdr
-->
-_q
-) - 1, 0,
-
-464
-RTE_TCP_SYN
-,
-
-465 &
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_tis
-, 1);
-
-467 i(
-_hdr_size_bys
- =
-IP_V4_HEADER_SIZE
-) {
-
-468 
-v4_hdr
- *
-ihdr4
- = (v4_hd*)
-hdr
-;
-
-470
- `e_syroxy_bud_v4_hd
-(
-ihdr4
-,
-
-471
- `e_bsw32
-(
-ihdr4
-->
-c_addr
-),
-
-472
- `e_bsw32
-(
-ihdr4
-->
-d_addr
-),
-t_hd_size
-);
-
-473 } i(
-_hdr_size_bys
- =
-IP_V6_HEADER_SIZE
-) {
-
-474 
-v6_hdr
- *
-ihdr6
- = (v6_hd*)
-hdr
-;
-
-476
- `e_syroxy_bud_v6_hd
-(
-ihdr6
-,
-
-477 (
-ut8_t
- *)
-ihdr6
-->
-c_addr
-,
-
-478 (
-ut8_t
- *)
-ihdr6
-->
-d_addr
-,
-t_hd_size
-);
-
-481
- `e_syroxy_adju_pkt_ngth
-(
-d_pkt
-);
-
-483
- `e_syroxy_compu_checksums
-(
-hdr
-,
-thdr
-);
-
-485
- }
-}
-
-488
- $e__cvt_to_ood_rv_ack
-(
-e__xn_da
- *
-cd
-,
-
-489 
-e_mbuf
- *
-d_pkt
-)
-
-495 
-_hdr_size_bys
- =
- `e__g_IP_hdr_size
-(
-d_pkt
-);
-
-496 *
-hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-d_pkt
-,
-IP_START
-);
-
-497 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-498
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-d_pkt
-,
-IP_START
- +
-
-499
-_hdr_size_bys
-);
-
-504
-ut32_t
-
-_q
- =
- `e_bsw32
-(
-thdr
-->
-_q
-);
-
-505
-ut16_t
-
-t_hd_size
-;
-
-507
-cd
-->
-_oc
-.
-syroxy_da
-.
-q_diff
- =
-
-508
-_q
- -
-cd
-->
-_oc
-.
-syroxy_da
-.
-ig_ood_q
-;
-
-511
-t_hd_size
- =
- `e_syroxy_bud_t_hd
-(
-d_pkt
-,
-thdr
-,
-
-512
- `e_bsw16
-(
-thdr
-->
-d_pt
-),
-
-513
- `e_bsw16
-(
-thdr
-->
-c_pt
-),
-
-514
- `e_bsw32
-(
-thdr
-->
-cv_ack
-),
-
-515
- `e_bsw32
-(
-thdr
-->
-_q
-+ 1,
-RTE_TCP_ACK
-,
-
-516 &
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_tis
-, 0);
-
-519 i(
-_hdr_size_bys
- =
-IP_V4_HEADER_SIZE
-) {
-
-520 
-v4_hdr
- *
-ihdr4
- = (v4_hd*)
-hdr
-;
-
-522
- `e_syroxy_bud_v4_hd
-(
-ihdr4
-,
-
-523
- `e_bsw32
-(
-ihdr4
-->
-d_addr
-),
-
-524
- `e_bsw32
-(
-ihdr4
-->
-c_addr
-),
-t_hd_size
-);
-
-526 } i(
-_hdr_size_bys
- =
-IP_V6_HEADER_SIZE
-) {
-
-527 
-v6_hdr
- *
-ihdr6
- = (v6_hd*)
-hdr
-;
-
-529
- `e_syroxy_bud_v6_hd
-(
-ihdr6
-,
-
-530 (
-ut8_t
- *)
-ihdr6
-->
-d_addr
-,
-
-531 (
-ut8_t
- *)
-ihdr6
-->
-c_addr
-,
-t_hd_size
-);
-
-533
- `e_syroxy_adju_pkt_ngth
-(
-d_pkt
-);
-
-535
- `e_syroxy_compu_checksums
-(
-hdr
-,
-thdr
-);
-
-536
- }
-}
-
-551
- $e__adju_rv_q_a_wdow_check
-(
-
-552 
-e__xn_da
- *
-cd
-,
-
-553
-__e_unud
- *
-i_hdr
-,
-
-554 
-t_hdr
- *
-thdr
-,
-
-555
-e__pkt_dei
-
-d
-)
-
-557
-ut32_t
-
-num_befe
-,
-num_a
-;
-
-559 i(!
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_eablished
-)
-
-562 i(
-d
- =
-RTE_CT_DIR_ORIGINAL
-)
-
-567
-num_befe
- =
- `e_bsw32
-(
-thdr
-->
-_q
-);
-
-568
-num_a
- =
-num_befe
- -
-cd
-->
-_oc
-.
-syroxy_da
-.
-q_diff
-;
-
-569
-thdr
-->
-_q
- =
- `e_bsw32
-(
-num_a
-);
-
-571
- `e__eml_t_chksum_upde_32
-(
-num_befe
-,
-num_a
-,
-
-572 &
-thdr
-->
-cksum
-);
-
-573
- }
-}
-
-577
- $e__adju__ck_s
-(
-
-578 
-t_hdr
- *
-thdr
-,
-
-579
-ut32_t
-
-diff
-)
-
-581
-ut32_t
-
-num_befe
-,
-num_a
-;
-
-582
-ut32_t
- *
-ck_r
-;
-
-583
-ut8_t
-
-ck_blk_size
-;
-
-584
-ut16_t
-
-daoff__bys
- = (
-thdr
-->
-da_off
- & 0xf0) >> 2;
-
-585
-ut16_t
-
-ngth
- =
-daoff__bys
- - (
-t_hdr
-);
-
-587 i(!
-ngth
-)
-
-590
-ut8_t
- *
-tis_r
- = (ut8_*)(
-thdr
- + 1);
-
-592 
-ngth
- > 0) {
-
-593
-ut8_t
-
-code
- = *
-tis_r
-;
-
-594
-ut8_t
-
-size
- =
-tis_r
-[1];
-
-595 
-i
-;
-
-597 
-code
-) {
-
-599 
-RTE_CT_TCPOPT_EOL
-:
-
-602 
-RTE_CT_TCPOPT_NOP
-:
-
-603
-ngth
---;
-
-604
-tis_r
-++;
-
-607 
-RTE_CT_TCPOPT_SACK
-:
-
-616
-ck_blk_size
- =
-size
- - 2;
-
-618
-ck_r
- = (
-ut32_t
- *)(
-tis_r
- + 2);
-
-620 
-num_acks
- =
-ck_blk_size
- >> 2;
-
-622 i(
- `uiky
-(
-ck_blk_size
- > 32 ||
-
-623 ((
-ck_blk_size
- & 0x3) != 0))) {
-
-624
- `tf
-("Sack blockarsing failure\n");
-
-628 
-i
- = 0; i <
-num_acks
-; i++) {
-
-629
-num_befe
- =
- `e_bsw32
-(*
-ck_r
-);
-
-630
-num_a
- =
-num_befe
- +
-diff
-;
-
-631 *
-ck_r
- =
- `e_bsw32
-(
-num_a
-);
-
-632
-ck_r
-++;
-
-633
- `e__eml_t_chksum_upde_32
-(
-
-634
-num_befe
-,
-
-635
-num_a
-,
-
-636 &
-thdr
-->
-cksum
-);
-
-643 i((
-size
- < 2|| (siz>
-ngth
-)) {
-
-644
- `tf
-("ERROR!, opsize %i,ength %i\n",
-
-645
-size
-,
-ngth
-);
-
-649
-tis_r
- +
-size
-;
-
-650
-ngth
- -
-size
-;
-
-652
- }
-}
-
-655
- $e__adju__ack_befe_wdow_check
-(
-
-656 
-e__xn_da
- *
-cd
-,
-
-657
-__e_unud
- *
-i_hdr
-,
-
-658 
-t_hdr
- *
-thdr
-,
-
-659
-e__pkt_dei
-
-d
-)
-
-661
-ut32_t
-
-num_befe
-,
-num_a
-;
-
-663 i(!
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_eablished
-)
-
-666 i(
-d
- !
-RTE_CT_DIR_ORIGINAL
-)
-
-671
-num_befe
- =
- `e_bsw32
-(
-thdr
-->
-cv_ack
-);
-
-672
-num_a
- =
-num_befe
- +
-cd
-->
-_oc
-.
-syroxy_da
-.
-q_diff
-;
-
-673
-thdr
-->
-cv_ack
- =
- `e_bsw32
-(
-num_a
-);
-
-674
- `e__eml_t_chksum_upde_32
-(
-num_befe
-,
-
-675
-num_a
-, &
-thdr
-->
-cksum
-);
-
-680
- `e__adju__ck_s
-(
-thdr
-,
-
-681
-cd
-->
-_oc
-.
-syroxy_da
-.
-q_diff
-);
-
-686
- }
-}
-
-693
- $e__r_t_tis
-(
-
-694
-ut8_t
- *
-tis_r
-,
-
-695
-ut16_t
-
-ngth
-,
-
-696 
-e_syroxy_tis
- *
-t_ts
-)
-
-698 
-size
-;
-
-700
-t_ts
-->
-tis
- = 0;
-
-702 
-ngth
- > 0) {
-
-703
-ut8_t
-
-code
- = *
-tis_r
-++;
-
-705 i(
-code
- =
-RTE_CT_TCPOPT_EOL
-)
-
-708 i(
-code
- =
-RTE_CT_TCPOPT_NOP
-) {
-
-709
-ngth
---;
-
-713
-size
- = *
-tis_r
-++;
-
-715 i(
- `uiky
-(
-size
- < 2 || opsiz>
-ngth
-)) {
-
-717
- `tf
-("parsingrror, opsize: %i,ength: %i\n",
-
-718
-size
-,
-ngth
-);
-
-722 
-code
-) {
-
-724 
-RTE_CT_TCPOPT_MSS
-:
-
-725 i(
-size
- =
-RTE_CT_TCPOLEN_MSS
-) {
-
-726
-ut16_t
- *
-mss_r
- = (ut16_*)
-tis_r
-;
-
-728
-t_ts
-->
-mss
- =
- `e_bsw16
-(*
-mss_r
-);
-
-729
-t_ts
-->
-tis
- |
-RTE_SP_OPTIONS_MSS
-;
-
-733 
-RTE_CT_TCPOPT_WINDOW
-:
-
-734 i(
-size
- =
-RTE_CT_TCPOLEN_WINDOW
-) {
-
-735
-t_ts
-->
-wdow_s
- =
- `RTE_MIN
-(*
-tis_r
-,
-
-736
-RTE_CT_MAX_TCP_WINDOW_SCALE
-);
-
-737
-t_ts
-->
-tis
- |
-RTE_SP_OPTIONS_WINDOW_SCALE
-;
-
-741 
-RTE_CT_TCPOPT_TIMESTAMP
-:
-
-742 i(
-size
- =
-RTE_CT_TCPOLEN_TIMESTAMP
-) {
-
-743
-ut32_t
- *
-ts_v_r
- = (ut32_*)
-tis_r
-;
-
-744
-ut32_t
- *
-ts_e_r
- =
-
-745 (
-ut32_t
- *)(
-tis_r
- + 4);
-
-746
-t_ts
-->
-ts_v
- =
- `e_bsw32
-(*
-ts_v_r
-);
-
-747
-t_ts
-->
-ts_echo_y
- =
-
-748
- `e_bsw32
-(*
-ts_e_r
-);
-
-749
-t_ts
-->
-tis
- |
-RTE_SP_OPTIONS_TIMESTAMP
-;
-
-753 
-RTE_CT_TCPOPT_SACK_PERM
-:
-
-754 i(
-size
- =
-RTE_CT_TCPOLEN_SACK_PERM
-)
-
-755
-t_ts
-->
-tis
- |
-RTE_SP_OPTIONS_SACK_PERM
-;
-
-762
-tis_r
- +
-size
- - 2;
-
-763
-ngth
- -
-size
-;
-
-766
- }
-}
-
-770
- $e__r_tis
-(
-e_mbuf
- *
-pkt
-, 
-e__xn_da
- *
-cd
-)
-
-775 
-_hdr_ngth
- =
- `e__g_IP_hdr_size
-(
-pkt
-);
-
-776 
-t_hdr
- *
-thdr
- = (tcp_hdr *)
-
-777
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
- +
-_hdr_ngth
-);
-
-778
-ut8_t
- *
-t_r
- =
- `RTE_MBUF_METADATA_UINT8_PTR
-(
-pkt
-,
-
-779 (
-IP_START
- +
-_hdr_ngth
- + (
-t_hdr
-)));
-
-781 
-e_syroxy_tis
- *
-t_ts
- =
-
-782 &
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_tis
-;
-
-783 
-ngth__bys
- =
-
-784 ((
-thdr
-->
-da_off
- & 0xf0>> 2- (
-t_hdr
-);
-
-786
- `e__r_t_tis
-(
-t_r
-,
-ngth__bys
-,
-t_ts
-);
-
-787
-t_ts
-->
-l_wdow
- =
-thdr
-->
-rx_w
-;
-
-788
- }
-}
-
-793 
-e_mbuf
- *
-
-794
- $e__g_bufd_syroxy_cks
-(
-
-795 
-e__xn_ack
- *
-
-)
-
-797 
-e_mbuf
- *
-kr_li
- =
-
-->
-bufd_pkt_li
-;
-
-799
-
-->
-bufd_pkt_li
- =
-NULL
-;
-
-800 
-kr_li
-;
-
-801
- }
-}
-
-805 
- $e__ab_syroxy
-(
-e__xn_ack
- *
-
-)
-
-807
-
-->
-misc_tis
-.
-syroxy_abd
- = 1;
-
-808
- `tf
-("rte_ct_enable_synproxy = %d\n",
-
-809
-
-->
-misc_tis
-.
-syroxy_abd
-);
-
-810
- }
-}
-
-812 
- $e__dib_syroxy
-(
-e__xn_ack
- *
-
-)
-
-814
-
-->
-misc_tis
-.
-syroxy_abd
- = 0;
-
-817
- }
-}
-
-820
- $e__bufr_ck
-(
-
-821 
-e__xn_ack
- *
-
-,
-
-822 
-e__xn_da
- *
-cd
-,
-
-823 
-e_mbuf
- *
-pkt
-)
-
-831 
-e_mbuf
- **
-xt
- = (rte_mbuf **)
-
-832
- `RTE_MBUF_METADATA_UINT64_PTR
-(
-pkt
-,
-
-833
-
-->
-por_offt
-);
-
-834 *
-xt
- =
-cd
-->
-_oc
-.
-syroxy_da
-.
-bufd_pkt_li
-;
-
-835
-cd
-->
-_oc
-.
-syroxy_da
-.
-bufd_pkt_li
- =
-pkt
-;
-
-836
- }
-}
-
-839
- $e__a_bufd_cks
-(
-
-840 
-e__xn_ack
- *
-
-,
-
-841 
-e__xn_da
- *
-cd
-)
-
-843 
-e_mbuf
- *
-xn_li
- =
-
-844
-cd
-->
-_oc
-.
-syroxy_da
-.
-bufd_pkt_li
-;
-
-846 i(
-xn_li
- =
-NULL
-)
-
-849
-cd
-->
-_oc
-.
-syroxy_da
-.
-bufd_pkt_li
- =
-NULL
-;
-
-851 
-e_mbuf
- *
-kr_li
- =
-
-->
-bufd_pkt_li
-;
-
-853 i(
-kr_li
- =
-NULL
-)
-
-860 
-xn_li
- !
-NULL
-) {
-
-861 
-e_mbuf
- *
-d_xt
-;
-
-863 
-e_mbuf
- **
-xt
- = (rte_mbuf **)
-
-864
- `RTE_MBUF_METADATA_UINT64_PTR
-(
-xn_li
-,
-
-865
-
-->
-por_offt
-);
-
-867
-d_xt
- = *
-xt
-;
-
-868 *
-xt
- =
-kr_li
-;
-
-869
-kr_li
- =
-xn_li
-;
-
-870
-xn_li
- =
-d_xt
-;
-
-872
-
-->
-bufd_pkt_li
- =
-kr_li
-;
-
-873
- }
-}
-
- @VIL/conntrack/rte_ct_tcp.c
-
-17 
- ~<dlib.h
->
-
-18 
- ~<rg.h
->
-
-19 
- ~<imm.h
->
-
-20 
- ~<ys.h
->
-
-21 
- ~"e__t.h
-"
-
-22 
- ~"e_xn_ackg.h
-"
-
-25 
- #CT_DEBUG
- 0
-
- )
-
-26 
- #STATE_TRACKING
- 0
-
- )
-
-27 
- #RTE_CT_ASSERT
- 0
-
- )
-
-30 
- #META_DATA_OFFSET
- 128
-
- )
-
-31 
- #RTE_PKTMBUF_HEADROOM
- 128
-
- )
-
-32 
- #ETHERNET_START
- (
-META_DATA_OFFSET
- +
-RTE_PKTMBUF_HEADROOM
-)
-
- )
-
-33 
- #ETH_HDR_SIZE
- 14
-
- )
-
-34 
- #IP_START
- (
-ETHERNET_START
- +
-ETH_HDR_SIZE
-)
-
- )
-
-36 
- #IPv4_HEADER_SIZE
- 20
-
- )
-
-37 
- #IPv6_HEADER_SIZE
- 40
-
- )
-
-39 
- #IP_VERSION_4
- 4
-
- )
-
-40 
- #IP_VERSION_6
- 6
-
- )
-
-42 
- #e_a
-(
-q2
-,
-q1
-
- `e_befe
-(q1, seq2)
-
- )
-
-43 
-le
-
-ut8_t
-
- $e_befe
-(
-ut32_t
-
-q1
-, ut32_
-q2
-)
-
-45  (
-t32_t
-(
-q1
- -
-q2
-) < 0;
-
-46
- }
-}
-
-50 
- #NO
-
-RTE_CT_TCP_NONE
-
-
- )
-
-51 
- #SS
-
-RTE_CT_TCP_SYN_SENT
-
-
- )
-
-52 
- #SR
-
-RTE_CT_TCP_SYN_RECV
-
-
- )
-
-53 
- #ES
-
-RTE_CT_TCP_ESTABLISHED
-
-
- )
-
-54 
- #FW
-
-RTE_CT_TCP_FIN_WAIT
-
-
- )
-
-55 
- #CW
-
-RTE_CT_TCP_CLOSE_WAIT
-
-
- )
-
-56 
- #LA
-
-RTE_CT_TCP_LAST_ACK
-
-
- )
-
-57 
- #TW
-
-RTE_CT_TCP_TIME_WAIT
-
-
- )
-
-58 
- #CL
-
-RTE_CT_TCP_CLOSE
-
-
- )
-
-59 
- #S2
-
-RTE_CT_TCP_SYN_SENT_2
-
-
- )
-
-60 
- #IV
-
-RTE_CT_TCP_MAX
-
-
- )
-
-61 
- #IG
-
-RTE_CT_TCP_IGNORE
-
-
- )
-
-63 cڡ
-ut8_t
-
- ge__t_e_b
-[2][6][
-RTE_CT_TCP_MAX
-] = {
-
-66 {
-SS
-, ctSS,
-IG
-, ctIG, ctIG, ctIG, ctIG, ctSS, ctSS,
-
-67
-S2
-},
-
-70 {
-IV
-, ctIV,
-SR
-, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV,
-
-71
-SR
-},
-
-74 {
-IV
-, ctIV,
-FW
-, ctFW,
-LA
-, ctLA, ctLA,
-TW
-,
-CL
-,
-
-75
-IV
-},
-
-77 {
-ES
-,
-IV
-, ctES, ctES,
-CW
-, ctCW,
-TW
-, ctTW,
-CL
-,
-
-78
-IV
-},
-
-81 {
-IV
-,
-CL
-, ctCL, ctCL, ctCL, ctCL, ctCL, ctCL, ctCL,
-
-82
-CL
-},
-
-83 {
-IV
-, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV}
-
-88 {
-IV
-,
-S2
-, ctIV, ctIV, ctIV, ctIV, ctIV,
-SS
-, ctIV,
-
-89
-S2
-},
-
-92 {
-IV
-,
-SR
-,
-IG
-, ctIG, ctIG, ctIG, ctIG, ctIG, ctIG,
-
-93
-SR
-},
-
-96 {
-IV
-, ctIV,
-FW
-, ctFW,
-LA
-, ctLA, ctLA,
-TW
-,
-CL
-,
-
-97
-IV
-},
-
-100 {
-IV
-,
-IG
-,
-SR
-,
-ES
-,
-CW
-, ctCW,
-TW
-, ctTW,
-CL
-,
-
-101
-IG
-},
-
-104 {
-IV
-,
-CL
-, ctCL, ctCL, ctCL, ctCL, ctCL, ctCL, ctCL,
-
-105
-CL
-},
-
-106 {
-IV
-, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV, ctIV}
-
-111
- ee_t_ag
- {
-
-112
- mRTE_CT_TCP_SYN_FLAG
-,
-
-113
- mRTE_CT_TCP_SAK_FLAG
-,
-
-114
- mRTE_CT_TCP_FIN_FLAG
-,
-
-115
- mRTE_CT_TCP_ACK_FLAG
-,
-
-116
- mRTE_CT_TCP_RST_FLAG
-,
-
-117
- mRTE_CT_TCP_ILL_FLAG
-,
-
-120 
-ut8_t
-
- ge__t_ags_to_e_b_dex
-[16] = {
-
-122
-RTE_CT_TCP_ILL_FLAG
-,
-
-123
-RTE_CT_TCP_FIN_FLAG
-,
-
-124
-RTE_CT_TCP_SYN_FLAG
-,
-
-125
-RTE_CT_TCP_ILL_FLAG
-,
-
-126
-RTE_CT_TCP_RST_FLAG
-,
-
-127
-RTE_CT_TCP_RST_FLAG
-,
-
-128
-RTE_CT_TCP_RST_FLAG
-,
-
-129
-RTE_CT_TCP_ILL_FLAG
-,
-
-131
-RTE_CT_TCP_ACK_FLAG
-,
-
-132
-RTE_CT_TCP_FIN_FLAG
-,
-
-133
-RTE_CT_TCP_SAK_FLAG
-,
-
-134
-RTE_CT_TCP_ILL_FLAG
-,
-
-135
-RTE_CT_TCP_RST_FLAG
-,
-
-136
-RTE_CT_TCP_ILL_FLAG
-,
-
-137
-RTE_CT_TCP_RST_FLAG
-,
-
-138
-RTE_CT_TCP_ILL_FLAG
-,
-
-141 
-le
-
-ut8_t
-
-
-142
- $e__g_dex
-(
-ut8_t
-
-t_ags
-)
-
-144
-ut8_t
-
-imp܏_ags
-;
-
-146
-t_ags
- &= 0x3f;
-
-147
-imp܏_ags
- = ((
-t_ags
- & 0x10) >> 1) | (tcp_flags & 7);
-
-150 i(
- `uiky
-((
-t_ags
- == 0) || (tcp_flags == 0x3f)))
-
-152 
-RTE_CT_TCP_ILL_FLAG
-;
-
-154 
-e__t_ags_to_e_b_dex
-[
-imp܏_ags
-];
-
-156
- }
-}
-
-158 
-le
- 
-
-159
- $e__eh_dei_has_ags
-(
-e__xn_da
- *
-cd
-,
-ut8_t
-
-ags
-)
-
-161  ((
-cd
-->
-_oc
-.
-t__da
-.
-
-[0].
-ags
- | cd->
-
-162
-_oc
-.
-t__da
-.
-
-[1].
-ags
-) & flags) != 0;
-
-163
- }
-}
-
-165 
-le
-
-ut32_t
-
- $e__q_us_ngth
-(
-e_mbuf
- *
-pkt
-,
-
-166
-ut8_t
-
-_hdr_size
-)
-
-168
-ut16_t
-
-pkt_ngth
- = 0;
-
-169 
-t_hdr
- *
-thd
- =
-
-170 (
-t_hdr
- *)
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-171 (
-IP_START
- +
-
-172
-_hdr_size
-));
-
-173
-ut32_t
-
-t_hdr_size
- = (
-thd
-->
-da_off
- & 0xf0) >> 2;
-
-175 *
-_hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-177 i(
-_hdr_size
- =
-IPv4_HEADER_SIZE
-) {
-
-178 
-v4_hdr
- *
-ihdr
- = (v4_hd*)
-_hdr
-;
-
-180
-pkt_ngth
- =
- `e_bsw16
-(
-ihdr
-->
-tٮ_ngth
-);
-
-182 i(
-_hdr_size
- =
-IPv6_HEADER_SIZE
-) {
-
-183 
-v6_hdr
- *
-ihdr
- = (v6_hd*)
-_hdr
-;
-
-185
-pkt_ngth
- =
- `e_bsw16
-(
-ihdr
-->
-yld_n
-+
-IPv6_HEADER_SIZE
-;
-
-195 
- `e_bsw32
-(
-thd
-->
-_q
-) +
-
-196
-pkt_ngth
- -
-_hdr_size
- -
-t_hdr_size
- +
-
-197 ((
-thd
-->
-t_ags
- & (
-RTE_CT_TCPHDR_SYN
- |
-RTE_CT_TCPHDR_FIN
-)) !=
-
-200
- }
-}
-
-203
- $e__check_f_slg_d_ck_rm
-(
-
-204 
-e_mbuf
- *
-pkt
-,
-
-205 
-e__t_e
- *
-e
-,
-
-206
-ut8_t
-
-_hdr_size
-)
-
-209 
-t_hdr
- *
-thd
- =
-
-210 (
-t_hdr
- *)
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-211 (
-IP_START
- +
-
-212
-_hdr_size
-));
-
-213
-ut32_t
-
-daoff__bys
- = (
-thd
-->
-da_off
- & 0xf0) >> 2;
-
-214
-ut32_t
-
-ngth
- =
-daoff__bys
- - (
-t_hdr
-);
-
-216
-e
-->
-s
- = 0;
-
-217
-e
-->
-ags
- = 0;
-
-219 i(
-ngth
- == 0)
-
-222
-ut8_t
- *
-tis_r
- =
-
-223
- `RTE_MBUF_METADATA_UINT8_PTR
-(
-pkt
-,
-
-224 (
-IP_START
- +
-_hdr_size
- +
-
-225 (
-t_hdr
-)));
-
-227 
-ngth
- > 0) {
-
-228
-ut8_t
-
-ti
- = *
-tis_r
-;
-
-229
-ut8_t
-
-size
- =
-tis_r
-[1];
-
-232 
-ti
-) {
-
-234 
-RTE_CT_TCPOPT_EOL
-:
-
-238 
-RTE_CT_TCPOPT_NOP
-:
-
-239
-tis_r
-++;
-
-240
-ngth
---;
-
-243 
-RTE_CT_TCPOPT_SACK_PERM
-:
-
-244 i(
-size
- =
-RTE_CT_TCPOLEN_SACK_PERM
-)
-
-245
-e
-->
-ags
- |
-RTE_CT_TCP_FLAG_SACK_PERM
-;
-
-248 
-RTE_CT_TCPOPT_WINDOW
-:
-
-249 i(
-size
- =
-RTE_CT_TCPOLEN_WINDOW
-) {
-
-250
-e
-->
-s
- =
-
-251
- `RTE_MIN
-(
-tis_r
-[2],
-
-252
-RTE_CT_MAX_TCP_WINDOW_SCALE
-);
-
-253
-e
-->
-ags
- |
-RTE_CT_TCP_FLAG_WINDOW_SCALE
-;
-
-262 i((
-size
- < 2|| (siz>
-ngth
-)) {
-
-264
- `tf
-("scaling_and_sack_perm:something wrong\n");
-
-267
-tis_r
- +
-size
-;
-
-268
-ngth
- -
-size
-;
-
-271
- }
-}
-
-274
- $e__tdiy_hdr
-(
-t_hdr
- *
-thd
-)
-
-276
- `tf
-("T hd: src_pt=%d",
- `e_bsw16
-(
-thd
-->
-c_pt
-));
-
-277
- `tf
-(", d_pt=%d",
- `e_bsw16
-(
-thd
-->
-d_pt
-));
-
-278
- `tf
-(", st_q=%u",
- `e_bsw32
-(
-thd
-->
-_q
-));
-
-279
- `tf
-(",ecv_ack=%u",
- `e_bsw32
-(
-thd
-->
-cv_ack
-));
-
-280
- `tf
-(",da_off=%d",
-thd
-->
-da_off
- / 16);
-
-281
- `tf
-(",t_ags=%02x",
-thd
-->
-t_ags
-);
-
-282
- `tf
-(",x_w=%d\n",
- `e_bsw16
-(
-thd
-->
-rx_w
-));
-
-284
- }
-}
-
-286 
-le
- 
-
-287
- $e__r_xn_da
-(
-__e_unud
- 
-e__xn_ack
- *
-
-,
-
-288 
-e__xn_da
- *
-cd
-,
-
-289
-__e_unud
- 
-e_mbuf
- *
-pkt
-)
-
-293
- `memt
-(&
-cd
-->
-_oc
-.
-t__da
-, 0,
-
-294 (
-cd
-->
-_oc
-.
-t__da
-));
-
-295
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- =
-RTE_CT_TCP_ILL_FLAG
-;
-
-297
- }
-}
-
-299
-e__ck_ai
-
-
-300
- $e__t_w_ci
-(
-
-301 
-e__xn_ack
- *
-
-,
-
-302 
-e__xn_da
- *
-cd
-,
-
-303 
-e_mbuf
- *
-pkt
-,
-
-304 
-u_syroxy
-,
-
-305
-ut8_t
-
-_hdr_size
-)
-
-307 
-t_hdr
- *
-thd
- =
-
-308 (
-t_hdr
- *)
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-309 (
-IP_START
- +
-_hdr_size
-));
-
-311
-e__t_es
-
-w_e
-;
-
-312
-ut8_t
-
-dex
-;
-
-313 
-e__t_e
- *
-nd
- =
-
-314 &
-cd
-->
-_oc
-.
-t__da
-.
-
-[
-RTE_CT_DIR_ORIGINAL
-];
-
-315 
-e__t_e
- *
-iv
- =
-
-316 &
-cd
-->
-_oc
-.
-t__da
-.
-
-[
-RTE_CT_DIR_REPLY
-];
-
-317
-ut16_t
-
-w
-;
-
-319 i(
-CT_DEBUG
-)
-
-320
- `e__tdiy_hdr
-(
-thd
-);
-
-322
-dex
- =
- `e__g_dex
-(
-thd
-->
-t_ags
-);
-
-323
-w_e
- =
-e__t_e_b
-[0][
-dex
-][
-RTE_CT_TCP_NONE
-];
-
-325 i(
- `uiky
-(
-w_e
- >
-RTE_CT_TCP_MAX
-)) {
-
-326 i(
-CT_DEBUG
-)
-
-327
- `tf
-("invalidew state with flags %02x\n",
-
-328
-thd
-->
-t_ags
-);
-
-329 
-RTE_CT_DROP_PACKET
-;
-
-337 i(
- `uiky
-((
-w_e
- !
-RTE_CT_TCP_SYN_SENT
-
-
-338 &&
-
-->
-misc_tis
-.
-t_loo
- == 0))) {
-
-341 
-RTE_CT_DROP_PACKET
-;
-
-344 i(
-CT_DEBUG
-)
-
-345
- `tf
-("ew connection with state %s\n",
-
-346
-e__t_mes
-[
-w_e
-]);
-
-349
- `e__r_xn_da
-(
-
-,
-cd
-,
-pkt
-);
-
-350
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-w_e
-;
-
-352
-nd
-->
-d
- = sd->
-maxd
- =
- `e__q_us_ngth
-(
-pkt
-,
-_hdr_size
-);
-
-353
-w
- =
- `e_bsw16
-(
-thd
-->
-rx_w
-);
-
-354
-nd
-->
-maxw
- =
- `RTE_MAX
-(
-w
-, (
-ut32_t
-)1);
-
-356 i(
- `liky
-(
-w_e
- =
-RTE_CT_TCP_SYN_SENT
-)) {
-
-358
- `e__check_f_slg_d_ck_rm
-(
-pkt
-,
-nd
-,
-
-359
-_hdr_size
-);
-
-361
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
- =
-u_syroxy
-;
-
-363 i(
-u_syroxy
-) {
-
-370 i(
-CT_DEBUG
- > 2)
-
-371
- `tf
-("synproxy sending SYN-ACKo client\n");
-
-373 
-RTE_CT_SEND_CLIENT_SYNACK
-;
-
-382
-nd
-->
-maxd
- +nd->
-maxw
-;
-
-383
-nd
-->
-ags
- =
-iv
-->flags =
-
-384 (
-RTE_CT_TCP_FLAG_SACK_PERM
- |
-RTE_CT_TCP_FLAG_BE_LIBERAL
-);
-
-387 i(
-CT_DEBUG
- > 0) {
-
-388
- `tf
-("tcp_new: sendernd=%u maxend=%u maxwin=%u scale=%i",
-
-389
-nd
-->
-d
-, sd->
-maxd
-, sd->
-maxw
-,
-
-390
-nd
-->
-s
-);
-
-391
- `tf
-("eceivernd=%u maxend=%u maxwin=%u scale=%i\n",
-
-392
-iv
-->
-d
-,eiv->
-maxd
-,
-
-393
-iv
-->
-maxw
-,
-
-394
-iv
-->
-s
-);
-
-397 
-RTE_CT_OPEN_CONNECTION
-;
-
-398
- }
-}
-
-400 
-ut32_t
-
-
-401
- $e__t_ck
-(
-e_mbuf
- *
-pkt
-,
-ut8_t
-
-_hdr_size
-)
-
-403 
-t_hdr
- *
-thd
- =
-
-404 (
-t_hdr
- *)
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-405 (
-IP_START
- +
-
-406
-_hdr_size
-));
-
-407
-ut16_t
-
-daoff__bys
- = (
-thd
-->
-da_off
- & 0xf0) >> 2;
-
-408
-ut16_t
-
-ngth
- =
-daoff__bys
- - (
-t_hdr
-);
-
-409
-ut32_t
-
-ck
- =
- `e_bsw32
-(
-thd
-->
-cv_ack
-);
-
-411 i(
- `uiky
-(!
-ngth
-))
-
-412 
-ck
-;
-
-414
-ut8_t
- *
-tis_r
- =
- `RTE_MBUF_METADATA_UINT8_PTR
-(
-pkt
-,
-
-415 (
-IP_START
- +
-_hdr_size
- + (
-t_hdr
-)));
-
-417 
-ngth
- > 0) {
-
-418
-ut8_t
-
-code
- = *
-tis_r
-;
-
-419
-ut8_t
-
-size
- =
-tis_r
-[1];
-
-420 
-i
-;
-
-421
-ut32_t
- *
-ck_r
-;
-
-423 
-code
-) {
-
-424 
-RTE_CT_TCPOPT_TIMESTAMP
-:
-
-428 
-RTE_CT_TCPOPT_EOL
-:
-
-429 
-ck
-;
-
-431 
-RTE_CT_TCPOPT_NOP
-:
-
-432
-ngth
---;
-
-433
-tis_r
-++;
-
-436 
-RTE_CT_TCPOPT_SACK
-:
-
-446 i((
-size
- >(
-RTE_CT_TCPOLEN_PER_SACK_ENTRY
- + 2)) &&
-
-447 ((
-size
- - 2) %
-
-448
-RTE_CT_TCPOLEN_PER_SACK_ENTRY
-) == 0) {
-
-451
-tis_r
- += 6;
-
-452 
-i
- = 0; i < (
-size
- - 2); i +=
-
-453
-RTE_CT_TCPOLEN_PER_SACK_ENTRY
-) {
-
-454
-ck_r
- =
-
-455 (
-ut32_t
- *&
-tis_r
-[
-i
-];
-
-456
-ut32_t
-
-ack
- =
- `e_bsw32
-(*
-ck_r
-);
-
-458 i(
- `e_a
-(
-ack
-,
-ck
-))
-
-459
-ck
- =
-ack
-;
-
-461 
-ck
-;
-
-467 i((
-size
- < 2|| (siz>
-ngth
-)) {
-
-468
- `tf
-("rte_ct_tcp_sack: something wrong, opsize %i,",
-
-469
-size
-);
-
-470
- `tf
-("gth %i\n",
-ngth
-);
-
-471 
-ck
-;
-
-473
-tis_r
- +
-size
-;
-
-474
-ngth
- -
-size
-;
-
-476 
-ck
-;
-
-477
- }
-}
-
-483 
-le
- 
-
-484
- $e__check_f_smissis
-(
-
-485 
-e__t
- *
-e
-,
-
-486
-ut8_t
-
-d
-,
-
-487
-ut32_t
-
-q
-,
-
-488
-ut32_t
-
-ack
-,
-
-489
-ut32_t
-
-d
-,
-
-490
-ut16_t
-
-w
-)
-
-492 i(
-e
-->
-ϡ_d
- =
-d
-
-
-493 &&
-e
-->
-ϡ_q
- =
-q
-
-
-494 &&
-e
-->
-ϡ_ack
- =
-ack
-
-
-495 &&
-e
-->
-ϡ_d
- =
-d
- && s->
-ϡ_w
- =
-w
-)
-
-496
-e
-->
-s
-++;
-
-498
-e
-->
-ϡ_d
- =
-d
-;
-
-499
-e
-->
-ϡ_q
- =
-q
-;
-
-500
-e
-->
-ϡ_ack
- =
-ack
-;
-
-501
-e
-->
-ϡ_d
- =
-d
-;
-
-502
-e
-->
-ϡ_w
- =
-w
-;
-
-503
-e
-->
-s
- = 0;
-
-505
- }
-}
-
-511 
-ut8_t
-
-
-512
- $e__t__wdow
-(
-
-513 
-e__xn_da
- *
-cd
-,
-
-514 
-e__xn_ack
- *
-
-,
-
-515 
-e__t
- *
-e
-,
-
-516
-e__pkt_dei
-
-d
-,
-
-517
-ut8_t
-
-dex
-,
-
-518 
-e_mbuf
- *
-pkt
-,
-
-519
-ut8_t
-
-_hdr_size
-)
-
-521 
-e__t_e
- *
-nd
- = &
-e
-->
-
-[
-d
-];
-
-522 
-e__t_e
- *
-iv
- = &
-e
-->
-
-[!
-d
-];
-
-523
-ut32_t
-
-q
-,
-ack
-,
-ck
-,
-d
-,
-w
-,
-sw
-;
-
-524
-ut8_t
-
-_cv_w
-,
-t_ags
-;
-
-525
-e__ck_ai
-
-s
-;
-
-527 *
-hdr
- =
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-IP_START
-);
-
-528 
-t_hdr
- *
-thd
- =
-
-529 (
-t_hdr
- *)
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-,
-
-530 (
-IP_START
- +
-_hdr_size
-));
-
-532 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
-)
-
-533
- `e__adju__ack_befe_wdow_check
-(
-cd
-,
-hdr
-,
-
-534
-thd
-,
-d
-);
-
-537
-q
- =
- `e_bsw32
-(
-thd
-->
-_q
-);
-
-538
-ack
- =
-ck
- =
- `e_bsw32
-(
-thd
-->
-cv_ack
-);
-
-539
-w
- =
- `e_bsw16
-(
-thd
-->
-rx_w
-);
-
-540
-d
- =
- `e__q_us_ngth
-(
-pkt
-,
-_hdr_size
-);
-
-541
-t_ags
- =
-thd
-->tcp_flags;
-
-543 i(
-iv
-->
-ags
- &
-RTE_CT_TCP_FLAG_SACK_PERM
-)
-
-544
-ck
- =
- `e__t_ck
-(
-pkt
-,
-_hdr_size
-);
-
-546 i(
- `uiky
-(
-nd
-->
-maxw
- == 0)) {
-
-548 i(
-t_ags
- &
-RTE_CT_TCPHDR_SYN
-) {
-
-553
-nd
-->
-d
- = sd->
-maxd
- =nd;
-
-554
-nd
-->
-maxw
- =
- `RTE_MAX
-(
-w
-, (
-ut32_t
-)1);
-
-556
- `e__check_f_slg_d_ck_rm
-(
-pkt
-,
-nd
-,
-
-557
-_hdr_size
-);
-
-563 i((
-nd
-->
-
-564
-ags
- &
-iv
-->flags &
-
-565
-RTE_CT_TCP_FLAG_WINDOW_SCALE
-) == 0)
-
-566
-nd
-->
-s
- =
-iv
-->scale = 0;
-
-568 i(!(
-t_ags
- &
-RTE_CT_TCPHDR_ACK
-))
-
-576
-nd
-->
-d
- =nd;
-
-577
-sw
- =
-w
- <<
-nd
-->
-s
-;
-
-578
-nd
-->
-maxw
- = (
-sw
- == 0 ? 1 : swin);
-
-579
-nd
-->
-maxd
- =
-d
- + sd->
-maxw
-;
-
-585 i(
-iv
-->
-maxw
- == 0)
-
-586
-iv
-->
-d
- =eiv->
-maxd
- =
-ck
-;
-
-590 i(((
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-RTE_CT_TCP_SYN_SENT
- &&
-
-591
-d
- =
-RTE_CT_DIR_ORIGINAL
-) ||
-
-592 (
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-RTE_CT_TCP_SYN_RECV
- &&
-
-593
-d
- =
-RTE_CT_DIR_REPLY
-)&&
- `e_a
-(
-d
-,
-nd
-->end)) {
-
-599
-nd
-->
-d
- = sd->
-maxd
- =nd;
-
-600
-nd
-->
-maxw
- =
- `RTE_MAX
-(
-w
-, (
-ut32_t
-)1);
-
-602
- `e__check_f_slg_d_ck_rm
-(
-pkt
-,
-nd
-,
-
-603
-_hdr_size
-);
-
-606 i(!(
-t_ags
- &
-RTE_CT_TCPHDR_ACK
-) ||
-
-607 (((
-t_ags
- &
-RTE_CT_TCPHDR_RST_ACK
-) ==
-
-608
-RTE_CT_TCPHDR_RST_ACK
-&& (
-ack
- == 0))) {
-
-610
-ack
- =
-ck
- =
-iv
-->
-d
-;
-
-613 i((
-t_ags
- &
-RTE_CT_TCPHDR_RST
-&&
-q
- == 0 &&
-
-614
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-RTE_CT_TCP_SYN_SENT
-)
-
-616
-q
- =
-d
- =
-nd
-->end;
-
-619
-_cv_w
- = !
-iv
-->
-maxw
- ||
-
-620
- `e_a
-(
-d
-,
-nd
-->d -
-iv
-->
-maxw
- - 1);
-
-622 i(
- `e_befe
-(
-q
-,
-nd
-->
-maxd
- + 1&&
-_cv_w
- &&
-
-623
- `e_befe
-(
-ck
-,
-iv
-->
-d
- + 1) &&
-
-624
- `e_a
-(
-ck
-,
-
-625
-iv
-->
-d
- -
- `RTE_MAX
-(
-nd
-->
-maxw
-,
-
-626 (
-ut32_t
-)
-RTE_MAX_ACKWIN_CONST
-) - 1)) {
-
-633 i(!(
-t_ags
- &
-RTE_CT_TCPHDR_SYN
-))
-
-634
-w
- <<
-nd
-->
-s
-;
-
-637
-sw
- =
-w
- + (
-ck
- -
-ack
-);
-
-638
-nd
-->
-maxw
- =
- `RTE_MAX
-(nd->maxw,
-sw
-);
-
-640 i(
- `e_a
-(
-d
-,
-nd
-->end)) {
-
-641
-nd
-->
-d
- =nd;
-
-642
-nd
-->
-ags
- |
-RTE_CT_TCP_FLAG_DATA_UNACKNOWLEDGED
-;
-
-645 i(
-t_ags
- &
-RTE_CT_TCPHDR_ACK
-) {
-
-646 i(!(
-nd
-->
-ags
- &
-RTE_CT_TCP_FLAG_MAXACK_SET
-)) {
-
-647
-nd
-->
-maxack
- =
-ack
-;
-
-648
-nd
-->
-ags
- |
-RTE_CT_TCP_FLAG_MAXACK_SET
-;
-
-649 } i(
- `e_a
-(
-ack
-,
-nd
-->
-maxack
-))
-
-650
-nd
-->
-maxack
- =
-ack
-;
-
-654 i(
-iv
-->
-maxw
- !0 &&
- `e_a
-(
-d
-,
-nd
-->
-maxd
-))
-
-655
-iv
-->
-maxw
- +
-d
- -
-nd
-->
-maxd
-;
-
-657 i(
- `e_a
-(
-ck
- +
-w
-,
-iv
-->
-maxd
- - 1))
-
-658
-iv
-->
-maxd
- =
-ck
- +
- `RTE_MAX
-(
-w
-, (
-ut32_t
-)1);
-
-660 i(
-ack
- =
-iv
-->
-d
-)
-
-661
-iv
-->
-ags
- &~
-RTE_CT_TCP_FLAG_DATA_UNACKNOWLEDGED
-;
-
-664 i(
-dex
- =
-RTE_CT_TCP_ACK_FLAG
-)
-
-665
- `e__check_f_smissis
-(
-e
-,
-d
-,
-q
-,
-ack
-,
-
-666
-d
-,
-w
-);
-
-667
-s
- = 1;
-
-669
-s
- = (
-nd
-->
-ags
- &
-RTE_CT_TCP_FLAG_BE_LIBERAL
- ||
-
-670
-
-->
-misc_tis
-.
-t_be_lib
-);
-
-673 i(
-CT_DEBUG
-) {
-
-674 i(!
-s
-) {
-
-676
- `tf
-("t__wdow FAILED f %p\n",
-cd
-);
-
-677
- `tf
-("rte_before(%u, %u + 1) is %d\n",
-
-678
-q
-,
-nd
-->
-maxd
- + 1,
-
-679
- `e_befe
-(
-q
-,
-nd
-->
-maxd
- + 1));
-
-680
- `tf
-("!%u ||te_after(%u, %u - %u - 1) is %d\n",
-
-681
-iv
-->
-maxw
-,
-d
-,
-nd
-->end,
-
-682
-iv
-->
-maxw
-,
-_cv_w
-);
-
-683
- `tf
-("e_befe(%u, %u + 1i%d\n",
-ck
-,
-
-684
-iv
-->
-d
-,
- `e_befe
-(
-ck
-,
-
-685
-iv
-->
-d
- + 1));
-
-686
-tf
-
-
-688
-ck
-,
-iv
-->
-d
-,
-nd
-->
-maxw
-,
-
-689
-RTE_MAX_ACKWIN_CONST
-,
- `e_a
-(
-ck
-,
-
-690
-iv
-->
-d
- -
- `RTE_MAX
-(
-nd
-->
-maxw
-,
-
-691 (
-ut32_t
-)
-RTE_MAX_ACKWIN_CONST
-)
-
-696 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
-)
-
-697
- `e__adju_rv_q_a_wdow_check
-(
-cd
-,
-hdr
-,
-
-698
-thd
-,
-d
-);
-
-699 
-s
-;
-
-700
- }
-}
-
-703 
-le
-
-ut8_t
-
-
-704
- $e__choo_m_timeout_e
-(
-
-705 
-e__xn_ack
- *
-
-,
-
-706
-ut8_t
-
-e1
-,
-
-707
-ut8_t
-
-e2
-)
-
-709 i(
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-e1
-] <
-
-710
-
-->
-_timeout
-.
-ttimeout
-.
-t_timeouts
-[
-e2
-])
-
-711 
-e1
-;
-
-713 
-e2
-;
-
-714
- }
-}
-
-718
-e__ck_ai
-
-
-719
- $e__vify_t_ck
-(
-
-720 
-e__xn_ack
- *
-
-,
-
-721 
-e__xn_da
- *
-cd
-,
-
-722 
-e_mbuf
- *
-pkt
-,
-
-723
-ut8_t
-
-key_was_杳d
-,
-
-724
-ut8_t
-
-_hdr_size
-)
-
-726 
-t_hdr
- *
-thd
- = (tcp_hdr *)
-
-727
- `RTE_MBUF_METADATA_UINT32_PTR
-(
-pkt
-, (
-IP_START
- +
-_hdr_size
-));
-
-729
-e__t_es
-
-w_e
-,
-d_e
-;
-
-730
-e__pkt_dei
-
-d
-;
-
-731
-ut8_t
-
-dex
-;
-
-735
-ut8_t
-
-timeout_e
-;
-
-737
-d
- = (
-cd
-->
-key_is__d
- =!
-key_was_杳d
-);
-
-739 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
- &&
-
-740
-cd
-->
-_oc
-.
-syroxy_da
-.
-hf_eablished
- &&
-
-741 !
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_eablished
- &&
-
-742
-d
- =
-RTE_CT_DIR_ORIGINAL
-) {
-
-748
- `e__bufr_ck
-(
-
-,
-cd
-,
-pkt
-);
-
-749 
-RTE_CT_HIJACK
-;
-
-752
-ut32_t
-
-cv_ack
- =
- `e_bsw32
-(
-thd
-->recv_ack);
-
-753
-ut32_t
-
-_q
- =
- `e_bsw32
-(
-thd
-->sent_seq);
-
-755 
-check_wdow
- = 1;
-
-756
-e__ck_ai
-
-tu_ai
- =
-RTE_CT_FORWARD_PACKET
-;
-
-760
-d_e
- =
-cd
-->
-_oc
-.
-t__da
-.
-e
-;
-
-761
-dex
- =
- `e__g_dex
-(
-thd
-->
-t_ags
-);
-
-762
-w_e
- =
-e__t_e_b
-[
-d
-][
-dex
-][
-d_e
-];
-
-764 i(
-w_e
- =
-RTE_CT_TCP_MAX
-) {
-
-765 i(
-CT_DEBUG
-) {
-
-766
- `tf
-("!!!!invalid stateransition from %s ",
-
-767
-e__t_mes
-[
-d_e
-]);
-
-768
- `tf
-("with flags 0x%02x\n",
-
-769
-thd
-->
-t_ags
-);
-
-772
-
-->
-cous
-->
-pkts_dr_vid_e
-++;
-
-773 
-RTE_CT_DROP_PACKET
-;
-
-776 i(
-STATE_TRACKING
- &&
-w_e
- !
-d_e
-)
-
-777
- `tf
-("ew s %s\n",
-e__t_mes
-[
-w_e
-]);
-
-779 
-w_e
-) {
-
-781 
-RTE_CT_TCP_ESTABLISHED
-:
-
-783 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
- &&
-
-784 !
-cd
-->
-_oc
-.
-syroxy_da
-.
-hf_eablished
- &&
-
-785 (
-d_e
- =
-RTE_CT_TCP_SYN_RECV
-)) {
-
-793 i(
-STATE_TRACKING
-) {
-
-794
- `tf
-(" synproxy first half-cnxn complete,");
-
-795
- `tf
-("ew state %s\n",
-
-796
-e__t_mes
-[
-RTE_CT_TCP_SYN_SENT
-]);
-
-798
-cd
-->
-_oc
-.
-syroxy_da
-.
-hf_eablished
- =
-ue
-;
-
-800
- `e__cvt_to_ood_rv_syn
-(
-cd
-,
-pkt
-);
-
-801
- `e__r_xn_da
-(
-
-,
-cd
-,
-pkt
-);
-
-802
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-RTE_CT_TCP_SYN_SENT
-;
-
-804 
-e__t_e
- *
-nd
- =
-
-805 &
-cd
-->
-_oc
-.
-t__da
-.
-
-806
-
-[
-RTE_CT_DIR_ORIGINAL
-];
-
-807
-ut16_t
-
-w
- =
- `e_bsw16
-(
-thd
-->
-rx_w
-);
-
-809
-nd
-->
-d
- = sd->
-maxd
- =
-
-810
- `e__q_us_ngth
-(
-pkt
-,
-_hdr_size
-);
-
-811
-nd
-->
-maxw
- =
- `RTE_MAX
-(
-w
-, (
-ut32_t
-)1);
-
-812
- `e__check_f_slg_d_ck_rm
-(
-pkt
-,
-nd
-,
-
-813
-_hdr_size
-);
-
-815
- `e__t_xn_tim_f_t
-(
-
-,
-cd
-,
-
-816
-RTE_CT_TCP_SYN_SENT
-);
-
-817 
-RTE_CT_SEND_SERVER_SYN
-;
-
-821 
-RTE_CT_TCP_SYN_RECV
-:
-
-823 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
- &&
-
-824
-cd
-->
-_oc
-.
-syroxy_da
-.
-hf_eablished
- &&
-
-825 !
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_eablished
-) {
-
-833 i(!
- `e__t__wdow
-(
-cd
-,
-
-,
-
-834 &
-cd
-->
-_oc
-.
-t__da
-,
-
-835
-d
-,
-dex
-,
-pkt
-,
-_hdr_size
-)) {
-
-836
-
-->
-cous
-->
-pkts_dr_outof_wdow
-++;
-
-837 
-RTE_CT_DROP_PACKET
-;
-
-840 i(
-STATE_TRACKING
-) {
-
-841
- `tf
-("synproxy full cnxn complete,");
-
-842
- `tf
-("ew s %s\n",
-e__t_mes
-
-
-843 [
-RTE_CT_TCP_ESTABLISHED
-]);
-
-852
- `e__cvt_to_ood_rv_ack
-(
-cd
-,
-pkt
-);
-
-854
-dex
- =
- `e__g_dex
-(
-thd
-->
-t_ags
-);
-
-856 i(!
- `e__t__wdow
-(
-cd
-,
-
-,
-
-857 &
-cd
-->
-_oc
-.
-t__da
-,
-
-858 !
-d
-,
-dex
-,
-pkt
-,
-_hdr_size
-)) {
-
-859
-
-->
-cous
-->
-pkts_dr_outof_wdow
-++;
-
-860 
-RTE_CT_DROP_PACKET
-;
-
-865
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-
-866
-RTE_CT_TCP_ESTABLISHED
-;
-
-867
-
-->
-cous
-->
-ssis_eablished
-++;
-
-868
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_eablished
- =
-ue
-;
-
-869
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- =
-dex
-;
-
-870
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
- = !
-d
-;
-
-872
- `e__t_xn_tim_f_t
-(
-
-,
-cd
-,
-
-873
-RTE_CT_TCP_ESTABLISHED
-);
-
-874
- `e__a_bufd_cks
-(
-
-,
-cd
-);
-
-876 
-RTE_CT_SEND_SERVER_ACK
-;
-
-879 
-RTE_CT_TCP_SYN_SENT
-:
-
-886 i(
-d_e
- <
-RTE_CT_TCP_TIME_WAIT
-)
-
-894 
-RTE_CT_REOPEN_CNXN_AND_FORWARD_PACKET
-;
-
-896 
-RTE_CT_TCP_IGNORE
-:
-
-912 i(
-cd
-->
-_oc
-.
-syroxy_da
-.
-syroxd
- &&
-
-913 !
-cd
-->
-_oc
-.
-syroxy_da
-.
-xn_eablished
-)
-
-914 
-RTE_CT_DROP_PACKET
-;
-
-916 i(
-dex
- =
-RTE_CT_TCP_SAK_FLAG
- &&
-
-917
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- ==
-
-918
-RTE_CT_TCP_SYN_FLAG
-
-
-919 &&
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
- !
-d
-
-
-920 &&
-cv_ack
- =
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
-) {
-
-928 
-e__t_e
- *
-ϡ_
- =
-
-929 &
-cd
-->
-_oc
-.
-t__da
-.
-
-[cd->ct_protocol.
-
-930
-t__da
-.
-
-931
-ϡ_d
-];
-
-935
-d_e
- =
-RTE_CT_TCP_SYN_SENT
-;
-
-936
-w_e
- =
-RTE_CT_TCP_SYN_RECV
-;
-
-938
-ϡ_
-->
-d
- =
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
-;
-
-939
-ϡ_
-->
-maxd
- =
-
-940
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
-;
-
-941
-ϡ_
-->
-maxw
- =
-
-942
- `RTE_MAX
-(
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_w
-,
-
-943 (
-ut32_t
-)1);
-
-944
-ϡ_
-->
-s
- =
-
-945
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ws
-;
-
-946
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ags
- &=
-
-947 ~
-RTE_CT_EXP_CHALLENGE_ACK
-;
-
-948
-ϡ_
-->
-ags
- =
-
-949
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ags
-;
-
-950
- `memt
-(&
-cd
-->
-_oc
-.
-t__da
-.
-
-[
-d
-], 0,
-
-951 (
-e__t_e
-));
-
-955
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- =
-dex
-;
-
-956
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
- =
-d
-;
-
-957
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_q
- =
-_q
-;
-
-958
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
- =
-
-959
- `e__q_us_ngth
-(
-pkt
-,
-_hdr_size
-);
-
-960
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_w
- =
-
-961
- `e_bsw16
-(
-thd
-->
-rx_w
-);
-
-971 i(
-dex
- =
-RTE_CT_TCP_SYN_FLAG
- &&
-
-972
-d
- =
-RTE_CT_DIR_ORIGINAL
-) {
-
-973 
-e__t_e
-
-
-;
-
-976
- `e__check_f_slg_d_ck_rm
-(
-pkt
-, &
-
-,
-
-977
-_hdr_size
-);
-
-980
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ags
- =
-
-.
-ags
-;
-
-981
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ws
- =
-
-982 (
-
-.
-ags
- &
-RTE_CT_TCP_FLAG_WINDOW_SCALE
-) == 0 ?
-
-983 0 :
-
-.
-s
-;
-
-990 i(
-d_e
- =
-RTE_CT_TCP_LAST_ACK
-)
-
-991
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ags
- |=
-
-992
-RTE_CT_EXP_CHALLENGE_ACK
-;
-
-994 
-RTE_CT_FORWARD_PACKET
-;
-
-996 
-RTE_CT_TCP_TIME_WAIT
-:
-
-1002 i(
-d_e
- =
-RTE_CT_TCP_LAST_ACK
- &&
-
-1003
-dex
- =
-RTE_CT_TCP_ACK_FLAG
- &&
-
-1004
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
- !
-d
- &&
-
-1005
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- ==
-
-1006
-RTE_CT_TCP_SYN_FLAG
-
-
-1007 && (
-cd
-->
-_oc
-.
-t__da
-.
-
-1008
-ϡ_ags
- &
-RTE_CT_EXP_CHALLENGE_ACK
-)) {
-
-1010
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_ags
- &=
-
-1011 ~
-RTE_CT_EXP_CHALLENGE_ACK
-;
-
-1012 
-RTE_CT_FORWARD_PACKET
-;
-
-1016 
-RTE_CT_TCP_CLOSE
-:
-
-1018 i(
-dex
- =
-RTE_CT_TCP_RST_FLAG
-) {
-
-1025 i((
-cd
-->
-_oc
-.
-t__da
-.
-
-[!
-d
-].
-ags
- &
-
-1026
-RTE_CT_TCP_FLAG_MAXACK_SET
-) &&
-
-1027
- `e_befe
-(
-_q
-,
-cd
-->
-_oc
-.
-
-1028
-t__da
-.
-
-[!
-d
-].
-maxack
-)) {
-
-1030
-
-->
-cous
-->
-pkts_dr_vid_r
-++;
-
-1032 
-RTE_CT_DROP_PACKET
-;
-
-1035 i(((
-cd
-->
-cnus
- =
-RTE_SEEN_REPLY_CONN
- &&
-
-1036
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- ==
-
-1037
-RTE_CT_TCP_SYN_FLAG
-) ||
-
-1038 (
-cd
-->
-cnus
- !
-RTE_ASSURED_CONN
- &&
-
-1039
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- ==
-
-1040
-RTE_CT_TCP_ACK_FLAG
-)) &&
-
-1041
-cv_ack
- ==
-
-1042
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
-) {
-
-1045
-check_wdow
- = 0;
-
-1054 i(
- `liky
-(
-check_wdow
-)) {
-
-1055 i(
- `uiky
-(!
- `e__t__wdow
-(
-cd
-,
-
-,
-
-1056 &
-cd
-->
-_oc
-.
-t__da
-,
-
-1057
-d
-,
-dex
-,
-
-1058
-pkt
-,
-_hdr_size
-))) {
-
-1059
-
-->
-cous
-->
-pkts_dr_outof_wdow
-++;
-
-1060 
-RTE_CT_DROP_PACKET
-;
-
-1064 i(
-w_e
- =
-RTE_CT_TCP_ESTABLISHED
- &&
-
-1065
-d_e
- !
-RTE_CT_TCP_ESTABLISHED
-)
-
-1068
-
-->
-cous
-->
-ssis_eablished
-++;
-
-1070
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_dex
- =
-dex
-;
-
-1071
-cd
-->
-_oc
-.
-t__da
-.
-ϡ_d
- =
-d
-;
-
-1073 i(
-dex
- =
-RTE_CT_TCP_SAK_FLAG
-)
-
-1074
-cd
-->
-cnus
- =
-RTE_SEEN_REPLY_CONN
-;
-
-1076
-timeout_e
- =
-w_e
-;
-
-1078 i(
-cd
-->
-_oc
-.
-t__da
-.
-s
- >=
-
-1079
-
-->
-misc_tis
-.
-t_max_s
-)
-
-1080
-timeout_e
- =
-
-1081
- `e__choo_m_timeout_e
-(
-
-,
-timeout_e
-,
-
-1082
-RTE_CT_TCP_RETRANS
-);
-
-1083 i(
- `e__eh_dei_has_ags
-(
-cd
-,
-
-1084
-RTE_CT_TCP_FLAG_DATA_UNACKNOWLEDGED
-))
-
-1085
-timeout_e
- =
-
-1086
- `e__choo_m_timeout_e
-(
-
-,
-timeout_e
-,
-
-1087
-RTE_CT_TCP_UNACK
-);
-
-1089 i(
-cd
-->
-cnus
- !
-RTE_SEEN_REPLY_CONN
-) {
-
-1090 i(
-thd
-->
-t_ags
- &
-RTE_CT_TCPHDR_RST
-) {
-
-1097 
-RTE_CT_DESTROY_CNXN_AND_FORWARD_PACKET
-;
-
-1101 i(
-w_e
- =
-RTE_CT_TCP_ESTABLISHED
-)
-
-1102
-timeout_e
- =
- `e__choo_m_timeout_e
-(
-
-,
-
-1103
-timeout_e
-,
-
-1104
-RTE_CT_TCP_UNACK
-);
-
-1106 } i(
-cd
-->
-cnus
- !
-RTE_ASSURED_CONN
- &&
-
-1107 (
-d_e
- =
-RTE_CT_TCP_SYN_RECV
-
-
-1108 ||
-d_e
- =
-RTE_CT_TCP_ESTABLISHED
-)
-
-1109 &&
-w_e
- =
-RTE_CT_TCP_ESTABLISHED
-)
-
-1110
-cd
-->
-cnus
- =
-RTE_ASSURED_CONN
-;
-
-1112
-cd
-->
-_oc
-.
-t__da
-.
-e
- =
-w_e
-;
-
-1113
- `e__t_xn_tim_f_t
-(
-
-,
-cd
-,
-timeout_e
-);
-
-1115 
-tu_ai
-;
-
-1116
- }
-}
-
- @VIL/conntrack/rte_ct_tcp.h
-
-17 #ide
-__INCLUDE_RTE_CT_TCP_H__
-
-
-18 
- #__INCLUDE_RTE_CT_TCP_H__
-
-
- )
-
-19 
- ~<dlib.h
->
-
-20 
- ~<rg.h
->
-
-21 
- ~<ys.h
->
-
-23 
- ~<e_t.h
->
-
-24 
- ~<e_pt.h
->
-
-25 
- ~<e_tim.h
->
-
-26 
- ~<e_.h
->
-
-27 
- ~<e_t.h
->
-
-28 
- ~<e_udp.h
->
-
-29 
- ~<e_pt.h
->
-
-30 
- ~<e_byd.h
->
-
-31 
- ~"e_xn_ackg.h
-"
-
-37 
- #RTE_CT_TCPOPT_EOL
- 0
-
- )
-
-38 
- #RTE_CT_TCPOPT_NOP
- 1
-
- )
-
-39 
- #RTE_CT_TCPOPT_MSS
- 2
-
- )
-
-40 
- #RTE_CT_TCPOPT_WINDOW
- 3
-
- )
-
-41 
- #RTE_CT_TCPOPT_SACK_PERM
- 4
-
- )
-
-42 
- #RTE_CT_TCPOPT_SACK
- 5
-
- )
-
-43 
- #RTE_CT_TCPOPT_TIMESTAMP
- 8
-
- )
-
-45 
- #RTE_CT_TCPOLEN_MSS
- 4
-
- )
-
-46 
- #RTE_CT_TCPOLEN_WINDOW
- 3
-
- )
-
-47 
- #RTE_CT_TCPOLEN_SACK_PERM
- 2
-
- )
-
-48 
- #RTE_CT_TCPOLEN_TIMESTAMP
- 10
-
- )
-
-49 
- #RTE_CT_TCPOLEN_PER_SACK_ENTRY
- 8
-
- )
-
-51 
- #RTE_CT_TCPOLEN_MSS_ALIGNED
- 4
-
- )
-
-52 
- #RTE_CT_TCPOLEN_WINDOW_ALIGNED
- 4
-
- )
-
-53 
- #RTE_CT_TCPOLEN_SACK_PERM_ALIGNED
- 4
-
- )
-
-54 
- #RTE_CT_TCPOLEN_TIMESTAMP_ALIGNED
- 12
-
- )
-
-56 
- #RTE_CT_MAX_TCP_WINDOW_SCALE
- 14
-
- )
-
-58 
- #RTE_SP_OPTIONS_MSS
- 1
-
- )
-
-59 
- #RTE_SP_OPTIONS_WINDOW_SCALE
- 2
-
- )
-
-60 
- #RTE_SP_OPTIONS_TIMESTAMP
- 4
-
- )
-
-61 
- #RTE_SP_OPTIONS_SACK_PERM
- 8
-
- )
-
-64
- ee__ck_ai
- {
-
-65
- mRTE_CT_OPEN_CONNECTION
-,
-
-66
- mRTE_CT_DROP_PACKET
-,
-
-67
- mRTE_CT_FORWARD_PACKET
-,
-
-68
- mRTE_CT_DESTROY_CNXN_AND_FORWARD_PACKET
-,
-
-69
- mRTE_CT_REOPEN_CNXN_AND_FORWARD_PACKET
-,
-
-70
- mRTE_CT_SEND_CLIENT_SYNACK
-,
-
-71
- mRTE_CT_SEND_SERVER_SYN
-,
-
-72
- mRTE_CT_SEND_SERVER_ACK
-,
-
-73
- mRTE_CT_HIJACK
-
-
-76
- ee__cnus
- {
-
-77
- mRTE_INIT_CONN
-,
-
-78
- mRTE_SEEN_REPLY_CONN
-,
-
-79
- mRTE_ASSURED_CONN
-
-
-84 cڡ *cڡ
- ge__t_mes
-[] = {
-
-100 cڡ *cڡ
- ge__udp_mes
-[] = {
-
-107 
- #RTE_MAX_ACKWIN_CONST
- 66000
-
- )
-
-110 
- #RTE_CT_TCP_FLAG_WINDOW_SCALE
- 0x01
-
- )
-
-113 
- #RTE_CT_TCP_FLAG_SACK_PERM
- 0x02
-
- )
-
-116 
- #RTE_CT_TCP_FLAG_CLOSE_INIT
- 0x04
-
- )
-
-119 
- #RTE_CT_TCP_FLAG_BE_LIBERAL
- 0x08
-
- )
-
-122 
- #RTE_CT_TCP_FLAG_DATA_UNACKNOWLEDGED
- 0x10
-
- )
-
-125 
- #RTE_CT_TCP_FLAG_MAXACK_SET
- 0x20
-
- )
-
-127 
- #RTE_CT_EXP_CHALLENGE_ACK
- 0x40
-
- )
-
-132 
- #RTE_CT_TCPHDR_FIN
- 0x01
-
- )
-
-133 
- #RTE_CT_TCPHDR_SYN
- 0x02
-
- )
-
-134 
- #RTE_CT_TCPHDR_RST
- 0x04
-
- )
-
-135 
- #RTE_CT_TCPHDR_ACK
- 0x10
-
- )
-
-137 
- #RTE_CT_TCPHDR_RST_ACK
- (
-RTE_CT_TCPHDR_RST
- |
-RTE_CT_TCPHDR_ACK
-)
-
- )
-
-142
- ee__t_es
- {
-
-143
- mRTE_CT_TCP_NONE
-,
-
-144
- mRTE_CT_TCP_SYN_SENT
-,
-
-145
- mRTE_CT_TCP_SYN_RECV
-,
-
-146
- mRTE_CT_TCP_ESTABLISHED
-,
-
-147
- mRTE_CT_TCP_FIN_WAIT
-,
-
-148
- mRTE_CT_TCP_CLOSE_WAIT
-,
-
-149
- mRTE_CT_TCP_LAST_ACK
-,
-
-150
- mRTE_CT_TCP_TIME_WAIT
-,
-
-151
- mRTE_CT_TCP_CLOSE
-,
-
-152
- mRTE_CT_TCP_SYN_SENT_2
-,
-
-153
- mRTE_CT_TCP_RETRANS
-,
-
-154
- mRTE_CT_TCP_UNACK
-,
-
-155
- mRTE_CT_TCP_IGNORE
-
-
-158
- ee__udp_es
- {
-
-159
- mRTE_CT_UDP_NONE
-,
-
-160
- mRTE_CT_UDP_UNREPLIED
-,
-
-161
- mRTE_CT_UDP_REPLIED
-,
-
-162
- mRTE_CT_UDP_MAX
-
-
-167 
- #RTE_CT_TCP_MAX
-
-RTE_CT_TCP_UNACK
-
-
- )
-
-169
- ee__pkt_dei
- {
-
-170
- mRTE_CT_DIR_ORIGINAL
-,
-
-171
- mRTE_CT_DIR_REPLY
-
-
-174 
- se__t_e
- {
-
-175
-ut32_t
-
- md
-;
-
-176
-ut32_t
-
- mmaxd
-;
-
-177
-ut32_t
-
- mmaxw
-;
-
-178
-ut32_t
-
- mmaxack
-;
-
-179
-ut8_t
-
- ms
-;
-
-180
-ut8_t
-
- mags
-;
-
-183 
- se_syroxy_tis
- {
-
-184
-ut8_t
-
- mtis
-;
-
-185
-ut8_t
-
- mwdow_s
-;
-
-186
-ut16_t
-
- mmss
-;
-
-187
-ut32_t
-
- mts_v
-;
-
-188
-ut32_t
-
- mts_echo_y
-;
-
-189
-ut16_t
-
- ml_wdow
-;
-
-192 
- s__xn_da
- {
-
-196 
-e_mbuf
- *
- mbufd_pkt_li
-;
-
-197
-ut32_t
-
- mig_ood_q
-;
-
-199
-ut32_t
-
- mq_diff
-;
-
-200 
-e_syroxy_tis
-
- mxn_tis
-;
-
-202
-ut8_t
-
- msyroxd
-;
-
-203
-bo
-
- mhf_eablished
-;
-
-205
-bo
-
- mxn_eablished
-;
-
-208 
- se__t
- {
-
-209 
-e__t_e
-
- m
-[2];
-
-210
-ut8_t
-
- me
-;
-
-211
-ut8_t
-
- mϡ_d
-;
-
-214
-ut8_t
-
- ms
-;
-
-215
-ut8_t
-
- mϡ_dex
-;
-
-216
-ut32_t
-
- mϡ_q
-;
-
-217
-ut32_t
-
- mϡ_ack
-;
-
-218
-ut32_t
-
- mϡ_d
-;
-
-219
-ut16_t
-
- mϡ_w
-;
-
-221
-ut8_t
-
- mϡ_ws
-;
-
-222
-ut8_t
-
- mϡ_ags
-;
-
-230 
- se__xn_cous
- {
-
-231
-ut64_t
-
- mcks_ived
-;
-
-232
-ut64_t
-
- mcks_fwded
-;
-
-233
-ut64_t
-
- mcks_drݳd
-;
-
-236 
- se__o
- {
-
-237 
-e__t
-
- mt__da
-;
-
-238 
-__xn_da
-
- msyroxy_da
-;
-
-248 
- se__xn_da
- {
-
-252 
-e_tim
-
- mtim
-;
-
-254 
-e__xn_cous
-
- mcous
-;
-
-258
-ut32_t
-
- mkey
-[10];
-
-260 
-e__o
-
- m_oc
-;
-
-263
-ut64_t
-
- mexed_timeout
-;
-
-266
-ut8_t
-
- me_ud_f_tim
-;
-
-269
-ut8_t
-
- mkey_is__d
-;
-
-270
-ut8_t
-
- mcnus
-;
-
-271
-ut8_t
-
- moc
-;
-
-273
-ut8_t
-
- mty
-;
-
-276
-ut8_t
-
- mg_byss_ag
-;
-
-278
-ut8_t
-
- mrv_dei
-;
-
-279
-t16_t
-
- mtSeqdiff
-;
-
-281
-ut8_t
-
- mp_ssi_ty
-;
-
-282
-ut32_t
-
- mt_yld_size
-;
-
-283
-t16_t
-
- mq_
-;
-
-284
-t16_t
-
- mack_
-;
-
-285
-t16_t
-
- mq_rv
-;
-
-286
-t16_t
-
- mack_rv
-;
-
-288 }
- g__e_che_igd
-;
-
-291 
- #RTE_CT_TCP_MAX_RETRANS
- 3
-
- )
-
-293 
- se__ttimeout
- {
-
-295
-ut64_t
-
- mt_timeouts
-[
-RTE_CT_TCP_MAX
- + 1];
-
-299 
- se__misc_tis
- {
-
-300
-ut8_t
-
- msyroxy_abd
-;
-
-301
-ut32_t
-
- mt_loo
-;
-
-302
-ut32_t
-
- mt_be_lib
-;
-
-303
-ut32_t
-
- mt_max_s
-;
-
-306 
- se__udimeout
- {
-
-307
-ut64_t
-
- mudp_timeouts
-[
-RTE_CT_UDP_MAX
- + 1];
-
-310 
- se__timeout
- {
-
-311 
-e__ttimeout
-
- mttimeout
-;
-
-312 
-e__udimeout
-
- mudimeout
-;
-
-315 
- se__xn_ack
- {
-
-316 
-e_hash
- *
- mrhash
-;
-
-322
-ut32_t
-
- mhash_keys
-[
-RTE_HASH_LOOKUP_BULK_MAX
-][10];
-
-325 *
- mhash_key_rs
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-326 #ifde
-CT_CGNAT
-
-
-327
-ut32_t
-
- mposis
-[
-RTE_HASH_LOOKUP_BULK_MAX
-];
-
-330
-ut32_t
-
- mnum_xn_s
-;
-
-336 
-e__xn_da
- *
- mhash_b_s
-;
-
-337 
-e_CT_cou_block
- *
- mcous
-;
-
-339
-ut64_t
-
- mhtz
-;
-
-340
-ut64_t
-
- mtimg_cyes_r_timg_
-;
-
-341
-ut64_t
-
- mtimg_100ms_s
-;
-
-342
-ut64_t
-
- mtimg_100ms_s_evious
-;
-
-343
-ut64_t
-
- mtimg_ϡ_time
-;
-
-344 
-e__timeout
-
- m_timeout
-;
-
-345 
-e__misc_tis
-
- mmisc_tis
-;
-
-347 
- mme
-[16];
-
-348 
-e__xn_da
- *
- mw_cis
-[64];
-
-349 
-e_mbuf
- *
- mbufd_pkt_li
-;
-
-350 
- mϋ_ci
-;
-
-352
-ut16_t
-
- mpor_offt
-;
-
-353 }
- g__e_che_igd
-;
-
-360
-e__ck_ai
-
-
-361
-e__t_w_ci
-(
-
-362 
-e__xn_ack
- *
-
-,
-
-363 
-e__xn_da
- *
-xn
-,
-
-364 
-e_mbuf
- *
-pkt
-,
-
-365 
-u_syroxy
-,
-
-366
-ut8_t
-
-_hdr_size
-);
-
-373
-e__ck_ai
-
-
-374
-e__vify_t_ck
-(
-
-375 
-e__xn_ack
- *
-
-,
-
-376 
-e__xn_da
- *
-xn
-,
-
-377 
-e_mbuf
- *
-pkt
-,
-
-378
-ut8_t
-
-key_was_杳d
-,
-
-379
-ut8_t
-
-_hdr_size
-);
-
-386
-ut8_t
-
-
-387
-e__udp_w_ci
-(
-
-388 
-e__xn_ack
- *
-
-,
-
-389 
-e__xn_da
- *
-cd
-,
-
-390 
-e_mbuf
- *
-pkt
-);
-
-397
-e__ck_ai
-
-
-398
-e__udp_ck
-(
-
-399 
-e__xn_ack
- *
-
-,
-
-400 
-e__xn_da
- *
-cd
-,
-
-401 
-e_mbuf
- *
-pkt
-,
-
-402
-ut8_t
-
-key_was_杳d
-);
-
-411
-e__t_xn_tim_f_t
-(
-
-412 
-e__xn_ack
- *
-
-,
-
-413 
-e__xn_da
- *
-cd
-,
-
-414
-ut8_t
-
-t_e
-);
-
-417
-e__t_xn_tim_f_udp
-(
-
-418 
-e__xn_ack
- *
-
-,
-
-419 
-e__xn_da
- *
-cd
-,
-
-420
-ut8_t
-
-t_e
-);
-
-423 
-e__nl_xn_tim
-(
-e__xn_da
- *
-cd
-);
-
-435
-e__cvt_to_ood__syck
-(
-e__xn_da
- *
-cd
-,
-
-436 
-e_mbuf
- *
-d_pkt
-);
-
-439
-e__cvt_to_ood_rv_syn
-(
-e__xn_da
- *
-cd
-,
-
-440 
-e_mbuf
- *
-d_pkt
-);
-
-443
-e__cvt_to_ood_rv_ack
-(
-e__xn_da
- *
-cd
-,
-
-444 
-e_mbuf
- *
-d_pkt
-);
-
-451
-e__adju__ack_befe_wdow_check
-(
-
-452 
-e__xn_da
- *
-cd
-,
-
-453 *
-i_hdr
-,
-
-454 
-t_hdr
- *
-thdr
-,
-
-455
-e__pkt_dei
-
-d
-);
-
-458
-e__adju_rv_q_a_wdow_check
-(
-
-459 
-e__xn_da
- *
-cd
-,
-
-460 *
-i_hdr
-,
-
-461 
-t_hdr
- *
-thdr
-,
-
-462
-e__pkt_dei
-
-d
-);
-
-468
-e__r_tis
-(
-e_mbuf
- *
-pkt
-, 
-e__xn_da
- *
-cd
-);
-
-474
-e__bufr_ck
-(
-
-475 
-e__xn_ack
- *
-
-,
-
-476 
-e__xn_da
- *
-cd
-,
-
-477 
-e_mbuf
- *
-pkt
-);
-
-480
-e__a_bufd_cks
-(
-
-481 
-e__xn_ack
- *
-
-,
-
-482 
-e__xn_da
- *
-cd
-);
-
- @VIL/conntrack/rte_ct_udp.c
-
-17 
- ~<dlib.h
->
-
-18 
- ~<rg.h
->
-
-19 
- ~"e__t.h
-"
-
-20 
- ~"e_xn_ackg.h
-"
-
-22
-ut8_t
-
- $e__udp_w_ci
-(
-__e_unud
- 
-e__xn_ack
- *
-
-,
-
-23 
-e__xn_da
- *
-cd
-,
-
-24
-__e_unud
- 
-e_mbuf
- *
-pkt
-)
-
-27
-cd
-->
-cnus
- =
-RTE_INIT_CONN
-;
-
-29
- }
-}
-
-30
-e__ck_ai
-
- $e__udp_ck
-(
-e__xn_ack
- *
-
-,
-
-31 
-e__xn_da
- *
-cd
-,
-
-32
-__e_unud
- 
-e_mbuf
- *
-pkt
-,
-
-33
-ut8_t
-
-key_was_杳d
-)
-
-35
-e__pkt_dei
-
-d
-;
-
-37
-d
- = (
-cd
-->
-key_is__d
- =!
-key_was_杳d
-);
-
-39 i(
-d
- =
-RTE_CT_DIR_REPLY
- &&
-
-40
-cd
-->
-cnus
- =
-RTE_INIT_CONN
-) {
-
-41
- `e__t_xn_tim_f_udp
-(
-
-,
-cd
-,
-RTE_CT_UDP_REPLIED
-);
-
-42
-cd
-->
-cnus
- =
-RTE_ASSURED_CONN
-;
-
-43 } i(
-d
- =
-RTE_CT_DIR_REPLY
- &&
-
-44
-cd
-->
-cnus
- =
-RTE_ASSURED_CONN
-)
-
-45
- `e__t_xn_tim_f_udp
-(
-
-,
-cd
-,
-RTE_CT_UDP_REPLIED
-);
-
-47
- `e__t_xn_tim_f_udp
-(
-
-,
-cd
-,
-RTE_CT_UDP_UNREPLIED
-);
-
-48 
-RTE_CT_FORWARD_PACKET
-;
-
-49
- }
-}
-
- @VIL/l2l3_stack/bond.c
-
-17 
- ~<r.h
->
-
-18 
- ~"tsx.h
-"
-
-19
-r_ma_t
-
-ifm
-;
-
-20
-ut8_t
-
-ifm_debug
-;
-
-21 
-USE_RTM_LOCKS
-;
-
-22
-e_rwlock_t
-
-rwlock
-;
-
-24 
- $ifm_bd_pt_
-(cڡ *
-me
-, 
-mode
-,
-pt_cfig_t
- *
-ptcf
-)
-
-26 
-pt_id
-;
-
-27
-l2_phy_r_t
- *
-bd_pt
-;
-
-28 i(
-ifm_debug
- &&
-IFM_DEBUG_CONFIG
-)
-
-29
- `RTE_LOG
-(
-INFO
-,
-IFM
-, "%s: i/m%p, mod%d\n\r",
-__FUNCTION__
-,
-
-30
-me
-,
-mode
-);
-
-31 i(
-me
- =
-NULL
-) {
-
-32
- `RTE_LOG
-(
-ERR
-,
-IFM
-, "%s: Paramame cannot be NULL\n\r",
-
-33
-__FUNCTION__
-);
-
-34 
-IFM_FAILURE
-;
-
-36 i(
-mode
- < 0 || mode > 6) {
-
-37
- `RTE_LOG
-(
-ERR
-,
-IFM
-, "%s: Param mode should be withing 0o 6\n\r",
-
-38
-__FUNCTION__
-);
-
-39 
-IFM_FAILURE
-;
-
-41 i(
-ptcf
- =
-NULL
-) {
-
-42
- `RTE_LOG
-(
-ERR
-,
-IFM
-, "%s: Paramortconf cannot be NULL\n\r",
-
-43
-__FUNCTION__
-);
-
-44 
-IFM_FAILURE
-;
-
-46
-bd_pt
- =
- `ifm_g_pt_by_me
-(
-me
-);
-
-47 i(
-bd_pt
- =
-NULL
-) {
-
-48 i(
-ifm_debug
- &&
-IFM_DEBUG_CONFIG
-)
-
-49
- `RTE_LOG
-(
-INFO
-,
-IFM
-, "Cifm_pt_tu%s\n\r",
-me
-);
-
-50
-pt_id
- =
- `e_h_bd_
-(
-me
-,
-mode
-, 0);
-
-51 i(
-pt_id
- < 0) {
-
-52
- `RTE_LOG
-(
-ERR
-,
-IFM
-,
-
-54
-__FUNCTION__
-,
-me
-,
-mode
-);
-
-55 
-IFM_FAILURE
-;
-
-57
- `RTE_LOG
-(
-INFO
-,
-IFM
-,
-
-59 "mod%u.\n\r",
-__FUNCTION__
-,
-me
-,
-pt_id
-,
-
-60
- `e_h_dev_sock_id
-(
-pt_id
-),
-mode
-);
-
-62
-bd_pt
- = (
-l2_phy_r_t
- *
- `e_zmloc
-(
-NULL
-,
-
-64 (
-l2_phy_r_t
-),
-
-65
-RTE_CACHE_LINE_SIZE
-);
-
-66
-bd_pt
-->
-pmdid
- =
-pt_id
-;
-
-67
- `y
-(
-bd_pt
-->
-iame
-,
-me
-,
-IFM_IFNAME_LEN
-);
-
-68
- `memy
-(&
-bd_pt
-->
-pt_cfig
-,
-ptcf
-,
-
-69 (
-pt_cfig_t
-));
-
-70
-bd_pt
-->
-ags
- |
-IFM_MASTER
-;
-
-71 
-bd_pt
- *
-bd_fo
-;
-
-72
-bd_fo
- = (
-bd_pt
- *)
- `e_zmloc
-(
-NULL
-,
-
-74
-bd_pt
-),
-
-75
-RTE_CACHE_LINE_SIZE
-);
-
-76
-bd_fo
-->
-sock_id
- =
- `e_h_dev_sock_id
-(
-pt_id
-);
-
-77
-bd_fo
-->
-mode
- = mode;
-
-78
-bd_fo
-->
-bd_ptid
- =
-pt_id
-;
-
-79
-bd_pt
-->
-bd_cfig
- =
-bd_fo
-;
-
-80 i(
-mode
- =
-IFM_BONDING_MODE_8023AD
-)
-
-81
-bd_pt
-->
-tx_buf_n
- =
-
-82 (2 *
- `RTE_ETH_TX_BUFFER_SIZE
-(
-IFM_BURST_SIZE
-)) *
-
-83
-RTE_MAX_ETHPORTS
-;
-
-85
-ifm
-.
-pt_li
-[
-pt_id
-] =
-bd_pt
-;
-
-86 i(
-ifm_debug
- &&
-IFM_DEBUG_CONFIG
-)
-
-87
- `RTE_LOG
-(
-INFO
-,
-IFM
-,
-
-89
-__FUNCTION__
-,
-me
-,
-pt_id
-);
-
-91
- `RTE_LOG
-(
-INFO
-,
-IFM
-, "%s: Port %slreadyxists inhe"
-
-92 "܈li\n\r",
-__FUNCTION__
-,
-me
-);
-
-93 i(
-ifm_debug
- &
-IFM_DEBUG_LOCKS
-)
-
-94
- `RTE_LOG
-(
-INFO
-,
-IFM
-, "%s: Acquiringock @ %d\n\r",
-
-95
-__FUNCTION__
-,
-__LINE__
-);
-
-96 i(
-USE_RTM_LOCKS
-)
-
-97
- `m_lock
-();
-
-99
- `e_rwlock_wre_lock
-(&
-rwlock
-);
-
-101 i(!(
-bd_pt
-->
-ags
- &
-IFM_MASTER
-)) {
-
-102
- `RTE_LOG
-(
-ERR
-,
-IFM
-, "%s: Previouslyort %s wasot "
-
-103 "cfigudBdt\n\r",
-__FUNCTION__
-,
-
-104
-me
-);
-
-105 i(
-ifm_debug
- &
-IFM_DEBUG_LOCKS
-)
-
-106
- `RTE_LOG
-(
-INFO
-,
-IFM
-,
-
-108
-__FUNCTION__
-,
-__LINE__
-);
-
-109 i(
-USE_RTM_LOCKS
-)
-
-110
- `m_uock
-();
-
-112
- `e_rwlock_wre_uock
-(&
-rwlock
-);
-
-113 
-IFM_FAILURE
-;
-
-115 i(
-bd_pt
-->
-bd_cfig
-->
-mode
- != mode) {
-
-116 i(
- `e_h_bd_mode_t
-(
-bd_pt
-->
-pmdid
-,
-mode
-) < 0) {
-
-117
- `RTE_LOG
-(
-ERR
-,
-IFM
-, "%s:te_eth_bond_mode_set "
-
-118 "ed\n\r",
-__FUNCTION__
-);
-
-119 i(
-ifm_debug
- &
-IFM_DEBUG_LOCKS
-)
-
-120
- `RTE_LOG
-(
-INFO
-,
-IFM
-,
-
-122
-__FUNCTION__
-,
-__LINE__
-);
-
-123 i(
-USE_RTM_LOCKS
-)
-
-124
- `m_uock
-();
-
-126
- `e_rwlock_wre_uock
-(&
-rwlock
-);
-
-127 
-IFM_FAILURE
-;
-
-130
-bd_pt
-->
-bd_cfig
-->
-mode
- =
-
-131
- `e_h_bd_mode_g
-(
-bd_pt
-->
-pmdid
-);
-
-133
-bd_pt
-->
-bd_cfig
-->
-xm_picy
- =
-
-134
- `e_h_bd_xm_picy_g
-(
-bd_pt
-->
-pmdid
-);
-
-135 i(
-ifm_debug
- &&
-IFM_DEBUG_CONFIG
-)
-
-136
- `RTE_LOG
-(
-INFO
-,
-IFM
-,
-
-138 "\n\r",
-__FUNCTION__
-,
-bd_pt
-->
-pmdid
-,
-
-139
-bd_pt
-->
-bd_cfig
-->
-mode
-,
-
-140
-bd_pt
-->
-bd_cfig
-->
-xm_picy
-);
-
-142
-pt_id
- =
-bd_pt
-->
-pmdid
-;
-
-143 i(
-ifm_debug
- &
-IFM_DEBUG_LOCKS
-)
-
-144
- `RTE_LOG
-(
-INFO
-,
-IFM
-, "%s: Acquiringock @ %d\n\r",
-
-145
-__FUNCTION__
-,
-__LINE__
-);
-
-146 i(
-USE_RTM_LOCKS
-)
-
-147
- `m_uock
-();
-
-149
- `e_rwlock_wre_uock
-(&
-rwlock
-);
-
-151 
-pt_id
-;
-
-152
- }
-}
-
-154 
- $ifm_bd_pt_de
-(cڡ *
-me
-)
-
-156
-l2_phy_r_t
- *
-bd_pt
-;
-
-157 i(
-me
- =
-NULL
-) {
-
-158
- `RTE_LOG
-(
-ERR
-,
-IFM
-, "%s: Paramame cannot be NULL\n\r",
-
-159
-__FUNCTION__
-);
-
-160 
-IFM_FAILURE
-;
-
-162
-bd_pt
- =
- `ifm_g_pt_by_me
-(
-me
-);
-
-163 i(
-ifm_debug
- &
-IFM_DEBUG_LOCKS
-)
-
-164
- `RTE_LOG
-(
-INFO
-,
-IFM
-, "%s: Acquiring WRock @ %d\n\r",
-
-165
-__FUNCTION__
-,
-__LINE__
-);
-
-166 i(
-USE_RTM_LOCKS
-)
-
-167
- `m_lock
-();
-
-169
- `e_rwlock_wre_lock
-(&
-rwlock
-);
-
-170 i(
-bd_pt
- =
-NULL
-) {
-
-171
- `RTE_LOG
-(
-ERR
-,
-IFM