mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 04:23:00 +00:00

Generic Netlink is an extension of Netlink meant for kernel-user space communications. It supports the dynamic allocation of communication channels. Kernel and user space applications register their services with a Generic Netlink controller. The Generic Netlink controller is responsible for assigning a unique channel number with each service. Clients who want to use a service query the controller to see if the service exists and to determine the correct channel number. The channel number is used to access the requested service. This commit adds the base functionality to get the channel number assigned to a specific service. More precisely, this commit adds a function `genl_resolve_family()` that takes the service name (called family in the Generic Netlink terminology) as an input parameter and queries the Generic Netlink controller to get the channel number assigned with the requested service. Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
37 lines
635 B
C
37 lines
635 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Header file exported by ge_netlink.c to zebra.
|
|
* Copyright (C) 2022, Carmine Scarpitta
|
|
*/
|
|
|
|
#ifndef _ZEBRA_GE_NETLINK_H
|
|
#define _ZEBRA_GE_NETLINK_H
|
|
|
|
#include "zebra_dplane.h"
|
|
|
|
#ifdef HAVE_NETLINK
|
|
|
|
#include <linux/genetlink.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Generic Netlink request message */
|
|
struct genl_request {
|
|
struct nlmsghdr n;
|
|
struct genlmsghdr g;
|
|
char buf[1024];
|
|
};
|
|
|
|
extern int genl_resolve_family(const char *family);
|
|
extern void ge_netlink_init(struct zebra_ns *zns);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* HAVE_NETLINK */
|
|
|
|
#endif /* _ZEBRA_GE_NETLINK_H */
|