13#include "nl-default.h"
15#include <netlink/netlink.h>
16#include <netlink/utils.h>
17#include <netlink/route/rtnl.h>
18#include <netlink/route/neightbl.h>
19#include <netlink/route/link.h>
22#include "nl-priv-dynamic-core/nl-core.h"
23#include "nl-priv-dynamic-core/cache-api.h"
126 char nt_name[NTBLNAMSIZ];
128 uint32_t nt_gc_thresh1;
129 uint32_t nt_gc_thresh2;
130 uint32_t nt_gc_thresh3;
131 uint64_t nt_gc_interval;
132 struct ndt_config nt_config;
134 struct ndt_stats nt_stats;
138#define NEIGHTBL_ATTR_FAMILY 0x001
139#define NEIGHTBL_ATTR_STATS 0x002
140#define NEIGHTBL_ATTR_NAME 0x004
141#define NEIGHTBL_ATTR_THRESH1 0x008
142#define NEIGHTBL_ATTR_THRESH2 0x010
143#define NEIGHTBL_ATTR_THRESH3 0x020
144#define NEIGHTBL_ATTR_CONFIG 0x040
145#define NEIGHTBL_ATTR_PARMS 0x080
146#define NEIGHTBL_ATTR_GC_INTERVAL 0x100
148#define NEIGHTBLPARM_ATTR_IFINDEX 0x0001
149#define NEIGHTBLPARM_ATTR_REFCNT 0x0002
150#define NEIGHTBLPARM_ATTR_QUEUE_LEN 0x0004
151#define NEIGHTBLPARM_ATTR_APP_PROBES 0x0008
152#define NEIGHTBLPARM_ATTR_UCAST_PROBES 0x0010
153#define NEIGHTBLPARM_ATTR_MCAST_PROBES 0x0020
154#define NEIGHTBLPARM_ATTR_PROXY_QLEN 0x0040
155#define NEIGHTBLPARM_ATTR_REACHABLE_TIME 0x0080
156#define NEIGHTBLPARM_ATTR_BASE_REACHABLE_TIME 0x0100
157#define NEIGHTBLPARM_ATTR_RETRANS_TIME 0x0200
158#define NEIGHTBLPARM_ATTR_GC_STALETIME 0x0400
159#define NEIGHTBLPARM_ATTR_DELAY_PROBE_TIME 0x0800
160#define NEIGHTBLPARM_ATTR_ANYCAST_DELAY 0x1000
161#define NEIGHTBLPARM_ATTR_PROXY_DELAY 0x2000
162#define NEIGHTBLPARM_ATTR_LOCKTIME 0x4000
164static struct nl_cache_ops rtnl_neightbl_ops;
165static struct nl_object_ops neightbl_obj_ops;
168static uint64_t neightbl_compare(
struct nl_object *_a,
struct nl_object *_b,
169 uint64_t attrs,
int flags)
175#define _DIFF(ATTR, EXPR) ATTR_DIFF(attrs, ATTR, a, b, EXPR)
176 diff |= _DIFF(NEIGHTBL_ATTR_FAMILY, a->nt_family != b->nt_family);
177 diff |= _DIFF(NEIGHTBL_ATTR_NAME, strcmp(a->nt_name, b->nt_name));
178 diff |= _DIFF(NEIGHTBL_ATTR_THRESH1,
179 a->nt_gc_thresh1 != b->nt_gc_thresh1);
180 diff |= _DIFF(NEIGHTBL_ATTR_THRESH2,
181 a->nt_gc_thresh2 != b->nt_gc_thresh2);
182 diff |= _DIFF(NEIGHTBL_ATTR_THRESH3,
183 a->nt_gc_thresh3 != b->nt_gc_thresh3);
184 diff |= _DIFF(NEIGHTBL_ATTR_GC_INTERVAL,
185 a->nt_gc_interval != b->nt_gc_interval);
188 if (!(a->ce_mask & NEIGHTBL_ATTR_PARMS) &&
189 !(b->ce_mask & NEIGHTBL_ATTR_PARMS))
195#define REQ(F) (fp->ntp_mask & NEIGHTBLPARM_ATTR_##F)
196#define AVAIL(F) (op->ntp_mask & NEIGHTBLPARM_ATTR_##F)
197#define _C(F, N) (REQ(F) && (!AVAIL(F) || (op->N != fp->N)))
198 if (_C(IFINDEX, ntp_ifindex) ||
199 _C(QUEUE_LEN, ntp_queue_len) ||
200 _C(APP_PROBES, ntp_app_probes) ||
201 _C(UCAST_PROBES, ntp_ucast_probes) ||
202 _C(MCAST_PROBES, ntp_mcast_probes) ||
203 _C(PROXY_QLEN, ntp_proxy_qlen) ||
204 _C(LOCKTIME, ntp_locktime) ||
205 _C(RETRANS_TIME, ntp_retrans_time) ||
206 _C(BASE_REACHABLE_TIME, ntp_base_reachable_time) ||
207 _C(GC_STALETIME, ntp_gc_stale_time) ||
208 _C(DELAY_PROBE_TIME, ntp_probe_delay) ||
209 _C(ANYCAST_DELAY, ntp_anycast_delay) ||
210 _C(PROXY_DELAY, ntp_proxy_delay))
220static struct nla_policy neightbl_policy[NDTA_MAX + 1] = {
222 [NDTA_THRESH1] = { .type =
NLA_U32 },
223 [NDTA_THRESH2] = { .type =
NLA_U32 },
224 [NDTA_THRESH3] = { .type =
NLA_U32 },
225 [NDTA_GC_INTERVAL] = { .type =
NLA_U32 },
226 [NDTA_CONFIG] = { .minlen =
sizeof(
struct ndt_config) },
227 [NDTA_STATS] = { .minlen =
sizeof(
struct ndt_stats) },
231static int neightbl_msg_parser(
struct nl_cache_ops *ops,
232 struct sockaddr_nl *who,
struct nlmsghdr *n,
233 struct nl_parser_param *pp)
236 struct nlattr *tb[NDTA_MAX + 1];
237 struct rtgenmsg *rtmsg;
240 ntbl = rtnl_neightbl_alloc();
246 ntbl->ce_msgtype = n->nlmsg_type;
249 err =
nlmsg_parse(n,
sizeof(*rtmsg), tb, NDTA_MAX, neightbl_policy);
253 ntbl->nt_family = rtmsg->rtgen_family;
255 if (tb[NDTA_NAME] == NULL) {
256 err = -NLE_MISSING_ATTR;
260 nla_strlcpy(ntbl->nt_name, tb[NDTA_NAME], NTBLNAMSIZ);
261 ntbl->ce_mask |= NEIGHTBL_ATTR_NAME;
263 if (tb[NDTA_THRESH1]) {
264 ntbl->nt_gc_thresh1 =
nla_get_u32(tb[NDTA_THRESH1]);
265 ntbl->ce_mask |= NEIGHTBL_ATTR_THRESH1;
268 if (tb[NDTA_THRESH2]) {
269 ntbl->nt_gc_thresh2 =
nla_get_u32(tb[NDTA_THRESH2]);
270 ntbl->ce_mask |= NEIGHTBL_ATTR_THRESH2;
273 if (tb[NDTA_THRESH3]) {
274 ntbl->nt_gc_thresh3 =
nla_get_u32(tb[NDTA_THRESH3]);
275 ntbl->ce_mask |= NEIGHTBL_ATTR_THRESH3;
278 if (tb[NDTA_GC_INTERVAL]) {
279 ntbl->nt_gc_interval =
nla_get_u32(tb[NDTA_GC_INTERVAL]);
280 ntbl->ce_mask |= NEIGHTBL_ATTR_GC_INTERVAL;
283 if (tb[NDTA_CONFIG]) {
285 sizeof(ntbl->nt_config));
286 ntbl->ce_mask |= NEIGHTBL_ATTR_CONFIG;
289 if (tb[NDTA_STATS]) {
291 sizeof(ntbl->nt_stats));
292 ntbl->ce_mask |= NEIGHTBL_ATTR_STATS;
295 if (tb[NDTA_PARMS]) {
296 struct nlattr *tbp[NDTPA_MAX + 1];
303#define COPY_ENTRY(name, var) \
304 if (tbp[NDTPA_##name]) { \
305 p->ntp_##var = nla_get_u32(tbp[NDTPA_##name]); \
306 p->ntp_mask |= NEIGHTBLPARM_ATTR_##name; \
309 COPY_ENTRY(IFINDEX, ifindex);
310 COPY_ENTRY(REFCNT, refcnt);
311 COPY_ENTRY(QUEUE_LEN, queue_len);
312 COPY_ENTRY(APP_PROBES, app_probes);
313 COPY_ENTRY(UCAST_PROBES, ucast_probes);
314 COPY_ENTRY(MCAST_PROBES, mcast_probes);
315 COPY_ENTRY(PROXY_QLEN, proxy_qlen);
316 COPY_ENTRY(PROXY_DELAY, proxy_delay);
317 COPY_ENTRY(ANYCAST_DELAY, anycast_delay);
318 COPY_ENTRY(LOCKTIME, locktime);
319 COPY_ENTRY(REACHABLE_TIME, reachable_time);
320 COPY_ENTRY(BASE_REACHABLE_TIME, base_reachable_time);
321 COPY_ENTRY(RETRANS_TIME, retrans_time);
322 COPY_ENTRY(GC_STALETIME, gc_stale_time);
323 COPY_ENTRY(DELAY_PROBE_TIME, probe_delay);
326 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
329 err = pp->pp_cb((
struct nl_object *)ntbl, pp);
331 rtnl_neightbl_put(ntbl);
335static int neightbl_request_update(
struct nl_cache *c,
struct nl_sock *h)
340static void neightbl_dump_line(
struct nl_object *arg,
struct nl_dump_params *p)
344 nl_dump_line(p,
"%s", ntbl->nt_name);
346 if (ntbl->nt_parms.
ntp_mask & NEIGHTBLPARM_ATTR_IFINDEX) {
347 struct nl_cache *link_cache;
357 nl_cache_put(link_cache);
363 if (ntbl->ce_mask & NEIGHTBL_ATTR_CONFIG)
364 nl_dump(p,
"entries %u ", ntbl->nt_config.ndtc_entries);
366 if (ntbl->ce_mask & NEIGHTBL_ATTR_PARMS) {
367 char rt[32], rt2[32];
370 nl_dump(p,
"reachable-time %s retransmit-time %s",
378static void neightbl_dump_details(
struct nl_object *arg,
381 char x[32], y[32], z[32];
384 neightbl_dump_line(arg, p);
386 if (ntbl->ce_mask & NEIGHTBL_ATTR_CONFIG) {
387 nl_dump_line(p,
" key-len %u entry-size %u last-flush %s\n",
388 ntbl->nt_config.ndtc_key_len,
389 ntbl->nt_config.ndtc_entry_size,
394 " gc threshold %u/%u/%u interval %s "
395 "chain-position %u\n",
396 ntbl->nt_gc_thresh1, ntbl->nt_gc_thresh2,
399 ntbl->nt_config.ndtc_hash_chain_gc);
401 nl_dump_line(p,
" hash-rand 0x%08X/0x%08X last-rand %s\n",
402 ntbl->nt_config.ndtc_hash_rnd,
403 ntbl->nt_config.ndtc_hash_mask,
408 if (ntbl->ce_mask & NEIGHTBL_ATTR_PARMS) {
412 " refcnt %u pending-queue-limit %u "
413 "proxy-delayed-queue-limit %u\n",
418 " num-userspace-probes %u num-unicast-probes "
419 "%u num-multicast-probes %u\n",
424 " min-age %s base-reachable-time %s "
425 "stale-check-interval %s\n",
432 " initial-probe-delay %s answer-delay %s "
433 "proxy-answer-delay %s\n",
440static void neightbl_dump_stats(
struct nl_object *arg,
struct nl_dump_params *p)
444 neightbl_dump_details(arg, p);
446 if (!(ntbl->ce_mask & NEIGHTBL_ATTR_STATS))
451 " lookups %llu hits %llu failed %llu"
452 " allocations %llu destroys %llu\n",
453 (
long long unsigned)ntbl->nt_stats.ndts_lookups,
454 (
long long unsigned)ntbl->nt_stats.ndts_hits,
455 (
long long unsigned)ntbl->nt_stats.ndts_res_failed,
456 (
long long unsigned)ntbl->nt_stats.ndts_allocs,
457 (
long long unsigned)ntbl->nt_stats.ndts_destroys);
461 " hash-grows %llu forced-gc-runs %llu"
462 " periodic-gc-runs %llu\n",
463 (
long long unsigned)ntbl->nt_stats.ndts_hash_grows,
464 (
long long unsigned)ntbl->nt_stats.ndts_forced_gc_runs,
465 (
long long unsigned)ntbl->nt_stats.ndts_periodic_gc_runs);
469 " rcv-unicast-probes %llu"
470 " rcv-multicast-probes %llu"
472 (
long long unsigned)ntbl->nt_stats.ndts_rcv_probes_ucast,
473 (
long long unsigned)ntbl->nt_stats.ndts_rcv_probes_mcast);
528 const char *name,
int ifindex)
532 if (cache->c_ops != &rtnl_neightbl_ops)
535 nl_list_for_each_entry(nt, &cache->c_items, ce_list) {
536 if (!strcasecmp(nt->nt_name, name) &&
538 (ifindex && ifindex == nt->nt_parms.
ntp_ifindex))) {
572 struct nl_msg **result)
574 struct nl_msg *m, *parms = NULL;
575 struct ndtmsg ndt = {
576 .ndtm_family = old->nt_family,
583 if (
nlmsg_append(m, &ndt,
sizeof(ndt), NLMSG_ALIGNTO) < 0)
584 goto nla_put_failure;
588 if (tmpl->ce_mask & NEIGHTBL_ATTR_THRESH1)
591 if (tmpl->ce_mask & NEIGHTBL_ATTR_THRESH2)
594 if (tmpl->ce_mask & NEIGHTBL_ATTR_THRESH2)
597 if (tmpl->ce_mask & NEIGHTBL_ATTR_GC_INTERVAL)
598 NLA_PUT_U64(m, NDTA_GC_INTERVAL, tmpl->nt_gc_interval);
600 if (tmpl->ce_mask & NEIGHTBL_ATTR_PARMS) {
605 goto nla_put_failure;
607 if (old->nt_parms.
ntp_mask & NEIGHTBLPARM_ATTR_IFINDEX)
611 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_QUEUE_LEN)
614 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_APP_PROBES)
617 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_UCAST_PROBES)
621 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_MCAST_PROBES)
625 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_PROXY_QLEN)
628 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_BASE_REACHABLE_TIME)
632 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_RETRANS_TIME)
636 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_GC_STALETIME)
640 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_DELAY_PROBE_TIME)
644 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_ANYCAST_DELAY)
648 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_PROXY_DELAY)
652 if (p->
ntp_mask & NEIGHTBLPARM_ATTR_LOCKTIME)
656 goto nla_put_failure;
698 return wait_for_ack(sk);
708void rtnl_neightbl_set_family(
struct rtnl_neightbl *ntbl,
int family)
710 ntbl->nt_family = family;
711 ntbl->ce_mask |= NEIGHTBL_ATTR_FAMILY;
714void rtnl_neightbl_set_gc_interval(
struct rtnl_neightbl *ntbl, uint64_t ms)
716 ntbl->nt_gc_interval = ms;
717 ntbl->ce_mask |= NEIGHTBL_ATTR_GC_INTERVAL;
720void rtnl_neightbl_set_gc_tresh1(
struct rtnl_neightbl *ntbl,
int thresh)
722 ntbl->nt_gc_thresh1 = thresh;
723 ntbl->ce_mask |= NEIGHTBL_ATTR_THRESH1;
726void rtnl_neightbl_set_gc_tresh2(
struct rtnl_neightbl *ntbl,
int thresh)
728 ntbl->nt_gc_thresh2 = thresh;
729 ntbl->ce_mask |= NEIGHTBL_ATTR_THRESH2;
732void rtnl_neightbl_set_gc_tresh3(
struct rtnl_neightbl *ntbl,
int thresh)
734 ntbl->nt_gc_thresh3 = thresh;
735 ntbl->ce_mask |= NEIGHTBL_ATTR_THRESH3;
738void rtnl_neightbl_set_name(
struct rtnl_neightbl *ntbl,
const char *name)
740 _nl_strncpy_trunc(ntbl->nt_name, name,
sizeof(ntbl->nt_name));
741 ntbl->ce_mask |= NEIGHTBL_ATTR_NAME;
744void rtnl_neightbl_set_dev(
struct rtnl_neightbl *ntbl,
int ifindex)
747 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_IFINDEX;
748 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
759 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_QUEUE_LEN;
760 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
771 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_PROXY_QLEN;
772 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
783 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_APP_PROBES;
784 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
795 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_UCAST_PROBES;
796 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
807 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_MCAST_PROBES;
808 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
820 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_BASE_REACHABLE_TIME;
821 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
832 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_RETRANS_TIME;
833 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
844 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_GC_STALETIME;
845 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
856 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_DELAY_PROBE_TIME;
857 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
868 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_ANYCAST_DELAY;
869 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
880 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_PROXY_DELAY;
881 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
892 ntbl->nt_parms.
ntp_mask |= NEIGHTBLPARM_ATTR_LOCKTIME;
893 ntbl->ce_mask |= NEIGHTBL_ATTR_PARMS;
898static struct nl_object_ops neightbl_obj_ops = {
899 .oo_name =
"route/neightbl",
906 .oo_compare = neightbl_compare,
909static struct nl_cache_ops rtnl_neightbl_ops = {
910 .co_name =
"route/neightbl",
911 .co_hdrsize =
sizeof(
struct rtgenmsg),
913 { RTM_NEWNEIGHTBL, NL_ACT_NEW,
"new" },
914 { RTM_SETNEIGHTBL, NL_ACT_SET,
"set" },
915 { RTM_GETNEIGHTBL, NL_ACT_GET,
"get" },
916 END_OF_MSGTYPES_LIST,
918 .co_protocol = NETLINK_ROUTE,
919 .co_request_update = neightbl_request_update,
920 .co_msg_parser = neightbl_msg_parser,
921 .co_obj_ops = &neightbl_obj_ops,
924static void _nl_init neightbl_init(
void)
929static void _nl_exit neightbl_exit(
void)
uint32_t nla_get_u32(const struct nlattr *nla)
Return payload of 32 bit integer attribute.
int nla_put_nested(struct nl_msg *msg, int attrtype, const struct nl_msg *nested)
Add nested attributes to netlink message.
#define NLA_PUT_U32(msg, attrtype, value)
Add 32 bit integer attribute to netlink message.
int nla_memcpy(void *dest, const struct nlattr *src, int count)
Copy attribute payload to another memory area.
size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize)
Copy string attribute payload to a buffer.
int nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla, const struct nla_policy *policy)
Create attribute index based on nested attribute.
#define NLA_PUT_STRING(msg, attrtype, value)
Add string attribute to netlink message.
#define NLA_PUT_U64(msg, attrtype, value)
Add 64 bit integer attribute to netlink message.
@ NLA_STRING
NUL terminated character string.
@ NLA_NESTED
Nested attributes.
int nl_cache_mngt_unregister(struct nl_cache_ops *ops)
Unregister a set of cache operations.
int nl_cache_mngt_register(struct nl_cache_ops *ops)
Register a set of cache operations.
struct nl_cache * nl_cache_mngt_require_safe(const char *name)
Return cache previously provided via nl_cache_mngt_provide()
int nl_cache_alloc_and_fill(struct nl_cache_ops *ops, struct nl_sock *sock, struct nl_cache **result)
Allocate new cache and fill it.
char * rtnl_link_i2name(struct nl_cache *cache, int ifindex, char *dst, size_t len)
Translate interface index to corresponding link name.
struct nl_msg * nlmsg_alloc_simple(int nlmsgtype, int flags)
Allocate a new netlink message.
void * nlmsg_data(const struct nlmsghdr *nlh)
Return pointer to message payload.
void nlmsg_free(struct nl_msg *msg)
Release a reference from an netlink message.
int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, const struct nla_policy *policy)
parse attributes of a netlink message
struct nl_msg * nlmsg_alloc(void)
Allocate a new netlink message with the default maximum payload size.
int nlmsg_append(struct nl_msg *n, void *data, size_t len, int pad)
Append data to tail of a netlink message.
void rtnl_neightbl_set_proxy_delay(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the proxy delay of a neighbour table to the specified value.
int rtnl_neightbl_change(struct nl_sock *sk, struct rtnl_neightbl *old, struct rtnl_neightbl *tmpl)
Change neighbour table attributes.
struct rtnl_neightbl * rtnl_neightbl_get(struct nl_cache *cache, const char *name, int ifindex)
Lookup neighbour table by name and optional interface index.
void rtnl_neightbl_set_locktime(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the locktime of a neighbour table to the specified value.
int rtnl_neightbl_build_change_request(struct rtnl_neightbl *old, struct rtnl_neightbl *tmpl, struct nl_msg **result)
Builds a netlink change request message to change neighbour table attributes.
void rtnl_neightbl_set_gc_stale_time(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the gc stale time of a neighbour table to the specified value.
void rtnl_neightbl_set_queue_len(struct rtnl_neightbl *ntbl, int len)
Set the queue length for pending requests of a neighbour table to the specified value.
int rtnl_neightbl_alloc_cache(struct nl_sock *sk, struct nl_cache **result)
Build a neighbour table cache including all neighbour tables currently configured in the kernel.
void rtnl_neightbl_set_app_probes(struct rtnl_neightbl *ntbl, int probes)
Set the number of application probes of a neighbour table to the specified value.
void rtnl_neightbl_set_anycast_delay(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the anycast delay of a neighbour table to the specified value.
void rtnl_neightbl_set_delay_probe_time(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the first probe delay time of a neighbour table to the specified value.
void rtnl_neightbl_set_retrans_time(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the retransmit time of a neighbour table to the specified value.
void rtnl_neightbl_set_mcast_probes(struct rtnl_neightbl *ntbl, int probes)
Set the number of multicast probes of a neighbour table to the specified value.
void rtnl_neightbl_set_proxy_queue_len(struct rtnl_neightbl *ntbl, int len)
Set the queue length for delay proxy arp requests of a neighbour table to the specified value.
void rtnl_neightbl_set_base_reachable_time(struct rtnl_neightbl *ntbl, uint64_t ms)
Set the base reachable time of a neighbour table to the specified value.
void rtnl_neightbl_set_ucast_probes(struct rtnl_neightbl *ntbl, int probes)
Set the number of unicast probes of a neighbour table to the specified value.
void nl_object_put(struct nl_object *obj)
Release a reference from an object.
void nl_object_get(struct nl_object *obj)
Acquire a reference on a object.
struct nl_object * nl_object_alloc(struct nl_object_ops *ops)
Allocate a new object of kind specified by the operations handle.
int nl_rtgen_request(struct nl_sock *sk, int type, int family, int flags)
Send routing netlink request message.
int nl_send_auto_complete(struct nl_sock *sk, struct nl_msg *msg)
void nl_dump(struct nl_dump_params *params, const char *fmt,...)
Dump a formatted character string.
char * nl_msec2str(uint64_t msec, char *buf, size_t len)
Convert milliseconds to a character string.
@ NL_DUMP_STATS
Dump all attributes including statistics.
@ NL_DUMP_LINE
Dump object briefly on one line.
@ NL_DUMP_DETAILS
Dump all attributes but no statistics.
Attribute validation policy.
uint16_t type
Type of attribute or NLA_UNSPEC.
uint64_t ntp_probe_delay
Delay in milliseconds for the first time probe if the neighbour is reachable.
uint64_t ntp_retrans_time
The time in milliseconds between retransmitted Neighbor Solicitation messages.
uint64_t ntp_reachable_time
Actual reachable time (read-only)
uint64_t ntp_proxy_delay
Delay in milliseconds before answering to an ARP request for which a proxy ARP entry exists.
uint32_t ntp_mcast_probes
Maximum number of retries for multicast solicitation.
uint32_t ntp_ifindex
Interface index of the device this parameter set is assigned to or 0 for the default set.
uint32_t ntp_proxy_qlen
Queue length for the delayed proxy arp requests.
uint64_t ntp_anycast_delay
Maximum delay in milliseconds of an answer to a neighbour solicitation message.
uint32_t ntp_app_probes
Number of requests to send to the user level ARP daemon.
uint32_t ntp_refcnt
Number of references to this parameter set.
uint32_t ntp_ucast_probes
Maximum number of retries for unicast solicitation.
uint64_t ntp_base_reachable_time
Base value in milliseconds to ompute reachable time, see RFC2461.
uint32_t ntp_mask
Mask of available parameter attributes.
uint32_t ntp_queue_len
Queue length for pending arp requests, i.e.
uint64_t ntp_gc_stale_time
Interval in milliseconds to check for stale neighbour entries.
uint64_t ntp_locktime
Minimum age in milliseconds before a neighbour entry may be replaced.