2013-01-03 03:01:50 +08:00
|
|
|
/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
2004-06-30 15:43:11 +08:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-10 07:18:22 +08:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2004-06-30 15:43:11 +08:00
|
|
|
|
|
|
|
#ifndef _NETLINKACCESS_H
|
|
|
|
#define _NETLINKACCESS_H 1
|
|
|
|
|
2013-05-01 23:46:34 +08:00
|
|
|
#include <stdint.h>
|
2004-06-30 15:43:11 +08:00
|
|
|
#include <asm/types.h>
|
|
|
|
#include <linux/netlink.h>
|
|
|
|
#include <linux/rtnetlink.h>
|
|
|
|
|
2006-01-08 16:21:40 +08:00
|
|
|
#include <kernel-features.h>
|
2004-06-30 15:43:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
struct netlink_res
|
|
|
|
{
|
|
|
|
struct netlink_res *next;
|
|
|
|
struct nlmsghdr *nlh;
|
|
|
|
size_t size; /* Size of response. */
|
|
|
|
uint32_t seq; /* sequential number we used. */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct netlink_handle
|
|
|
|
{
|
|
|
|
int fd; /* Netlink file descriptor. */
|
|
|
|
pid_t pid; /* Process ID. */
|
|
|
|
uint32_t seq; /* The sequence number we use currently. */
|
|
|
|
struct netlink_res *nlm_list; /* Pointer to list of responses. */
|
|
|
|
struct netlink_res *end_ptr; /* For faster append of new entries. */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern int __netlink_open (struct netlink_handle *h);
|
|
|
|
extern void __netlink_close (struct netlink_handle *h);
|
|
|
|
extern void __netlink_free_handle (struct netlink_handle *h);
|
2005-06-14 08:56:49 +08:00
|
|
|
extern int __netlink_request (struct netlink_handle *h, int type);
|
2004-06-30 15:43:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* netlinkaccess.h */
|