Example #1
0
/** \brief Function to register the TLS protocol parsers and other functions
 */
void RegisterTLSParsers(void)
{
    AppLayerRegisterProto("tls", ALPROTO_TLS, STREAM_TOSERVER,
                          TLSParseClientRecord);
    AppLayerRegisterParser("tls.client.content_type", ALPROTO_TLS,
                           TLS_FIELD_CLIENT_CONTENT_TYPE,
                           TLSParseClientContentType, "tls");
    AppLayerRegisterParser("tls.client.version", ALPROTO_TLS,
                           TLS_FIELD_CLIENT_VERSION, TLSParseClientVersion,
                           "tls");

    AppLayerRegisterProto("tls", ALPROTO_TLS, STREAM_TOCLIENT,
                          TLSParseServerRecord);
    AppLayerRegisterParser("tls.server.content_type", ALPROTO_TLS,
                           TLS_FIELD_SERVER_CONTENT_TYPE,
                           TLSParseServerContentType, "tls");
    AppLayerRegisterParser("tls.server.version", ALPROTO_TLS,
                           TLS_FIELD_SERVER_VERSION, TLSParseServerVersion,
                           "tls");

    AppLayerRegisterStateFuncs(ALPROTO_TLS, TLSStateAlloc, TLSStateFree);

    /* Get the value of no reassembly option from the config file */
    if(ConfGetBool("tls.no_reassemble", &tls.no_reassemble) != 1)
        tls.no_reassemble = 1;
}
Example #2
0
void RegisterFTPParsers(void) {
    char *proto_name = "ftp";

    /** FTP */
    AlpProtoAdd(&alp_proto_ctx, proto_name, IPPROTO_TCP, ALPROTO_FTP, "USER ", 5, 0, STREAM_TOSERVER);
    AlpProtoAdd(&alp_proto_ctx, proto_name, IPPROTO_TCP, ALPROTO_FTP, "PASS ", 5, 0, STREAM_TOSERVER);
    AlpProtoAdd(&alp_proto_ctx, proto_name, IPPROTO_TCP, ALPROTO_FTP, "PORT ", 5, 0, STREAM_TOSERVER);

    AppLayerRegisterProto(proto_name, ALPROTO_FTP, STREAM_TOSERVER,
                          FTPParseRequest);
    AppLayerRegisterProto(proto_name, ALPROTO_FTP, STREAM_TOCLIENT,
                          FTPParseResponse);
    AppLayerRegisterParser("ftp.request_command_line", ALPROTO_FTP,
                           FTP_FIELD_REQUEST_LINE, FTPParseRequestCommandLine,
                           "ftp");
    AppLayerRegisterStateFuncs(ALPROTO_FTP, FTPStateAlloc, FTPStateFree);
}