| 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 |
| 43 |
extern "C" { |
| 44 |
#endif |
| 45 |
|
| 46 |
struct xfrmnl_sel; |
| 47 |
|
| 48 |
/* Creation */ |
| 49 |
extern struct xfrmnl_sel* xfrmnl_sel_alloc(void); |
| 50 |
extern struct xfrmnl_sel* xfrmnl_sel_clone(struct xfrmnl_sel*); |
| 51 |
|
| 52 |
/* Usage Management */ |
| 53 |
extern struct xfrmnl_sel* xfrmnl_sel_get(struct xfrmnl_sel*); |
| 54 |
extern void xfrmnl_sel_put(struct xfrmnl_sel*); |
| 55 |
extern int xfrmnl_sel_shared(struct xfrmnl_sel*); |
| 56 |
extern int xfrmnl_sel_cmp(struct xfrmnl_sel*, struct xfrmnl_sel*); |
| 57 |
extern void xfrmnl_sel_dump(struct xfrmnl_sel*, struct nl_dump_params *); |
| 58 |
|
| 59 |
/* Access Functions */ |
| 60 |
extern struct nl_addr* xfrmnl_sel_get_daddr (struct xfrmnl_sel*); |
| 61 |
extern int xfrmnl_sel_set_daddr (struct xfrmnl_sel*, struct nl_addr*); |
| 62 |
|
| 63 |
extern struct nl_addr* xfrmnl_sel_get_saddr (struct xfrmnl_sel*); |
| 64 |
extern int xfrmnl_sel_set_saddr (struct xfrmnl_sel*, struct nl_addr*); |
| 65 |
|
| 66 |
extern int xfrmnl_sel_get_dport (struct xfrmnl_sel*); |
| 67 |
extern int xfrmnl_sel_set_dport (struct xfrmnl_sel*, unsigned int); |
| 68 |
|
| 69 |
extern int xfrmnl_sel_get_dportmask (struct xfrmnl_sel*); |
| 70 |
extern int xfrmnl_sel_set_dportmask (struct xfrmnl_sel*, unsigned int); |
| 71 |
|
| 72 |
extern int xfrmnl_sel_get_sport (struct xfrmnl_sel*); |
| 73 |
extern int xfrmnl_sel_set_sport (struct xfrmnl_sel*, unsigned int); |
| 74 |
|
| 75 |
extern int xfrmnl_sel_get_sportmask (struct xfrmnl_sel*); |
| 76 |
extern int xfrmnl_sel_set_sportmask (struct xfrmnl_sel*, unsigned int); |
| 77 |
|
| 78 |
extern int xfrmnl_sel_get_family (struct xfrmnl_sel*); |
| 79 |
extern int xfrmnl_sel_set_family (struct xfrmnl_sel*, unsigned int); |
| 80 |
|
| 81 |
extern int xfrmnl_sel_get_prefixlen_d (struct xfrmnl_sel*); |
| 82 |
extern int xfrmnl_sel_set_prefixlen_d (struct xfrmnl_sel*, unsigned int); |
| 83 |
|
| 84 |
extern int xfrmnl_sel_get_prefixlen_s (struct xfrmnl_sel*); |
| 85 |
extern int xfrmnl_sel_set_prefixlen_s (struct xfrmnl_sel*, unsigned int); |
| 86 |
|
| 87 |
extern int xfrmnl_sel_get_proto (struct xfrmnl_sel*); |
| 88 |
extern int xfrmnl_sel_set_proto (struct xfrmnl_sel*, unsigned int); |
| 89 |
|
| 90 |
extern int xfrmnl_sel_get_ifindex (struct xfrmnl_sel*); |
| 91 |
extern int xfrmnl_sel_set_ifindex (struct xfrmnl_sel*, unsigned int); |
| 92 |
|
| 93 |
extern int xfrmnl_sel_get_userid (struct xfrmnl_sel*); |
| 94 |
extern int xfrmnl_sel_set_userid (struct xfrmnl_sel*, unsigned int); |
| 95 |
|
| 96 |
#ifdef __cplusplus |
| 97 |
} |
| 98 |
#endif |
| 99 |
|
| 100 |
#endif |