00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <netlink-local.h>
00013 #include <netlink-tc.h>
00014 #include <netlink/netlink.h>
00015 #include <netlink/utils.h>
00016 #include <netlink/route/tc-api.h>
00017 #include <netlink/route/classifier.h>
00018 #include <netlink/route/cls/police.h>
00019
00020
00021
00022
00023
00024
00025 static const struct trans_tbl police_types[] = {
00026 __ADD(TC_POLICE_UNSPEC,unspec)
00027 __ADD(TC_POLICE_OK,ok)
00028 __ADD(TC_POLICE_RECLASSIFY,reclassify)
00029 __ADD(TC_POLICE_SHOT,shot)
00030 #ifdef TC_POLICE_PIPE
00031 __ADD(TC_POLICE_PIPE,pipe)
00032 #endif
00033 };
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 char * nl_police2str(int type, char *buf, size_t len)
00047 {
00048 return __type2str(type, buf, len, police_types,
00049 ARRAY_SIZE(police_types));
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 int nl_str2police(const char *name)
00062 {
00063 return __str2type(name, police_types, ARRAY_SIZE(police_types));
00064 }
00065
00066