libnl 3.7.0
rtnl.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef NETLINK_RTNL_H_
7#define NETLINK_RTNL_H_
8
9#include <netlink/netlink.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/**
16 * @name Realms
17 * @{
18 */
19
20/**
21 * Mask specying the size of each realm part
22 * @ingroup rtnl
23 */
24#define RTNL_REALM_MASK (0xFFFF)
25
26/**
27 * Extract FROM realm from a realms field
28 */
29#define RTNL_REALM_FROM(realm) ((realm) >> 16)
30
31/**
32 * Extract TO realm from a realms field
33 */
34#define RTNL_REALM_TO(realm) ((realm) & RTNL_REALM_MASK)
35
36/**
37 * Build a realms field
38 */
39#define RTNL_MAKE_REALM(from, to) \
40 ((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to))
41
42/** @} */
43
44
45/* General */
46extern int nl_rtgen_request(struct nl_sock *, int, int, int);
47
48/* Routing Type Translations */
49extern char * nl_rtntype2str(int, char *, size_t);
50extern int nl_str2rtntype(const char *);
51
52/* Scope Translations */
53extern char * rtnl_scope2str(int, char *, size_t);
54extern int rtnl_str2scope(const char *);
55
56/* Realms Translations */
57extern char * rtnl_realms2str(uint32_t, char *, size_t);
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif
int nl_rtgen_request(struct nl_sock *, int, int, int)
Send routing netlink request message.
Definition: rtnl.c:35