This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tsg-master/src/tsg_ssh_utils.cpp
2020-08-28 10:43:12 +08:00

22 lines
401 B
C++

#include <stdio.h>
#include <stdlib.h>
#include "tsg_ssh_utils.h"
#define SSH_PROTOCOL_FIELD "SSH"
#define SSH_PROTOCOL_FIELD_LEN 3
int ssh_protocol_identify(const unsigned char* buff, size_t buff_len, void* argp)
{
if(buff == NULL || buff_len < SSH_PROTOCOL_FIELD_LEN)
{
return -1;
}
if(memcmp((void *)buff,SSH_PROTOCOL_FIELD, SSH_PROTOCOL_FIELD_LEN) == 0)
return 1;
else
return 0;
}