TSG-8364: 重构代码,只解QUIC链接的第一个数据包

This commit is contained in:
liuxueli
2021-11-10 11:55:22 +03:00
parent fa5af89690
commit 11c3aa538a
23 changed files with 1145 additions and 2264 deletions

View File

@@ -1,94 +1,94 @@
[{
"Tuple4": "10.56.160.76.47427>213.55.110.12.443",
"VERSION": "Google QUIC 43",
"SNI": "r1---sn-xuj-5qqz.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_1"
}, {
"Tuple4": "10.56.160.76.38866>197.156.74.141.443",
"VERSION": "Google QUIC 43",
"SNI": "r2---sn-xuj-5qqs.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_2"
}, {
"Tuple4": "10.56.160.76.44417>216.58.209.132.443",
"VERSION": "IETF QUIC RFC9000",
"SNI": "www.google.com",
"UA": "com.google.android.googlequicksearchbox Cronet/96.0.4664.17",
"name": "QUIC_RESULT_3"
"VERSION": "IETF QUIC RFC9000",
"name": "QUIC_RESULT_1"
}, {
"Tuple4": "10.56.160.76.47427>213.55.110.12.443",
"SNI": "r1---sn-xuj-5qqz.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_2"
}, {
"Tuple4": "10.56.160.76.39996>142.250.185.33.443",
"VERSION": "IETF QUIC RFC9000",
"SNI": "yt3.ggpht.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_4"
"VERSION": "IETF QUIC RFC9000",
"name": "QUIC_RESULT_3"
}, {
"Tuple4": "10.56.160.76.48527>216.58.209.130.443",
"VERSION": "IETF QUIC RFC9000",
"SNI": "www.googleadservices.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_5"
"VERSION": "IETF QUIC RFC9000",
"name": "QUIC_RESULT_4"
}, {
"Tuple4": "10.56.160.76.43569>197.156.74.146.443",
"VERSION": "Google QUIC 43",
"SNI": "r7---sn-xuj-5qqs.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_6"
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_5"
}, {
"Tuple4": "10.56.160.76.52114>197.156.74.147.443",
"VERSION": "Google QUIC 43",
"SNI": "r8---sn-xuj-5qqs.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_7"
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_6"
}, {
"Tuple4": "10.56.160.76.59023>213.55.110.13.443",
"VERSION": "Google QUIC 43",
"SNI": "r2---sn-xuj-5qqz.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_8"
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_7"
}, {
"Tuple4": "10.56.160.76.46224>197.156.74.140.443",
"VERSION": "Google QUIC 43",
"SNI": "r1---sn-xuj-5qqs.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_9"
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_8"
}, {
"Tuple4": "10.56.160.76.54334>197.156.74.145.443",
"VERSION": "Google QUIC 43",
"SNI": "r6---sn-xuj-5qqs.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_10"
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_9"
}, {
"Tuple4": "10.56.160.76.41069>142.250.180.42.443",
"VERSION": "IETF QUIC RFC9000",
"SNI": "youtubei.googleapis.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_11"
"VERSION": "IETF QUIC RFC9000",
"name": "QUIC_RESULT_10"
}, {
"Tuple4": "10.56.160.76.48756>213.55.110.14.443",
"VERSION": "Google QUIC 43",
"SNI": "r3---sn-xuj-5qqz.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"name": "QUIC_RESULT_12"
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_11"
}, {
"Tuple4": "10.56.160.76.51113>142.250.180.54.443",
"VERSION": "IETF QUIC RFC9000",
"SNI": "i.ytimg.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"VERSION": "IETF QUIC RFC9000",
"name": "QUIC_RESULT_12"
}, {
"Tuple4": "10.56.160.76.38866>197.156.74.141.443",
"SNI": "r2---sn-xuj-5qqs.googlevideo.com",
"UA": "com.google.android.youtube Cronet/96.0.4655.4",
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_13"
}, {
"Tuple4": "10.56.160.76.46131>196.188.31.18.443",
"VERSION": "Facebook mvfst 02",
"SNI": "video.fadd1-1.fna.fbcdn.net",
"VERSION": "Facebook mvfst 02",
"name": "QUIC_RESULT_14"
}, {
"Tuple4": "10.56.160.76.40267>102.132.96.18.443",
"VERSION": "Facebook mvfst 02",
"SNI": "graph.facebook.com",
"VERSION": "Facebook mvfst 02",
"name": "QUIC_RESULT_15"
}, {
"Tuple4": "10.56.160.76.46761>196.188.31.17.443",
"VERSION": "Facebook mvfst 02",
"SNI": "scontent.fadd1-1.fna.fbcdn.net",
"VERSION": "Facebook mvfst 02",
"name": "QUIC_RESULT_16"
}]

