summaryrefslogtreecommitdiff
path: root/include/mrl_main.h
blob: 721e9b64b1fa008dd91220dc4d9dd0783b8bf243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef __MRL_MAIN_H_
#define __MRL_MAIN_H_
#include <arpa/inet.h>
#include <sys/types.h>


#include "stream_inc/stream_rawpkt.h"
#include "MESA_prof_load.h"
#include "MESA_handle_logger.h"
#include "MESA_htable.h"
#include "MESA_list_queue.h"
#include "Maat_rule.h"
#include "Maat_command.h"

#include "mrl_utils.h"

struct mrl_global_cfg
{
    //log info
    char mrl_log_path[MRL_MAX_PATH];
    int mrl_log_level;

    //detect info
    char dest_ip[MRL_STR_IP_LEN];
    uint16_t dest_port;
    uint16_t local_port;
    
    //socket info
    char mgw_ip[MRL_STR_IP_LEN];
    char mrl_ip[MRL_STR_IP_LEN];
    uint16_t mgw_port;//mgw listen udp port
    uint16_t mrl_port;//mrl listen udp port

    //maat info
    char Maat_table_path[MRL_MAX_PATH];
    char Maat_redis_ip[MRL_STR_IP_LEN];    
    uint16_t Maat_redis_port;    
    char Maat_stat_path[MRL_MAX_PATH];
    unsigned int Maat_max_threads;
    int redis_index;

    //htable info
    unsigned int ht_slot_size;
    unsigned int ht_max_element_num;
    unsigned int ht_mutex_num;

    /*vxlan info*/
    char vxlan_outer_local_mac[MRL_STR_MAC_LEN];
    char vxlan_outer_local_ip[MRL_STR_IP_LEN];
    char xvlan_outer_local_port[MRL_STR_PORT_LEN];
    
    int vxlan_vpn_id;
    int vxlan_link_dir;

    unsigned int vxlan_gdev_num;
    char vxlan_outer_gdev_mac[MRL_STR_MAC_LEN];
    char **vxlan_outer_gdev_ip;
    char **vxlan_outer_gdev_port;

    
    unsigned int vxlan_link_id_num;//���������豸������·��
    int **vxlan_link_id;
    char ***vxlan_inner_smac;
    char ***vxlan_inner_dmac;  
};

struct mrl_global_instance
{
    void *mrl_log_handle;
    struct mrl_global_cfg mrl_cfg;
    Maat_feather_t mrl_feather;
    MESA_htable_handle ht_nominee;
    MESA_lqueue_head mrl_queue;
    MMDB_s mrl_mmdb;
    int stop_flag;
    int *mrl_snd_fd;
    int mrl_rcv_fd;
    struct sockaddr_in mgw_addr;
};
#endif