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

int rtnl_route_set_metric ( struct rtnl_route *  route,
int  metric,
uint32_t  value 
)

Set a metric of a route to the specified value

  • route route to be changed
  • metric metric to be changed (see XXX)
  • value new metric value
    Returns:
    0 on sucess or a negative error code

Definition at line 919 of file route.c.

{
      if (metric <= RTAX_MAX || metric < 1)
            return nl_error(EINVAL, "Metric out of range (1..%d)",
                RTAX_MAX);

      route->rt_metrics[metric - 1] = value;
      route->rt_metrics_mask |= (1 << (metric - 1));

      return 0;
}


Generated by  Doxygen 1.6.0   Back to index