libnl: /data/src/libnl3/include/netlink/xfrm/selector.h Source File

libnl 3.10.0

selector.h
1/*
2 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33*/
34#ifndef NETLINK_XFRM_SEL_H_
35#define NETLINK_XFRM_SEL_H_
36
37#include <netlink/netlink.h>
38#include <netlink/cache.h>
39#include <netlink/addr.h>
40#include <linux/xfrm.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46struct xfrmnl_sel;
47
48/* Creation */
49extern struct xfrmnl_sel* xfrmnl_sel_alloc(void);
50extern struct xfrmnl_sel* xfrmnl_sel_clone(struct xfrmnl_sel*);
51
52/* Usage Management */
53extern struct xfrmnl_sel* xfrmnl_sel_get(struct xfrmnl_sel*);
54extern void xfrmnl_sel_put(struct xfrmnl_sel*);
55extern int xfrmnl_sel_shared(struct xfrmnl_sel*);
56extern int xfrmnl_sel_cmp(struct xfrmnl_sel*, struct xfrmnl_sel*);
57extern void xfrmnl_sel_dump(struct xfrmnl_sel*, struct nl_dump_params *);
58
59/* Access Functions */
60extern struct nl_addr* xfrmnl_sel_get_daddr (struct xfrmnl_sel*);
61extern int xfrmnl_sel_set_daddr (struct xfrmnl_sel*, struct nl_addr*);
62
63extern struct nl_addr* xfrmnl_sel_get_saddr (struct xfrmnl_sel*);
64extern int xfrmnl_sel_set_saddr (struct xfrmnl_sel*, struct nl_addr*);
65
66extern int xfrmnl_sel_get_dport (struct xfrmnl_sel*);
67extern int xfrmnl_sel_set_dport (struct xfrmnl_sel*, unsigned int);
68
69extern int xfrmnl_sel_get_dportmask (struct xfrmnl_sel*);
70extern int xfrmnl_sel_set_dportmask (struct xfrmnl_sel*, unsigned int);
71
72extern int xfrmnl_sel_get_sport (struct xfrmnl_sel*);
73extern int xfrmnl_sel_set_sport (struct xfrmnl_sel*, unsigned int);
74
75extern int xfrmnl_sel_get_sportmask (struct xfrmnl_sel*);
76extern int xfrmnl_sel_set_sportmask (struct xfrmnl_sel*, unsigned int);
77
78extern int xfrmnl_sel_get_family (struct xfrmnl_sel*);
79extern int xfrmnl_sel_set_family (struct xfrmnl_sel*, unsigned int);
80
81extern int xfrmnl_sel_get_prefixlen_d (struct xfrmnl_sel*);
82extern int xfrmnl_sel_set_prefixlen_d (struct xfrmnl_sel*, unsigned int);
83
84extern int xfrmnl_sel_get_prefixlen_s (struct xfrmnl_sel*);
85extern int xfrmnl_sel_set_prefixlen_s (struct xfrmnl_sel*, unsigned int);
86
87extern int xfrmnl_sel_get_proto (struct xfrmnl_sel*);
88extern int xfrmnl_sel_set_proto (struct xfrmnl_sel*, unsigned int);
89
90extern int xfrmnl_sel_get_ifindex (struct xfrmnl_sel*);
91extern int xfrmnl_sel_set_ifindex (struct xfrmnl_sel*, unsigned int);
92
93extern int xfrmnl_sel_get_userid (struct xfrmnl_sel*);
94extern int xfrmnl_sel_set_userid (struct xfrmnl_sel*, unsigned int);
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif
xfrmnl_sel_shared
int xfrmnl_sel_shared(struct xfrmnl_sel *)
Check whether an selector object is shared.
Definition selector.c:160
xfrmnl_sel_cmp
int xfrmnl_sel_cmp(struct xfrmnl_sel *, struct xfrmnl_sel *)
Compares two selector objects.
Definition selector.c:180
xfrmnl_sel_alloc
struct xfrmnl_sel * xfrmnl_sel_alloc(void)
Allocate new selector object.
Definition selector.c:96
xfrmnl_sel_clone
struct xfrmnl_sel * xfrmnl_sel_clone(struct xfrmnl_sel *)
Clone existing selector object.
Definition selector.c:115
nl_dump_params
Dumping parameters.
Definition types.h:32
xfrmnl_sel
Definition selector.c:55