37 static int RFBRegisterPatternsForProtocolDetection(
void)
40 "RFB ", 4, 0, STREAM_TOCLIENT) < 0)
45 "RFB ", 4, 0, STREAM_TOSERVER) < 0)
56 rs_rfb_register_parser();
57 if (RFBRegisterPatternsForProtocolDetection() < 0 )
71 static int RFBParserTest(
void)
79 memset(&ssn, 0,
sizeof(ssn));
84 f->
proto = IPPROTO_TCP;
87 static const unsigned char rfb_version_str[12] = {
88 0x52, 0x46, 0x42, 0x20, 0x30, 0x30, 0x33, 0x2e, 0x30, 0x30, 0x37, 0x0a
93 (uint8_t *)rfb_version_str,
sizeof(rfb_version_str));
97 NULL,
alp_tctx, f,
ALPROTO_RFB, STREAM_TOSERVER, (uint8_t *)rfb_version_str,
sizeof(rfb_version_str));
100 static const unsigned char security_types[3] = {
104 NULL,
alp_tctx, f,
ALPROTO_RFB, STREAM_TOCLIENT, (uint8_t *)security_types,
sizeof(security_types));
107 static const unsigned char type_selection[1] = {
111 NULL,
alp_tctx, f,
ALPROTO_RFB, STREAM_TOSERVER, (uint8_t *)type_selection,
sizeof(type_selection));
114 static const unsigned char client_init[1] = {
118 NULL,
alp_tctx, f,
ALPROTO_RFB, STREAM_TOSERVER, (uint8_t *)client_init,
sizeof(client_init));
121 static const unsigned char server_init[] = {
122 0x05, 0x00, 0x03, 0x20, 0x20, 0x18, 0x00, 0x01,
123 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x10, 0x08,
124 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e,
125 0x61, 0x6e, 0x65, 0x61, 0x67, 0x6c, 0x65, 0x73,
126 0x40, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f,
127 0x73, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
128 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e
132 NULL,
alp_tctx, f,
ALPROTO_RFB, STREAM_TOCLIENT, (uint8_t *)server_init,
sizeof(server_init));