@@ -290,9 +290,9 @@ static int gtp_jump_to_layer(const char *raw_data, int raw_layer_type, int expe
next_ip_layer_hdr = ( unsigned char * ) raw_data + gtp_hdr_len ;
if ( ( * next_ip_layer_hdr & 0x4 0 ) = = 0x40 ) {
if ( ( * next_ip_layer_hdr & 0xF 0 ) = = 0x40 ) {
skip_len = ipv4_jump_to_layer ( ( char * ) next_ip_layer_hdr , __ADDR_TYPE_IP_PAIR_V4 , expect_layer_type ) ;
} else if ( ( * next_ip_layer_hdr & 0x6 0 ) = = 0x60 ) {
} else if ( ( * next_ip_layer_hdr & 0xF 0 ) = = 0x60 ) {
skip_len = ipv6_jump_to_layer ( ( char * ) next_ip_layer_hdr , __ADDR_TYPE_IP_PAIR_V6 , expect_layer_type ) ;
} else {
snprintf ( _g_mesa_jump_layer_last_error , PIPE_BUF , " gtp_jump_to_layer() error, unsupport type in GTP, 0x%x! " , ( * next_ip_layer_hdr ) ) ;
@@ -1427,8 +1427,23 @@ const void *MESA_jump_layer_greedy(const void *raw_data, int raw_layer_type, int
case __ADDR_TYPE_IP_PAIR_V6 :
{
//TODO2,
goto done ;
const struct mesa_ip6_hdr * ip6hdr = ( const struct mesa_ip6_hdr * ) expect_layer ;
if ( IPPROTO_UDP = = ip6hdr - > ip6_nxt_hdr ) {
new_next_layer_data = ( char * ) expect_layer + sizeof ( struct mesa_ip6_hdr ) ;
new_raw_layer_type = ADDR_TYPE_UDP ; /* IP<49> <50> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> ƫ<EFBFBD> <C6AB> */
} else if ( IPPROTO_GRE = = ip6hdr - > ip6_nxt_hdr ) {
new_next_layer_data = ( char * ) expect_layer + sizeof ( struct mesa_ip6_hdr ) ;
new_raw_layer_type = ADDR_TYPE_GRE ; /* GRE */
} else if ( IPPROTO_IPIP = = ip6hdr - > ip6_nxt_hdr ) {
new_next_layer_data = ( char * ) expect_layer + sizeof ( struct mesa_ip6_hdr ) ;
new_raw_layer_type = ADDR_TYPE_IPV4 ;
} else if ( IPPROTO_IPIP = = ip6hdr - > ip6_nxt_hdr ) {
new_next_layer_data = ( char * ) expect_layer + sizeof ( struct mesa_ip6_hdr ) ;
new_raw_layer_type = ADDR_TYPE_IPV6 ;
} else {
//TODO 2, IPIP, L2TPv3
goto done ;
}
}
break ;
@@ -1476,7 +1491,7 @@ const char *MESA_jump_layer_ipv4_ntop(const struct ip *ip4_hdr, char *out_buf, i
inner_thdr = ( struct mesa_tcp_hdr * ) ( ( char * ) ip4_hdr + ip4_hdr - > ip_hl * 4 ) ;
sport = ntohs ( inner_thdr - > th_sport ) ;
dport = ntohs ( inner_thdr - > th_dport ) ;
} else if ( IPPROTO_UDP ) {
} else if ( IPPROTO_UDP = = inner_ip_proto ) {
inner_uhdr = ( struct mesa_udp_hdr * ) ( ( char * ) ip4_hdr + ip4_hdr - > ip_hl * 4 ) ;
sport = ntohs ( inner_uhdr - > uh_sport ) ;
dport = ntohs ( inner_uhdr - > uh_dport ) ;
@@ -1509,7 +1524,7 @@ const char *MESA_jump_layer_ipv6_ntop(const struct ip6_hdr *ip6_hdr, char *out_b
inner_thdr = ( struct tcphdr * ) ( ( char * ) ip6_hdr + sizeof ( struct ip6_hdr ) ) ;
sport = inner_thdr - > source ;
dport = inner_thdr - > dest ;
} else if ( IPPROTO_UDP ) {
} else if ( IPPROTO_UDP = = inner_ip_proto ) {
inner_uhdr = ( struct udphdr * ) ( ( char * ) ip6_hdr + sizeof ( struct ip6_hdr ) ) ;
sport = inner_uhdr - > source ;
dport = inner_uhdr - > dest ;