History

net: sched: pkt_cls: remove unused macros from uapi

Jamal points out that this header also contains kernel internal magic that cannot be used from userspace for anything meaningful. Lets remove what the kernel doesn't use anymore and wrap remainder with __KERNEL__.

Florian Westphal committed 11 years ago

Commit bd5850d1 parent 2efd0551 file · +5 −27Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/pkt_cls.h+5−27
@@ -4,6 +4,7 @@ · 3 unmodified lines
4#include <linux/types.h>4#include <linux/types.h>
5#include <linux/pkt_sched.h>5#include <linux/pkt_sched.h>
6 6
7#ifdef __KERNEL__
7/* I think i could have done better macros ; for now this is stolen from8/* I think i could have done better macros ; for now this is stolen from
8 * some arch/mips code - jhs9 * some arch/mips code - jhs
9*/10*/
@@ -35,23 +36,6 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance · 25 unmodified lines
35 *36 *
36 * */37 * */
37 38
38#ifndef __KERNEL__
39/* backwards compat for userspace only */
40#define TC_MUNGED _TC_MAKEMASK1(0)
41#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
42#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
43
44#define TC_OK2MUNGE _TC_MAKEMASK1(1)
45#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
46#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
47
48#define S_TC_VERD _TC_MAKE32(2)
49#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
50#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
51#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
52#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
53#endif
54
55#define S_TC_FROM _TC_MAKE32(6)39#define S_TC_FROM _TC_MAKE32(6)
56#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)40#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
57#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)41#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
@@ -65,20 +49,16 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance · 7 unmodified lines
65#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))49#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
66#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)50#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
67 51
68#ifndef __KERNEL__
69#define S_TC_RTTL _TC_MAKE32(9)
70#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
71#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
72#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
73#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
74#endif
75
76#define S_TC_AT _TC_MAKE32(12)52#define S_TC_AT _TC_MAKE32(12)
77#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)53#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
78#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)54#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
79#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)55#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
80#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))56#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
81 57
58#define MAX_REC_LOOP 4
59#define MAX_RED_LOOP 4
60#endif
61
82/* Action attributes */62/* Action attributes */
83enum {63enum {
84 TCA_ACT_UNSPEC,64 TCA_ACT_UNSPEC,
@@ -98,8 +78,6 @@ enum { · 13 unmodified lines
98#define TCA_ACT_NOUNBIND 078#define TCA_ACT_NOUNBIND 0
99#define TCA_ACT_REPLACE 179#define TCA_ACT_REPLACE 1
100#define TCA_ACT_NOREPLACE 080#define TCA_ACT_NOREPLACE 0
101#define MAX_REC_LOOP 4
102#define MAX_RED_LOOP 4
103 81
104#define TC_ACT_UNSPEC (-1)82#define TC_ACT_UNSPEC (-1)
105#define TC_ACT_OK 083#define TC_ACT_OK 0