"Fossies" - the Fresh Open Source Software Archive

Member "snort-2.9.17/src/preprocessors/HttpInspect/include/hi_server.h" (16 Oct 2020, 2918 Bytes) of package /linux/misc/snort-2.9.17.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "hi_server.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.9.16.1_vs_2.9.17.

    1 /****************************************************************************
    2  *
    3  * Copyright (C) 2014-2020 Cisco and/or its affiliates. All rights reserved.
    4  * Copyright (C) 2003-2013 Sourcefire, Inc.
    5  *
    6  * This program is free software; you can redistribute it and/or modify
    7  * it under the terms of the GNU General Public License Version 2 as
    8  * published by the Free Software Foundation.  You may not use, modify or
    9  * distribute this program under any other version of the GNU General
   10  * Public License.
   11  *
   12  * This program is distributed in the hope that it will be useful,
   13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15  * GNU General Public License for more details.
   16  *
   17  * You should have received a copy of the GNU General Public License
   18  * along with this program; if not, write to the Free Software
   19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
   20  *
   21  ****************************************************************************/
   22  
   23 /**
   24 **  @file       hi_server.h
   25 **  
   26 **  @author     Daniel Roelker <droelker@sourcefire.com>
   27 **  
   28 **  @brief      Header file for HttpInspect Server Module
   29 **  
   30 **  This file defines the server structure and functions to access server
   31 **  inspection.
   32 **  
   33 **  NOTE:
   34 **      - Initial development.  DJR
   35 */
   36 #ifndef __HI_SERVER_H__
   37 #define __HI_SERVER_H__
   38 
   39 #include "hi_include.h"
   40 #include "hi_util.h"
   41 #include "snort_httpinspect.h"
   42 #include "hi_client.h"
   43 
   44 #define RANGE_UNIT_BYTE "bytes"
   45 
   46 #ifndef HTTP_RESP_RANGE_NONE
   47 #define HTTP_RESP_RANGE_NONE                 0
   48 #endif
   49 #define RANGE_WITH_RESP_FULL_CONTENT         1
   50 #define RANGE_WITH_RESP_PARTIAL_CONTENT      2
   51 #define RANGE_WITH_RESP_ERROR                3
   52 #define RANGE_WITH_RESP_NON_BYTE             4
   53 #define RANGE_WITH_UNKNOWN_CONTENT_RANGE     5
   54 #define RANGE_WITH_RESP_UNKNOWN_CONTENT_SIZE 6
   55 #define RANGE_WITH_RESP_SKIP                 7
   56 
   57 #define ACCEPT_RANGE_UNKNOWN 0
   58 #define ACCEPT_RANGE_NONE    1
   59 #define ACCEPT_RANGE_BYTES   2
   60 #define ACCEPT_RANGE_OTHER   3
   61 
   62 typedef struct s_HI_SERVER_RESP
   63 {
   64     const u_char *status_code;
   65     const u_char *status_msg;
   66     const u_char *header_raw;
   67     const u_char *header_norm;
   68     COOKIE_PTR cookie;
   69     const u_char *cookie_norm;
   70     const u_char *body;
   71     const u_char *body_raw;
   72 
   73     u_int body_size;
   74     u_int body_raw_size;
   75     u_int status_code_size;
   76     u_int status_msg_size;
   77     u_int header_raw_size;
   78     u_int header_norm_size;
   79     u_int cookie_norm_size;
   80 
   81     uint16_t header_encode_type;
   82     uint16_t cookie_encode_type;
   83 
   84     uint8_t accept_range_flag;
   85     uint8_t range_flag;
   86 } HI_SERVER_RESP;
   87 
   88 
   89 typedef struct s_HI_SERVER
   90 {
   91     HI_SERVER_RESP response;
   92     HI_SERVER_EVENTS event_list;
   93 } HI_SERVER;
   94 
   95 int hi_server_inspection(void *, Packet *, HttpSessionData *);
   96 int hi_server_is_known_header(const u_char *p, const u_char *end);
   97 #endif