sch_hfsc.c (00c04af9df3d26e5a8093da850e982a7b6aeada7) sch_hfsc.c (27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26)
1/*
2 * Copyright (c) 2003 Patrick McHardy, <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *

--- 1349 unchanged lines hidden (view full) ---

1358 return -1;
1359}
1360
1361static int
1362hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb,
1363 struct tcmsg *tcm)
1364{
1365 struct hfsc_class *cl = (struct hfsc_class *)arg;
1/*
2 * Copyright (c) 2003 Patrick McHardy, <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *

--- 1349 unchanged lines hidden (view full) ---

1358 return -1;
1359}
1360
1361static int
1362hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb,
1363 struct tcmsg *tcm)
1364{
1365 struct hfsc_class *cl = (struct hfsc_class *)arg;
1366 unsigned char *b = skb->tail;
1366 unsigned char *b = skb_tail_pointer(skb);
1367 struct rtattr *rta = (struct rtattr *)b;
1368
1369 tcm->tcm_parent = cl->cl_parent ? cl->cl_parent->classid : TC_H_ROOT;
1370 tcm->tcm_handle = cl->classid;
1371 if (cl->level == 0)
1372 tcm->tcm_info = cl->qdisc->handle;
1373
1374 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
1375 if (hfsc_dump_curves(skb, cl) < 0)
1376 goto rtattr_failure;
1367 struct rtattr *rta = (struct rtattr *)b;
1368
1369 tcm->tcm_parent = cl->cl_parent ? cl->cl_parent->classid : TC_H_ROOT;
1370 tcm->tcm_handle = cl->classid;
1371 if (cl->level == 0)
1372 tcm->tcm_info = cl->qdisc->handle;
1373
1374 RTA_PUT(skb, TCA_OPTIONS, 0, NULL);
1375 if (hfsc_dump_curves(skb, cl) < 0)
1376 goto rtattr_failure;
1377 rta->rta_len = skb->tail - b;
1377 rta->rta_len = skb_tail_pointer(skb) - b;
1378 return skb->len;
1379
1380 rtattr_failure:
1381 skb_trim(skb, b - skb->data);
1382 return -1;
1383}
1384
1385static int

--- 185 unchanged lines hidden (view full) ---

1571 __skb_queue_purge(&q->requeue);
1572 qdisc_watchdog_cancel(&q->watchdog);
1573}
1574
1575static int
1576hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
1577{
1578 struct hfsc_sched *q = qdisc_priv(sch);
1378 return skb->len;
1379
1380 rtattr_failure:
1381 skb_trim(skb, b - skb->data);
1382 return -1;
1383}
1384
1385static int

--- 185 unchanged lines hidden (view full) ---

1571 __skb_queue_purge(&q->requeue);
1572 qdisc_watchdog_cancel(&q->watchdog);
1573}
1574
1575static int
1576hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
1577{
1578 struct hfsc_sched *q = qdisc_priv(sch);
1579 unsigned char *b = skb->tail;
1579 unsigned char *b = skb_tail_pointer(skb);
1580 struct tc_hfsc_qopt qopt;
1581
1582 qopt.defcls = q->defcls;
1583 RTA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt);
1584 return skb->len;
1585
1586 rtattr_failure:
1587 skb_trim(skb, b - skb->data);

--- 190 unchanged lines hidden ---
1580 struct tc_hfsc_qopt qopt;
1581
1582 qopt.defcls = q->defcls;
1583 RTA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt);
1584 return skb->len;
1585
1586 rtattr_failure:
1587 skb_trim(skb, b - skb->data);

--- 190 unchanged lines hidden ---