Logo Search packages:      
Sourcecode: libnl version File versions  Download package

unsigned int rtnl_route_get_metric ( struct rtnl_route *  route,
int  metric 
)

Get a metric for a route

  • route route handle
  • metric metric to get
    Returns:
    The value for the specified metric or UINT_MAX if not set

Definition at line 954 of file route.c.

{
      if (metric <= RTAX_MAX || metric < 1)
            return UINT_MAX;

      if (!(route->rt_metrics_mask & (metric - 1)))
            return UINT_MAX;

      return route->rt_metrics[metric - 1];
}


Generated by  Doxygen 1.6.0   Back to index