diff options
Diffstat (limited to 'src/tsg_bridge.cpp')
| -rw-r--r-- | src/tsg_bridge.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/tsg_bridge.cpp b/src/tsg_bridge.cpp index a1faecd..efaf137 100644 --- a/src/tsg_bridge.cpp +++ b/src/tsg_bridge.cpp @@ -236,6 +236,18 @@ void session_runtime_attribute_free(const struct streaminfo *a_stream, int bridg srt_attribute->proxy_tcp_attr = NULL; } + if(srt_attribute->client_os!=NULL) + { + dictator_free(a_stream->threadnum, (void *)srt_attribute->client_os); + srt_attribute->client_os=NULL; + } + + if(srt_attribute->server_os!=NULL) + { + dictator_free(a_stream->threadnum, (void *)srt_attribute->server_os); + srt_attribute->server_os=NULL; + } + dictator_free(a_stream->threadnum, data); data=NULL; } @@ -370,6 +382,46 @@ int srt_attribute_set_ja3_fingprint(const struct streaminfo *a_stream, const cha return 0; } +int srt_attribute_set_client_os(const struct streaminfo *a_stream, const char *os_name) +{ + if(os_name==NULL) + { + return 0; + } + + struct session_runtime_attribute *srt_attribute=(struct session_runtime_attribute *)session_runtime_attribute_new(a_stream); + if(srt_attribute) + { + size_t os_name_len=strlen(os_name); + srt_attribute->client_os=(char *)dictator_malloc(a_stream->threadnum, os_name_len+1); + memcpy((void *)srt_attribute->client_os, os_name, os_name_len); + srt_attribute->client_os[os_name_len]='\0'; + return 1; + } + + return 0; +} + +int srt_attribute_set_server_os(const struct streaminfo *a_stream, const char *os_name) +{ + if(os_name==NULL) + { + return 0; + } + + struct session_runtime_attribute *srt_attribute=(struct session_runtime_attribute *)session_runtime_attribute_new(a_stream); + if(srt_attribute) + { + size_t os_name_len=strlen(os_name); + srt_attribute->server_os=(char *)dictator_malloc(a_stream->threadnum, os_name_len+1); + memcpy((void *)srt_attribute->server_os, os_name, os_name_len); + srt_attribute->server_os[os_name_len]='\0'; + return 1; + } + + return 0; +} + int srt_atttribute_set_umts_user_info(const struct streaminfo *a_stream, struct umts_user_info *user_info) { struct session_runtime_attribute *srt_attribute=(struct session_runtime_attribute *)session_runtime_attribute_new(a_stream); |
