Server IP : 103.169.32.36 / Your IP : 216.73.217.13 Web Server : Apache System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : apache ( 48) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/opt/eset/efs/ewap/eset_wap/ |
Upload File : |
| Current File : /var/opt/eset/efs/ewap/eset_wap/ewap_tcp_map.h |
/*
* eset_wap (ESET Web Access Protection module)
* Copyright (C) 1992-2023 ESET, spol. s r.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* In case of any questions, you can contact us at ESET, spol. s r.o., Einsteinova 24, 851 01 Bratislava, Slovakia.
*/
#ifndef _EWAP_TCP_MAP_H_
#define _EWAP_TCP_MAP_H_
#include "ewap_path.h"
#include <linux/rbtree.h>
struct ewap_tcp_key {
uint32_t port;
uint64_t saddr_hi;
uint64_t saddr_lo;
uint64_t daddr_hi;
uint64_t daddr_lo;
};
struct ewap_tcp_node {
struct ewap_tcp_key key;
struct rb_node node;
pid_t pid;
uid_t uid;
struct ewap_path *path;
struct ewap_tcp_map *tcp_map;
struct list_head list;
};
struct ewap_tcp_map {
struct rb_root connections;
};
struct ewap_tcp_node *ewap_tcp_node_new(struct ewap_tcp_key key, pid_t pid,
uid_t uid);
void ewap_tcp_node_free(struct ewap_tcp_node *node);
int ewap_tcp_node_allocator_init(void);
void ewap_tcp_node_allocator_deinit(void);
void ewap_tcp_map_init(struct ewap_tcp_map *map);
void ewap_tcp_map_deinit(struct ewap_tcp_map *map);
bool ewap_tcp_map_add_pid(struct ewap_tcp_map *map,
struct ewap_tcp_node *new_node);
struct ewap_tcp_node *ewap_tcp_map_get_node(struct ewap_tcp_map *map,
const struct ewap_tcp_key *key);
struct ewap_tcp_node *ewap_tcp_map_extract_node(struct ewap_tcp_map *map,
const struct ewap_tcp_key *key);
#endif