| Server IP : 170.10.162.208 / Your IP : 216.73.216.181 Web Server : LiteSpeed System : Linux altar19.supremepanel19.com 4.18.0-553.69.1.lve.el8.x86_64 #1 SMP Wed Aug 13 19:53:59 UTC 2025 x86_64 User : deltahospital ( 1806) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/deltahospital/test.delta-hospital.com/ |
Upload File : |
genl.h 0000644 00000002535 15051134623 0005647 0 ustar 00 /* SPDX-License-Identifier: LGPL-2.1-only */
/*
* Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_GENL_H_
#define NETLINK_GENL_H_
#include <netlink/netlink.h>
#include <netlink/msg.h>
#include <netlink/attr.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int genl_connect(struct nl_sock *);
extern int genl_send_simple(struct nl_sock *, int, int,
int, int);
extern void * genlmsg_put(struct nl_msg *, uint32_t, uint32_t,
int, int, int, uint8_t, uint8_t);
extern int genlmsg_valid_hdr(struct nlmsghdr *, int);
extern int genlmsg_validate(struct nlmsghdr *, int, int,
const struct nla_policy *);
extern int genlmsg_parse(struct nlmsghdr *, int, struct nlattr **,
int, const struct nla_policy *);
extern struct genlmsghdr *
genlmsg_hdr(struct nlmsghdr *);
extern void * genlmsg_data(const struct genlmsghdr *);
extern void * genlmsg_user_hdr(const struct genlmsghdr *);
extern void * genlmsg_user_data(const struct genlmsghdr *, const int);
extern int genlmsg_user_datalen(const struct genlmsghdr *,
const int);
extern int genlmsg_len(const struct genlmsghdr *);
extern struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int);
extern int genlmsg_attrlen(const struct genlmsghdr *, int);
extern char * genl_op2name(int, int, char *, size_t);
#ifdef __cplusplus
}
#endif
#endif
mngt.h 0000644 00000007404 15051134623 0005667 0 ustar 00 /* SPDX-License-Identifier: LGPL-2.1-only */
/*
* Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_GENL_MNGT_H_
#define NETLINK_GENL_MNGT_H_
#include <netlink/netlink.h>
#include <netlink/attr.h>
#include <netlink/list.h>
#ifdef __cplusplus
extern "C" {
#endif
struct nl_cache_ops;
/**
* @ingroup genl_mngt
* @struct genl_info netlink/genl/mngt.h
*
* Informative structure passed on to message parser callbacks
*
* This structure is passed on to all message parser callbacks and contains
* information about the sender of the message as well as pointers to all
* relevant sections of the parsed message.
*
* @see genl_cmd::c_msg_parser
*/
struct genl_info
{
/** Socket address of sender */
struct sockaddr_nl * who;
/** Pointer to Netlink message header */
struct nlmsghdr * nlh;
/** Pointer to Generic Netlink message header */
struct genlmsghdr * genlhdr;
/** Pointer to user header */
void * userhdr;
/** Pointer to array of parsed attributes */
struct nlattr ** attrs;
};
/**
* @ingroup genl_mngt
* @struct genl_cmd netlink/genl/mngt.h
*
* Definition of a Generic Netlink command.
*
* This structure is used to define the list of available commands on the
* receiving side.
*
* @par Example:
* @code
* static struct genl_cmd foo_cmds[] = {
* {
* .c_id = FOO_CMD_NEW,
* .c_name = "NEWFOO" ,
* .c_maxattr = FOO_ATTR_MAX,
* .c_attr_policy = foo_policy,
* .c_msg_parser = foo_msg_parser,
* },
* {
* .c_id = FOO_CMD_DEL,
* .c_name = "DELFOO" ,
* },
* };
*
* static struct genl_ops my_genl_ops = {
* [...]
* .o_cmds = foo_cmds,
* .o_ncmds = ARRAY_SIZE(foo_cmds),
* };
* @endcode
*/
struct genl_cmd
{
/** Numeric command identifier (required) */
int c_id;
/** Human readable name (required) */
char * c_name;
/** Maximum attribute identifier that the command is prepared to handle. */
int c_maxattr;
/** Called whenever a message for this command is received */
int (*c_msg_parser)(struct nl_cache_ops *,
struct genl_cmd *,
struct genl_info *, void *);
/** Attribute validation policy, enforced before the callback is called */
struct nla_policy * c_attr_policy;
};
/**
* @ingroup genl_mngt
* @struct genl_ops netlink/genl/mngt.h
*
* Definition of a Generic Netlink family
*
* @par Example:
* @code
* static struct genl_cmd foo_cmds[] = {
* [...]
* };
*
* static struct genl_ops my_genl_ops = {
* .o_name = "foo",
* .o_hdrsize = sizeof(struct my_hdr),
* .o_cmds = foo_cmds,
* .o_ncmds = ARRAY_SIZE(foo_cmds),
* };
*
* if ((err = genl_register_family(&my_genl_ops)) < 0)
* // ERROR
* @endcode
*
* @see genl_cmd
*/
struct genl_ops
{
/** Length of user header */
unsigned int o_hdrsize;
/** Numeric identifier, automatically filled in by genl_ops_resolve() */
int o_id;
/** Human readable name, used by genl_ops_resolve() to resolve numeric id */
char * o_name;
/**
* If registered via genl_register(), will point to the related
* cache operations.
*/
struct nl_cache_ops * o_cache_ops;
/** Optional array defining the available Generic Netlink commands */
struct genl_cmd * o_cmds;
/** Number of elements in \c o_cmds array */
int o_ncmds;
/**
* @private
* Used internally to link together all registered operations.
*/
struct nl_list_head o_list;
};
extern int genl_register_family(struct genl_ops *);
extern int genl_unregister_family(struct genl_ops *);
extern int genl_handle_msg(struct nl_msg *, void *);
extern int genl_register(struct nl_cache_ops *);
extern void genl_unregister(struct nl_cache_ops *);
extern int genl_ops_resolve(struct nl_sock *, struct genl_ops *);
extern int genl_mngt_resolve(struct nl_sock *);
#ifdef __cplusplus
}
#endif
#endif
ctrl.h 0000644 00000001425 15051134623 0005663 0 ustar 00 /* SPDX-License-Identifier: LGPL-2.1-only */
/*
* Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_GENL_CTRL_H_
#define NETLINK_GENL_CTRL_H_
#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/addr.h>
#ifdef __cplusplus
extern "C" {
#endif
struct genl_family;
extern int genl_ctrl_alloc_cache(struct nl_sock *,
struct nl_cache **);
extern struct genl_family * genl_ctrl_search(struct nl_cache *, int);
extern struct genl_family * genl_ctrl_search_by_name(struct nl_cache *,
const char *);
extern int genl_ctrl_resolve(struct nl_sock *,
const char *);
extern int genl_ctrl_resolve_grp(struct nl_sock *sk,
const char *family,
const char *grp);
#ifdef __cplusplus
}
#endif
#endif
family.h 0000644 00000002357 15051134623 0006205 0 ustar 00 /* SPDX-License-Identifier: LGPL-2.1-only */
/*
* Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
*/
#ifndef NETLINK_GENL_FAMILY_H_
#define NETLINK_GENL_FAMILY_H_
#include <netlink/netlink.h>
#include <netlink/cache.h>
#ifdef __cplusplus
extern "C" {
#endif
struct genl_family;
extern struct genl_family * genl_family_alloc(void);
extern void genl_family_put(struct genl_family *);
extern unsigned int genl_family_get_id(struct genl_family *);
extern void genl_family_set_id(struct genl_family *, unsigned int);
extern char * genl_family_get_name(struct genl_family *);
extern void genl_family_set_name(struct genl_family *, const char *);
extern uint8_t genl_family_get_version(struct genl_family *);
extern void genl_family_set_version(struct genl_family *, uint8_t);
extern uint32_t genl_family_get_hdrsize(struct genl_family *);
extern void genl_family_set_hdrsize(struct genl_family *, uint32_t);
extern uint32_t genl_family_get_maxattr(struct genl_family *);
extern void genl_family_set_maxattr(struct genl_family *, uint32_t);
extern int genl_family_add_op(struct genl_family *, int, int);
extern int genl_family_add_grp(struct genl_family *, uint32_t ,
const char *);
#ifdef __cplusplus
}
#endif
#endif