1 /* 2 * Copyright (C) 2014 Red Hat 3 * 4 * Author: Nikos Mavrogiannopoulos 5 * 6 * This file is part of ocserv. 7 * 8 * ocserv is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public License 10 * as published by the Free Software Foundation; either version 2.1 of 11 * the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, but 14 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/> 20 */ 21 #ifndef PROC_SEARCH_H 22 # define PROC_SEARCH_H 23 24 #include <vpn.h> 25 #include <string.h> 26 #include <sys/socket.h> 27 #include <ccan/hash/hash.h> 28 #include <main.h> 29 30 struct proc_st *proc_search_single_ip(struct main_server_st *s, 31 struct sockaddr_storage *sockaddr, 32 unsigned sockaddr_size); 33 struct proc_st *proc_search_dtls_id(struct main_server_st *s, const uint8_t *id, unsigned id_size); 34 struct proc_st *proc_search_sid(struct main_server_st *s, 35 const uint8_t id[SID_SIZE]); 36 37 void proc_table_init(main_server_st *s); 38 void proc_table_deinit(main_server_st *s); 39 int proc_table_add(main_server_st *s, struct proc_st *proc); 40 void proc_table_del(main_server_st *s, struct proc_st *proc); 41 int proc_table_update_ip(main_server_st *s, struct proc_st *proc, struct sockaddr_storage *addr, unsigned addr_size); 42 int proc_table_update_dtls_ip(main_server_st *s, struct proc_st *proc, struct sockaddr_storage *addr, unsigned addr_size); 43 44 #endif 45