2017-06-13 18:03:24 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at:
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TC_H
|
|
|
|
#define TC_H 1
|
|
|
|
|
|
|
|
#include <linux/pkt_cls.h>
|
|
|
|
#include <linux/pkt_sched.h>
|
|
|
|
#include <linux/rtnetlink.h>
|
|
|
|
#include "openvswitch/ofpbuf.h"
|
|
|
|
|
2017-06-13 18:03:26 +03:00
|
|
|
/* Returns tc handle 'major':'minor'. */
|
|
|
|
static inline unsigned int
|
|
|
|
tc_make_handle(unsigned int major, unsigned int minor)
|
|
|
|
{
|
|
|
|
return TC_H_MAKE(major << 16, minor);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns the major number from 'handle'. */
|
|
|
|
static inline unsigned int
|
|
|
|
tc_get_major(unsigned int handle)
|
|
|
|
{
|
|
|
|
return TC_H_MAJ(handle) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns the minor number from 'handle'. */
|
|
|
|
static inline unsigned int
|
|
|
|
tc_get_minor(unsigned int handle)
|
|
|
|
{
|
|
|
|
return TC_H_MIN(handle);
|
|
|
|
}
|
|
|
|
|
2017-06-13 18:03:24 +03:00
|
|
|
struct tcmsg *tc_make_request(int ifindex, int type,
|
|
|
|
unsigned int flags, struct ofpbuf *);
|
|
|
|
int tc_transact(struct ofpbuf *request, struct ofpbuf **replyp);
|
|
|
|
int tc_add_del_ingress_qdisc(int ifindex, bool add);
|
|
|
|
|
|
|
|
#endif /* tc.h */
|