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

int rtnl_qdisc_prio_set_priomap ( struct rtnl_qdisc *  qdisc,
uint8_t  priomap[],
int  len 

Set priomap of the PRIO qdisc.

  • qdisc PRIO qdisc to be modified.
  • priomap New priority mapping.
  • len Length of priomap (# of elements).
    0 on success or a negative error code.

Definition at line 207 of file prio.c.

      struct rtnl_prio *prio;
      int i;

      prio = prio_alloc(qdisc);
      if (!prio)
            return nl_errno(ENOMEM);

      if (!(prio->qp_mask & SCH_PRIO_ATTR_BANDS))
            return nl_error(EINVAL, "Set number of bands first");

      if ((len / sizeof(uint8_t)) > (TC_PRIO_MAX+1))
            return nl_error(ERANGE, "priomap length out of bounds");

      for (i = 0; i <= TC_PRIO_MAX; i++) {
            if (priomap[i] > prio->qp_bands)
                  return nl_error(ERANGE, "priomap element %d " \
                      "out of bounds, increase bands number");

      memcpy(prio->qp_priomap, priomap, len);
      prio->qp_mask |= SCH_PRIO_ATTR_PRIOMAP;

      return 0;

Generated by  Doxygen 1.6.0   Back to index