libnl
3.9.0
nh.h
1
/* SPDX-License-Identifier: LGPL-2.1-only */
2
/*
3
* Copyright (c) 2022 Stanislav Zaikin <zstaseg@gmail.com>
4
*/
5
6
#ifndef NETLINK_ROUTE_NEXTHOP2_H_
7
#define NETLINK_ROUTE_NEXTHOP2_H_
8
9
#include <netlink/netlink.h>
10
#include <netlink/addr.h>
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
16
struct
rtnl_nh;
17
18
typedef
struct
nl_nh_group_info
{
19
uint32_t
nh_id
;
/*!< nexthop id */
20
uint8_t
weight
;
/*!< weight in nexthop group */
21
}
nl_nh_group_info_t
;
22
23
typedef
struct
nl_nh_group
{
24
int
ce_refcnt;
25
unsigned
size;
26
nl_nh_group_info_t
*entries;
27
}
nl_nh_group_t
;
28
29
extern
int
rtnl_nh_alloc_cache(
struct
nl_sock *sk,
int
family,
30
struct
nl_cache **result);
31
extern
struct
rtnl_nh *rtnl_nh_alloc(
void
);
32
extern
void
rtnl_nh_put(
struct
rtnl_nh *);
33
34
extern
struct
rtnl_nh *rtnl_nh_get(
struct
nl_cache *cache,
int
nhid);
35
36
extern
int
rtnl_nh_set_gateway(
struct
rtnl_nh *,
struct
nl_addr *);
37
extern
struct
nl_addr *rtnl_nh_get_gateway(
struct
rtnl_nh *);
38
39
extern
int
rtnl_nh_set_fdb(
struct
rtnl_nh *,
int
value);
40
extern
int
rtnl_nh_get_fdb(
struct
rtnl_nh *);
41
42
extern
int
rtnl_nh_get_group_entry(
struct
rtnl_nh *,
int
n);
43
extern
int
rtnl_nh_get_group_size(
struct
rtnl_nh *);
44
45
extern
int
rtnl_nh_get_id(
struct
rtnl_nh *);
46
extern
int
rtnl_nh_get_oif(
struct
rtnl_nh *);
47
48
#ifdef __cplusplus
49
}
50
#endif
51
52
#endif
nl_nh_group_info
Definition
nh.h:18
nl_nh_group_info::nh_id
uint32_t nh_id
Definition
nh.h:19
nl_nh_group_info::weight
uint8_t weight
Definition
nh.h:20
nl_nh_group
Definition
nh.h:23
include
netlink
route
nh.h
Generated on Mon Dec 4 2023 12:44:19 for libnl by
1.9.7