?? tc_linux.h
字號:
#ifndef _RSVP_TC_LINUX_H_#define _RSVP_TC_LINUX_H_ 1/* * tc_linux.h Interface ISI RSVPD <-> Linux packet schduler. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> * */#include <sys/socket.h>#include <sys/uio.h>/*#include <net/if.h>*/#include <linux/rtnetlink.h>#include <linux/pkt_sched.h>#include <linux/pkt_cls.h>#include "tc_core.h"typedef __u32 Qhandle;typedef __u32 Chandle;typedef __u32 Fhandle;struct __rsvp_filter_head_t;struct __rsvp_filter_t;struct __rsvp_flow_t;struct __rsvp_qdisc_t;struct __flow_acinfo;typedef struct __rsvp_filter_head_t rsvp_filter_head_t;typedef struct __rsvp_filter_t rsvp_filter_t;typedef struct __rsvp_flow_t rsvp_flow_t;typedef struct __rsvp_qdisc_t rsvp_qdisc_t;typedef struct __flow_acinfo_t flow_acinfo_t;#define RSVP_DEF_FPRIO4 TC_H_MAKE((10<<16), 0)#define RSVP_DEF_FPRIO6 TC_H_MAKE((11<<16), 0)#define RSVP_FLOW_MAG 1234567#define RSVP_FILTER_MAG 7654321struct admission_info{/* Parameters */ int bw_max; float epsilon; float interval; float time_const; int cl_max; int g_max; int mem_max;/* State */ int cl_num; int cl_sum; float clp2_sum; int cl_rate; int cl_mem; int cl_cur_rate; int cl_cur_mem; int g_num; int g_sum; int mem_cur; time_t last_m; float ewma_const; float mu;};struct __rsvp_filter_head_t{ rsvp_filter_head_t *next; int family; __u32 prio; __u32 protocol; char kind[IFNAMSIZ];};struct __rsvp_qdisc_t{ struct if_link *link; Chandle parent; Qhandle handle; rsvp_filter_head_t *filter_heads; rsvp_flow_t *flow_list; struct rsvp_qdisc_ops *qops; void *data; float C; float D; float wfactor; float lminlatency; float lmaxlatency; int laddend; int lmtu; int llhead; struct admission_info ai;};#define ADM_CL_STAT 1#define ADM_CL_DET 2#define ADM_G_DET 3struct __flow_acinfo_t{ char commited; char admtype; float rate; float peakrate; unsigned mem;};struct __rsvp_flow_t{ rsvp_flow_t *next; int magic; rsvp_qdisc_t *qi; Chandle classid; struct tc_police policer; rsvp_filter_t *filters; flow_acinfo_t ai; void *class;};struct __rsvp_filter_t{ rsvp_filter_t *next; rsvp_flow_t *flow; rsvp_filter_head_t *fhead; int magic; Fhandle handle;};struct rsvp_qdisc_ops{ char kind[IFNAMSIZ]; int (*alloc)(rsvp_qdisc_t *, struct tcmsg *t, struct rtattr **tb); void (*free)(rsvp_qdisc_t *); int (*start)(rsvp_qdisc_t *); void (*clear)(rsvp_qdisc_t *); int (*agg_cl_rate)(rsvp_qdisc_t *); int (*new_flow)(rsvp_flow_t *f); int (*mod_flow)(rsvp_flow_t *f, rsvp_flow_t *new_f); int (*del_flow)(rsvp_flow_t *f);};struct if_link{ char ifl_name[IFNAMSIZ]; /* Interface name */ int ifl_index; /* Interface number */ unsigned ifl_sflags;#define IFL_FLAG_TCUP 1#define IFL_FLAG_TCDOWN 2#define IFL_FLAG_TC (IFL_FLAG_TCDOWN|IFL_FLAG_TCUP) float32_t ifl_path_bw; /* Path bandwidth */ u_int32_t ifl_min_latency; /* Min latency */ u_int32_t ifl_path_mtu; void *ifl_qdisc;};extern struct if_link ifl_vec[];extern struct rtnl_handle tc_nl;extern int tc_collect_qdisc(void);extern int tca_add_policing(struct rtattr *, int, int, rsvp_qdisc_t *qi, struct tc_police *);extern __u32 tca_policing_index(struct nlmsghdr *);extern int tc_kill_class(int, Chandle);extern int tc_add_class(int ifindex, Chandle parent, Chandle *classid, struct rtattr *opt);extern int tc_chg_class(int ifindex, Chandle classid, struct rtattr *opt, struct tc_estimator *est);extern int tc_get_stats(int ifindex, Chandle classid, struct tc_stats *st);extern void tc_kill_filters(rsvp_qdisc_t *qi, Chandle classid);extern int tc_init_filters(rsvp_qdisc_t *qi, Chandle classid);extern void tc_del_filter(rsvp_filter_t *f);extern int tc_add_filter(rsvp_filter_t *f, FilterSpec *fs, Session *s);extern int tc_mod_filter(rsvp_filter_t *f);extern int tc_add_shaper(rsvp_qdisc_t *, struct tc_police*, Chandle);extern int tc_del_shaper(rsvp_qdisc_t *, struct tc_police*, Chandle);#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -