Home | History | Annotate | Download | only in route
      1 /*
      2  * netlink/route/nexthop.h	Routing Nexthop
      3  *
      4  *	This library is free software; you can redistribute it and/or
      5  *	modify it under the terms of the GNU Lesser General Public
      6  *	License as published by the Free Software Foundation version 2.1
      7  *	of the License.
      8  *
      9  * Copyright (c) 2003-2008 Thomas Graf <tgraf (at) suug.ch>
     10  */
     11 
     12 #ifndef NETLINK_ROUTE_NEXTHOP_H_
     13 #define NETLINK_ROUTE_NEXTHOP_H_
     14 
     15 #include <netlink/netlink.h>
     16 #include <netlink/addr.h>
     17 
     18 #ifdef __cplusplus
     19 extern "C" {
     20 #endif
     21 
     22 struct rtnl_nexthop;
     23 
     24 enum {
     25 	NH_DUMP_FROM_ONELINE = -2,
     26 	NH_DUMP_FROM_DETAILS = -1,
     27 	NH_DUMP_FROM_ENV = 0,
     28 	/* > 0 reserved for nexthop index */
     29 };
     30 
     31 extern struct rtnl_nexthop * rtnl_route_nh_alloc(void);
     32 extern struct rtnl_nexthop * rtnl_route_nh_clone(struct rtnl_nexthop *);
     33 extern void		rtnl_route_nh_free(struct rtnl_nexthop *);
     34 
     35 extern int		rtnl_route_nh_compare(struct rtnl_nexthop *,
     36 					      struct rtnl_nexthop *,
     37 					      uint32_t, int);
     38 
     39 extern void		rtnl_route_nh_dump(struct rtnl_nexthop *,
     40 					   struct nl_dump_params *);
     41 
     42 extern void		rtnl_route_nh_set_weight(struct rtnl_nexthop *, uint8_t);
     43 extern uint8_t		rtnl_route_nh_get_weight(struct rtnl_nexthop *);
     44 extern void		rtnl_route_nh_set_ifindex(struct rtnl_nexthop *, int);
     45 extern int		rtnl_route_nh_get_ifindex(struct rtnl_nexthop *);
     46 extern void		rtnl_route_nh_set_gateway(struct rtnl_nexthop *,
     47 						  struct nl_addr *);
     48 extern struct nl_addr *	rtnl_route_nh_get_gateway(struct rtnl_nexthop *);
     49 extern void		rtnl_route_nh_set_flags(struct rtnl_nexthop *,
     50 						unsigned int);
     51 extern void		rtnl_route_nh_unset_flags(struct rtnl_nexthop *,
     52 						  unsigned int);
     53 extern unsigned int	rtnl_route_nh_get_flags(struct rtnl_nexthop *);
     54 extern void		rtnl_route_nh_set_realms(struct rtnl_nexthop *,
     55 						 uint32_t);
     56 extern uint32_t		rtnl_route_nh_get_realms(struct rtnl_nexthop *);
     57 
     58 extern char *		rtnl_route_nh_flags2str(int, char *, size_t);
     59 extern int		rtnl_route_nh_str2flags(const char *);
     60 
     61 #ifdef __cplusplus
     62 }
     63 #endif
     64 
     65 #endif
     66