2
* netlink/route/tc-api.h Traffic Control API
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation version 2.1
9
* Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
12
#ifndef NETLINK_TC_API_H_
13
#define NETLINK_TC_API_H_
15
#include <netlink/netlink.h>
16
#include <netlink/msg.h>
17
#include <netlink/route/tc.h>
30
#define RTNL_TC_TYPE_MAX (__RTNL_TC_TYPE_MAX - 1)
33
* Traffic control object operations
36
* This structure holds function pointers and settings implementing
37
* the features of each traffic control object implementation.
42
* Name of traffic control module
47
* Type of traffic control object
49
enum rtnl_tc_type to_type;
53
* Size of private data
60
void (*to_dump[NL_DUMP_MAX+1])(struct rtnl_tc *, void *,
61
struct nl_dump_params *);
63
* Used to fill the contents of TCA_OPTIONS
65
int (*to_msg_fill)(struct rtnl_tc *, void *, struct nl_msg *);
68
* Uesd to to fill tc related messages, unlike with to_msg_fill,
69
* the contents is not encapsulated with a TCA_OPTIONS nested
72
int (*to_msg_fill_raw)(struct rtnl_tc *, void *, struct nl_msg *);
75
* TCA_OPTIONS message parser
77
int (*to_msg_parser)(struct rtnl_tc *, void *);
80
* Called before a tc object is destroyed
82
void (*to_free_data)(struct rtnl_tc *, void *);
85
* Called whenever a classifier object needs to be cloned
87
int (*to_clone)(void *, void *);
90
* Internal, don't touch
92
struct nl_list_head to_list;
95
struct rtnl_tc_type_ops
97
enum rtnl_tc_type tt_type;
104
void (*tt_dump[NL_DUMP_MAX+1])(struct rtnl_tc *,
105
struct nl_dump_params *);
108
extern int rtnl_tc_msg_parse(struct nlmsghdr *,
110
extern int rtnl_tc_msg_build(struct rtnl_tc *, int,
111
int, struct nl_msg **);
113
extern void rtnl_tc_free_data(struct nl_object *);
114
extern int rtnl_tc_clone(struct nl_object *,
116
extern void rtnl_tc_dump_line(struct nl_object *,
117
struct nl_dump_params *);
118
extern void rtnl_tc_dump_details(struct nl_object *,
119
struct nl_dump_params *);
120
extern void rtnl_tc_dump_stats(struct nl_object *,
121
struct nl_dump_params *);
122
extern int rtnl_tc_compare(struct nl_object *,
126
extern void * rtnl_tc_data(struct rtnl_tc *);
128
extern struct rtnl_tc_ops * rtnl_tc_lookup_ops(enum rtnl_tc_type,
130
extern struct rtnl_tc_ops * rtnl_tc_get_ops(struct rtnl_tc *);
131
extern int rtnl_tc_register(struct rtnl_tc_ops *);
132
extern void rtnl_tc_unregister(struct rtnl_tc_ops *);
134
extern void rtnl_tc_type_register(struct rtnl_tc_type_ops *);
135
extern void rtnl_tc_type_unregister(struct rtnl_tc_type_ops *);