blob: 078c3f4f192ce7c1eb026d7f0ae2d8aff9281401 [file] [log] [blame]
Thomas Graf44d36242007-09-15 01:28:01 +02001/*
2 * netlink/route/neighbour.h Neighbours
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
7 * of the License.
8 *
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10 */
11
12#ifndef NETLINK_NEIGHBOUR_H_
13#define NETLINK_NEIGHBOUR_H_
14
15#include <netlink/netlink.h>
16#include <netlink/cache.h>
17#include <netlink/addr.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23struct rtnl_neigh;
24
25/* neighbour object allocation/freeage */
26extern struct rtnl_neigh * rtnl_neigh_alloc(void);
27extern void rtnl_neigh_put(struct rtnl_neigh *);
28
29/* neighbour cache management */
30extern struct nl_cache * rtnl_neigh_alloc_cache(struct nl_handle *);
31extern struct rtnl_neigh * rtnl_neigh_get(struct nl_cache *, int,
32 struct nl_addr *);
33
34/* Neigbour state translations */
35extern char * rtnl_neigh_state2str(int, char *, size_t);
36extern int rtnl_neigh_str2state(const char *);
37
38/* Neighbour flags translations */
39extern char * rtnl_neigh_flags2str(int, char *, size_t);
40extern int rtnl_neigh_str2flag(const char *);
41
42/* Neighbour Addition */
43extern int rtnl_neigh_add(struct nl_handle *,
44 struct rtnl_neigh *, int);
45extern struct nl_msg * rtnl_neigh_build_add_request(struct rtnl_neigh *, int);
46
47/* Neighbour Modification */
48extern int rtnl_neigh_change(struct nl_handle *,
49 struct rtnl_neigh *, int);
50extern struct nl_msg * rtnl_neigh_build_change_request(struct rtnl_neigh *, int);
51
52/* Neighbour Deletion */
53extern int rtnl_neigh_delete(struct nl_handle *,
54 struct rtnl_neigh *, int);
55extern struct nl_msg * rtnl_neigh_build_delete_request(struct rtnl_neigh *, int);
56
57/* Access functions */
58extern void rtnl_neigh_set_state(struct rtnl_neigh *, int);
59extern int rtnl_neigh_get_state(struct rtnl_neigh *);
60extern void rtnl_neigh_unset_state(struct rtnl_neigh *,
61 int);
62
63extern void rtnl_neigh_set_flags(struct rtnl_neigh *,
64 unsigned int);
65extern void rtnl_neigh_unset_flags(struct rtnl_neigh *,
66 unsigned int);
67extern unsigned int rtnl_neigh_get_flags(struct rtnl_neigh *);
68
69extern void rtnl_neigh_set_ifindex(struct rtnl_neigh *,
70 int);
71extern int rtnl_neigh_get_ifindex(struct rtnl_neigh *);
72
73extern void rtnl_neigh_set_lladdr(struct rtnl_neigh *,
74 struct nl_addr *);
75extern struct nl_addr * rtnl_neigh_get_lladdr(struct rtnl_neigh *);
76
77extern int rtnl_neigh_set_dst(struct rtnl_neigh *,
78 struct nl_addr *);
79extern struct nl_addr * rtnl_neigh_get_dst(struct rtnl_neigh *);
80
81extern void rtnl_neigh_set_type(struct rtnl_neigh *, int);
82extern int rtnl_neigh_get_type(struct rtnl_neigh *);
83
84extern void rtnl_neigh_set_family(struct rtnl_neigh *, int);
85extern int rtnl_neigh_get_family(struct rtnl_neigh *);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif