
So far all common tc atttributes were accessed via specific functions, i.e. rtnl_class_set_parent(), rtnl_qdisc_set_parent(), rtnl_cls_set_parent() which implied a lot of code duplication. Since all tc objects are derived from struct rtnl_tc and these common attributes are already stored in there this patch removes all type specific functions and makes rtnl_tc_* attribute functions public. rtnl_qdisc_set_parent(qdisc, 10); becomes: rtnl_tc_set_parent((struct rtnl_tc *) qdisc, 10); This patch also adds the following new attributes to tc objects therefore removing them as tc specific attributes: - mtu - mpu - overhead This allows for the rate table calculations to be unified as well taking into account the new kernel behavior to take care of overhead automatically.
24 lines
689 B
C
24 lines
689 B
C
/*
|
|
* netlink/cli/class.h CLI Class Helpers
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation version 2.1
|
|
* of the License.
|
|
*
|
|
* Copyright (c) 2010 Thomas Graf <tgraf@suug.ch>
|
|
*/
|
|
|
|
#ifndef __NETLINK_CLI_CLASS_H_
|
|
#define __NETLINK_CLI_CLASS_H_
|
|
|
|
#include <netlink/route/class.h>
|
|
#include <netlink/route/class-modules.h>
|
|
#include <netlink/cli/tc.h>
|
|
|
|
extern struct rtnl_class *nl_cli_class_alloc(void);
|
|
extern struct nl_cache *nl_cli_class_alloc_cache(struct nl_sock *, int);
|
|
|
|
extern void nl_cli_class_parse_kind(struct rtnl_class *, char *);
|
|
|
|
#endif
|