rtnl.h revision 5e97c3fcce787a5bc0f8ceef43aa3e05195b480a
/*
* lxc: linux Container library
*
* (C) Copyright IBM Corp. 2007, 2008
*
* Authors:
* Daniel Lezcano <dlezcano at fr.ibm.com>
*
* 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.
*
* This 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
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __genl_h
#define __genl_h
/*
* Use this as a good size to allocate route netlink messages
*/
#define RTNLMSG_GOOD_SIZE NLMSG_GOOD_SIZE
/*
* struct genl_handler : the structure which store the netlink handler
* and the family number
*
* @nlh: the netlink socket handler
*/
struct rtnl_handler
{
struct nl_handler nlh;
};
/*
* struct rtnlmsg : the struct containing the route netlink message
* format
*
* @nlmsghdr: a netlink message header
* @rtnlmsghdr: a route netlink message header pointer
*
*/
struct rtnlmsg {
};
/*
* rtnetlink_open : open a route netlink socket
*
* @handler: a struct rtnl_handler pointer
*
* Returns 0 on success, < 0 otherwise
*/
/*
* genetlink_close : close a route netlink socket
*
* @handler: the handler of the socket to be closed
*
* Returns 0 on success, < 0 otherwise
*/
/*
* rtnetlink_rcv : receive a route netlink socket, it is up
* to the caller to manage the allocation of the route netlink message
*
* @handler: the handler of the route netlink socket
* @rtnlmsg: the pointer to a route netlink message pre-allocated
*
* Returns 0 on success, < 0 otherwise
*/
/*
* rtnetlink_send : send a route netlink socket, it is up
* to the caller to manage the allocation of the route netlink message
*
* @handler: the handler of the route netlink socket
* @rtnlmsg: the pointer to a netlink message pre-allocated
*
* Returns 0 on success, < 0 otherwise
*/
/*
* rtnetlink_transaction : send and receive a route netlink message in one shot
*
* @handler: the handler of the route netlink socket
* @request: a route netlink message containing the request to be sent
* @answer: a pre-allocated route netlink message to receive the response
*
* Returns 0 on success, < 0 otherwise
*/
#endif