Two swsusp patches:
[linux-flexiantxendom0-3.2.10.git] / net / ipv6 / mobile_ip6 / stats.h
1 /*
2  *      MIPL Mobile IPv6 Statistics header file
3  *
4  *      $Id: s.stats.h 1.11 03/04/10 13:09:54+03:00 anttit@jon.mipl.mediapoli.com $
5  *
6  *      This program is free software; you can redistribute it and/or
7  *      modify it under the terms of the GNU General Public License
8  *      as published by the Free Software Foundation; either version
9  *      2 of the License, or (at your option) any later version.
10  */
11
12 #ifndef _STATS_H
13 #define _STATS_H
14
15 struct mipv6_drop {
16         __u32 auth;
17         __u32 invalid;
18         __u32 misc;
19 };
20
21 struct mipv6_statistics {
22         int n_encapsulations;
23         int n_decapsulations;
24         int n_mh_in_msg;
25         int n_mh_in_error;
26         int n_mh_out_msg;
27         int n_mh_out_error;
28
29         int n_brr_rcvd;
30         int n_hoti_rcvd;
31         int n_coti_rcvd;
32         int n_hot_rcvd;
33         int n_cot_rcvd;
34         int n_bu_rcvd;
35         int n_ba_rcvd;
36         int n_ban_rcvd;
37         int n_be_rcvd;
38
39         int n_brr_sent;
40         int n_hoti_sent;
41         int n_coti_sent;
42         int n_hot_sent;
43         int n_cot_sent;
44         int n_bu_sent;
45         int n_ba_sent;
46         int n_ban_sent;
47         int n_be_sent;
48
49         int n_ha_rcvd;
50         int n_ha_sent;
51
52         struct mipv6_drop n_bu_drop;
53         struct mipv6_drop n_ba_drop;
54         struct mipv6_drop n_brr_drop;
55         struct mipv6_drop n_be_drop;
56         struct mipv6_drop n_ha_drop;
57 };
58
59 extern struct mipv6_statistics mipv6_stats;
60
61 #ifdef CONFIG_SMP
62 /* atomic_t is max 24 bits long */
63 #define MIPV6_INC_STATS(X) atomic_inc((atomic_t *)&mipv6_stats.X);
64 #else
65 #define MIPV6_INC_STATS(X) mipv6_stats.X++;
66 #endif
67
68 int mipv6_stats_init(void);
69 void mipv6_stats_exit(void);
70
71 #endif