tizen 2.3.1 release
[kernel/api/system-resource.git] / src / common / transmission.h
1 /*
2  * @file transmission.h
3  * @brief Kernel - user space transmition structures
4  *
5  */
6
7 #ifndef _TRAFFIC_CONTROL_TRAFFIC_STAT_TRANSMITION_H_
8 #define _TRAFFIC_CONTROL_TRAFFIC_STAT_TRANSMITION_H_
9 #ifdef _KERNEL_
10 #include <linux/socket.h>
11 #include <linux/types.h>
12 #else
13 #include <netinet/in.h>
14 #include <sys/types.h>
15 #endif
16
17 /* Used both in kernel module and in control daemon */
18
19 /*
20  * @brief Entity for outgoing and incomming packet counter information.
21  * Used for serialization.
22  */
23 struct traffic_event {
24         u_int32_t sk_classid;
25         unsigned long bytes;
26         int ifindex;
27 };
28
29 enum traffic_restriction_type {
30         RST_UNDEFINDED,
31         RST_SET,
32         RST_UNSET,
33         RST_EXCLUDE,
34         RST_MAX_VALUE
35 };
36
37 /*
38  * @brief Traffic restriction structure for serialization
39  * type - traffic_restriction_type
40  */
41 struct traffic_restriction {
42         u_int32_t sk_classid;
43         int type;
44         int ifindex;
45         int send_limit;
46         int rcv_limit;
47         int snd_warning_threshold;
48         int rcv_warning_threshold;
49 };
50
51 #define RESOURCED_ALL_IFINDEX 1
52
53 #endif                          /*TRAFFIC_CONTROL_TRAFFIC_STAT_TRANSMITION */