UniRec 3.0.0
Loading...
Searching...
No Matches
ipps_internal.h
Go to the documentation of this file.
1
8/*
9 * Copyright (C) 2013,2014 CESNET
10 *
11 * LICENSE TERMS
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in
20 * the documentation and/or other materials provided with the
21 * distribution.
22 * 3. Neither the name of the Company nor the names of its contributors
23 * may be used to endorse or promote products derived from this
24 * software without specific prior written permission.
25 *
26 * ALTERNATIVELY, provided that this notice is retained in full, this
27 * product may be distributed under the terms of the GNU General Public
28 * License (GPL) version 2 or later, in which case the provisions
29 * of the GPL apply INSTEAD OF those given above.
30 *
31 * This software is provided ``as is'', and any express or implied
32 * warranties, including, but not limited to, the implied warranties of
33 * merchantability and fitness for a particular purpose are disclaimed.
34 * In no event shall the company or contributors be liable for any
35 * direct, indirect, incidental, special, exemplary, or consequential
36 * damages (including, but not limited to, procurement of substitute
37 * goods or services; loss of use, data, or profits; or business
38 * interruption) however caused and on any theory of liability, whether
39 * in contract, strict liability, or tort (including negligence or
40 * otherwise) arising in any way out of the use of this software, even
41 * if advised of the possibility of such damage.
42 *
43 */
44
45#ifndef IPPS_INTERNAL_H
46#define IPPS_INTERNAL_H
47
52typedef struct ipps_interval_node {
54 struct ipps_interval_node *next;
56
63uint32_t **create_ip_v6_net_mask_array(void);
64
74void mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array);
75
83int cmp_net_v4(const void *v1, const void *v2);
84
92int cmp_net_v6(const void *v1, const void *v2);
93
104 uint32_t **net_mask_array);
105
113ipps_interval_node_t *new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip);
114
125 const ip_addr_t *low_ip, const ip_addr_t *high_ip);
126
134void ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec);
135
143void ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc);
144
150
151
167ipps_interval_t *init_context(ipps_network_t **networks, uint32_t network_count,
168 uint32_t *context_counter, uint32_t **net_mask_array);
169
180int add_data(ipps_interval_t *interval, void *data, size_t data_len);
181
191
198void destroy_ip_v6_net_mask_array(uint32_t **net_mask_array);
199
200
208int free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt);
209
217int destroy_list(ipps_interval_node_t *interval_list);
218
219#endif /* ip_prefix_search.h */
uint32_t ** create_ip_v6_net_mask_array(void)
ipps_interval_node_t * new_interval(const ip_addr_t *low_ip, const ip_addr_t *high_ip)
void ip_inc(const ip_addr_t *ip, ip_addr_t *ip_inc)
void destroy_ip_v6_net_mask_array(uint32_t **net_mask_array)
ipps_interval_t * interval
Pointer to interval structure.
Definition: ipps_internal.h:53
int free_data(ipps_interval_t *interval, void ***data_collector, uint32_t *data_coll_cnt)
int cmp_net_v6(const void *v1, const void *v2)
ipps_interval_node_t * insert_new_interval(ipps_interval_node_t *position, const ip_addr_t *low_ip, const ip_addr_t *high_ip)
ipps_context_t * new_context(void)
int destroy_list(ipps_interval_node_t *interval_list)
ipps_interval_t * init_context(ipps_network_t **networks, uint32_t network_count, uint32_t *context_counter, uint32_t **net_mask_array)
int add_data(ipps_interval_t *interval, void *data, size_t data_len)
void ip_dec(const ip_addr_t *ip, ip_addr_t *ip_dec)
int copy_all_data(ipps_interval_t *dest, ipps_interval_t *src)
void fill_interval_by_network(const ipps_network_t *net, ipps_interval_t *inter, uint32_t **net_mask_array)
int cmp_net_v4(const void *v1, const void *v2)
void mask_ipv6(ip_addr_t *ip, uint32_t mask, ip_addr_t *masked_ipv6, uint32_t **net_mask_array)
struct ipps_interval_node * next
Next node in list, NULL if last node in list.
Definition: ipps_internal.h:54