View File

@@ -1,15 +1,15 @@
[{
"Tuple4": "192.168.50.26.55209>34.102.215.99.443",
"Tuple4": "112.43.145.231.18699>112.46.25.216.443",
"SNI": "client.weixin.qq.com",
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_1"
}, {
"Tuple4": "192.168.50.26.60851>34.102.215.99.443",
"Tuple4": "192.168.50.26.55209>34.102.215.99.443",
"VERSION": "Google QUIC 43",
"name": "QUIC_RESULT_2"
}, {
"Tuple4": "112.43.145.231.18699>112.46.25.216.443",
"Tuple4": "192.168.50.26.60851>34.102.215.99.443",
"VERSION": "Google QUIC 43",
"SNI": "client.weixin.qq.com",
"name": "QUIC_RESULT_3"
}, {
"Tuple4": "192.168.50.26.63533>34.102.215.99.443",

View File

@@ -57,8 +57,6 @@
}, {
"Tuple4": "85.117.117.190.11567>64.233.165.94.443",
"VERSION": "Google QUIC 44",
"SNI": "www.google.kz",
"UA": "dev Chrome/73.0.3664.3 Windows NT 6.3; Win64; x64",
"name": "QUIC_RESULT_10"
}, {
"Tuple4": "85.117.117.190.48098>173.194.221.95.443",
@@ -69,8 +67,6 @@
}, {
"Tuple4": "85.117.119.57.4009>64.233.162.155.443",
"VERSION": "Google QUIC 44",
"SNI": "stats.g.doubleclick.net",
"UA": "dev Chrome/73.0.3664.3 Windows NT 6.1; Win64; x64",
"name": "QUIC_RESULT_12"
}, {
"Tuple4": "85.117.126.11.11719>64.233.165.138.443",

View File

@@ -1,7 +1,8 @@
[{
"Tuple4": "192.168.50.29.61891>31.13.77.35.443",
"VERSION": "IETF QUIC 29",
"SNI": "www.facebook.com",
"UA": "Chrome/86.0.4240.183 Windows NT 10.0; Win64; x64",
"VERSION": "IETF QUIC 29",
"name": "QUIC_RESULT_1"
}, {
"Tuple4": "223.104.233.102.13650>203.208.40.98.443",
@@ -9,9 +10,8 @@
"name": "QUIC_RESULT_2"
}, {
"Tuple4": "192.168.50.33.57220>114.250.70.38.443",
"VERSION": "IETF QUIC 29",
"SNI": "securepubads.g.doubleclick.net",
"UA": "Chrome/90.0.4430.72 Windows NT 10.0; Win64; x64",
"VERSION": "IETF QUIC 29",
"name": "QUIC_RESULT_3"
}]

View File

@@ -1,21 +1,25 @@
[{
"Tuple4": "195.12.120.14.41803>173.194.222.101.443",
"VERSION": "Google QUIC with TLS 51",
"SNI": "clients4.google.com",
"name": "QUIC_RESULT_1"
}, {
"Tuple4": "195.12.120.14.39526>64.233.165.113.443",
"VERSION": "Google QUIC with TLS 51",
"SNI": "m.youtube.com",
"name": "QUIC_RESULT_2"
}, {
"Tuple4": "195.12.120.14.41747>173.194.222.138.443",
"VERSION": "Google QUIC with TLS 51",
"SNI": "clients4.google.com",
"name": "QUIC_RESULT_3"
}, {
"Tuple4": "195.12.120.14.59012>173.194.222.138.443",
"VERSION": "Google QUIC with TLS 51",
"SNI": "clients4.google.com",
"name": "QUIC_RESULT_4"
"Tuple4": "195.12.120.14.41803>173.194.222.101.443",
"SNI": "clients4.google.com",
"UA": "Chrome/87.0.4280.101 Android 9; ANE-LX1",
"VERSION": "Google QUIC with TLS 51",
"name": "QUIC_RESULT_1"
}, {
"Tuple4": "195.12.120.14.39526>64.233.165.113.443",
"SNI": "m.youtube.com",
"UA": "Chrome/87.0.4280.101 Android 9; ANE-LX1",
"VERSION": "Google QUIC with TLS 51",
"name": "QUIC_RESULT_2"
}, {
"Tuple4": "195.12.120.14.41747>173.194.222.138.443",
"SNI": "clients4.google.com",
"UA": "Chrome/87.0.4280.101 Android 9; ANE-LX1",
"VERSION": "Google QUIC with TLS 51",
"name": "QUIC_RESULT_3"
}, {
"Tuple4": "195.12.120.14.59012>173.194.222.138.443",
"SNI": "clients4.google.com",
"UA": "Chrome/87.0.4280.101 Android 9; ANE-LX1",
"VERSION": "Google QUIC with TLS 51",
"name": "QUIC_RESULT_4"
}]

View File

@@ -3,16 +3,14 @@
* create time:2021-8-21
*
*/
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <assert.h>
#include "cJSON.h"
#include "gquic.h"
#include "quic.h"
#include "MESA_prof_load.h"
#include <MESA/stream.h>
@@ -26,7 +24,7 @@ extern "C" unsigned char QUIC_TEST_PLUG_ENTRY(stSessionInfo *session_info, void
assert(NULL != session_info || pme != NULL);
cJSON *ctx = (cJSON *)*pme;
struct _quic_info *quic_info=NULL;
struct quic_info *quic_info=NULL;
char version_str[128]={0};
unsigned int version = 0;
@@ -47,9 +45,22 @@ extern "C" unsigned char QUIC_TEST_PLUG_ENTRY(stSessionInfo *session_info, void
{
break;
}
quic_info = (struct _quic_info *)session_info->app_info;
cJSON_AddStringToObject(ctx, "SNI", (char *)(quic_info->client_hello->ext_tags[quic_info->client_hello->sni_idx].value));
cJSON_AddStringToObject(ctx, "UA", (char *)(quic_info->client_hello->ext_tags[quic_info->client_hello->ua_idx].value));
quic_info = (struct quic_info *)session_info->app_info;
if(quic_info->client_hello==NULL)
{
break;
}
if(quic_info->client_hello->sni!=NULL)
{
cJSON_AddStringToObject(ctx, "SNI", (char *)(quic_info->client_hello->sni));
}
if(quic_info->client_hello->user_agent!=NULL)
{
cJSON_AddStringToObject(ctx, "UA", (char *)(quic_info->client_hello->user_agent));
}
quic_version_int2string((unsigned int)(quic_info->quic_version), version_str, sizeof(version_str));
cJSON_AddStringToObject(ctx, "VERSION", version_str);
break;
case QUIC_USEING_VERSION:
version = *(unsigned int *)(session_info->buf);
@@ -86,7 +97,7 @@ extern "C" int QUIC_TEST_PLUG_INIT()
extern "C" void QUIC_TEST_PLUG_DESTROY(void)
{
return ;
}/*CHAR_DESTRORY*/
}