diff options
| author | Simon Horman <horms@verge.net.au> | 2014-09-29 21:50:06 -0400 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-10-02 12:30:58 -0400 |
| commit | 07dcc686fa8f6667dec4696804cdb43a90267b9a (patch) | |
| tree | 56fb37eb652ad4fe203669aa171c94a4a9df0c48 | |
| parent | 4b7fd5d97ee6e599247b4a55122ca6ba80c8148d (diff) | |
ipvs: Clean up comment style in ip_vs.h
* Consistently use the multi-line comment style for networking code:
/* This
* That
* The other thing
*/
* Use single-line comment style for comments with only one line of text.
* In general follow the leading '*' of each line of a comment with a
single space and then text.
* Add missing line break between functions, remove double line break,
align comments to previous lines whenever possible.
Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
| -rw-r--r-- | include/net/ip_vs.h | 214 |
1 files changed, 75 insertions, 139 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 576d7f0bed5d..615b20b58545 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | /* | 1 | /* IP Virtual Server |
| 2 | * IP Virtual Server | 2 | * data structure and functionality definitions |
| 3 | * data structure and functionality definitions | ||
| 4 | */ | 3 | */ |
| 5 | 4 | ||
| 6 | #ifndef _NET_IP_VS_H | 5 | #ifndef _NET_IP_VS_H |
| @@ -12,7 +11,7 @@ | |||
| 12 | 11 | ||
| 13 | #include <linux/list.h> /* for struct list_head */ | 12 | #include <linux/list.h> /* for struct list_head */ |
| 14 | #include <linux/spinlock.h> /* for struct rwlock_t */ | 13 | #include <linux/spinlock.h> /* for struct rwlock_t */ |
| 15 | #include <linux/atomic.h> /* for struct atomic_t */ | 14 | #include <linux/atomic.h> /* for struct atomic_t */ |
| 16 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
| 17 | #include <linux/timer.h> | 16 | #include <linux/timer.h> |
| 18 | #include <linux/bug.h> | 17 | #include <linux/bug.h> |
| @@ -30,15 +29,13 @@ | |||
| 30 | #endif | 29 | #endif |
| 31 | #include <net/net_namespace.h> /* Netw namespace */ | 30 | #include <net/net_namespace.h> /* Netw namespace */ |
| 32 | 31 | ||
| 33 | /* | 32 | /* Generic access of ipvs struct */ |
| 34 | * Generic access of ipvs struct | ||
| 35 | */ | ||
| 36 | static inline struct netns_ipvs *net_ipvs(struct net* net) | 33 | static inline struct netns_ipvs *net_ipvs(struct net* net) |
| 37 | { | 34 | { |
| 38 | return net->ipvs; | 35 | return net->ipvs; |
| 39 | } | 36 | } |
| 40 | /* | 37 | |
| 41 | * Get net ptr from skb in traffic cases | 38 | /* Get net ptr from skb in traffic cases |
| 42 | * use skb_sknet when call is from userland (ioctl or netlink) | 39 | * use skb_sknet when call is from userland (ioctl or netlink) |
| 43 | */ | 40 | */ |
| 44 | static inline struct net *skb_net(const struct sk_buff *skb) | 41 | static inline struct net *skb_net(const struct sk_buff *skb) |
| @@ -90,8 +87,8 @@ static inline struct net *skb_sknet(const struct sk_buff *skb) | |||
| 90 | return &init_net; | 87 | return &init_net; |
| 91 | #endif | 88 | #endif |
| 92 | } | 89 | } |
| 93 | /* | 90 | |
| 94 | * This one needed for single_open_net since net is stored directly in | 91 | /* This one needed for single_open_net since net is stored directly in |
| 95 | * private not as a struct i.e. seq_file_net can't be used. | 92 | * private not as a struct i.e. seq_file_net can't be used. |
| 96 | */ | 93 | */ |
| 97 | static inline struct net *seq_file_single_net(struct seq_file *seq) | 94 | static inline struct net *seq_file_single_net(struct seq_file *seq) |
| @@ -108,7 +105,7 @@ extern int ip_vs_conn_tab_size; | |||
| 108 | 105 | ||
| 109 | struct ip_vs_iphdr { | 106 | struct ip_vs_iphdr { |
| 110 | __u32 len; /* IPv4 simply where L4 starts | 107 | __u32 len; /* IPv4 simply where L4 starts |
| 111 | IPv6 where L4 Transport Header starts */ | 108 | * IPv6 where L4 Transport Header starts */ |
| 112 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ | 109 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ |
| 113 | __s16 protocol; | 110 | __s16 protocol; |
| 114 | __s32 flags; | 111 | __s32 flags; |
| @@ -304,16 +301,11 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
| 304 | #define LeaveFunction(level) do {} while (0) | 301 | #define LeaveFunction(level) do {} while (0) |
| 305 | #endif | 302 | #endif |
| 306 | 303 | ||
| 307 | 304 | /* The port number of FTP service (in network order). */ | |
| 308 | /* | ||
| 309 | * The port number of FTP service (in network order). | ||
| 310 | */ | ||
| 311 | #define FTPPORT cpu_to_be16(21) | 305 | #define FTPPORT cpu_to_be16(21) |
| 312 | #define FTPDATA cpu_to_be16(20) | 306 | #define FTPDATA cpu_to_be16(20) |
| 313 | 307 | ||
| 314 | /* | 308 | /* TCP State Values */ |
| 315 | * TCP State Values | ||
| 316 | */ | ||
| 317 | enum { | 309 | enum { |
| 318 | IP_VS_TCP_S_NONE = 0, | 310 | IP_VS_TCP_S_NONE = 0, |
| 319 | IP_VS_TCP_S_ESTABLISHED, | 311 | IP_VS_TCP_S_ESTABLISHED, |
| @@ -329,25 +321,19 @@ enum { | |||
| 329 | IP_VS_TCP_S_LAST | 321 | IP_VS_TCP_S_LAST |
| 330 | }; | 322 | }; |
| 331 | 323 | ||
| 332 | /* | 324 | /* UDP State Values */ |
| 333 | * UDP State Values | ||
| 334 | */ | ||
| 335 | enum { | 325 | enum { |
| 336 | IP_VS_UDP_S_NORMAL, | 326 | IP_VS_UDP_S_NORMAL, |
| 337 | IP_VS_UDP_S_LAST, | 327 | IP_VS_UDP_S_LAST, |
| 338 | }; | 328 | }; |
| 339 | 329 | ||
| 340 | /* | 330 | /* ICMP State Values */ |
| 341 | * ICMP State Values | ||
| 342 | */ | ||
| 343 | enum { | 331 | enum { |
| 344 | IP_VS_ICMP_S_NORMAL, | 332 | IP_VS_ICMP_S_NORMAL, |
| 345 | IP_VS_ICMP_S_LAST, | 333 | IP_VS_ICMP_S_LAST, |
| 346 | }; | 334 | }; |
| 347 | 335 | ||
| 348 | /* | 336 | /* SCTP State Values */ |
| 349 | * SCTP State Values | ||
| 350 | */ | ||
| 351 | enum ip_vs_sctp_states { | 337 | enum ip_vs_sctp_states { |
| 352 | IP_VS_SCTP_S_NONE, | 338 | IP_VS_SCTP_S_NONE, |
| 353 | IP_VS_SCTP_S_INIT1, | 339 | IP_VS_SCTP_S_INIT1, |
| @@ -366,21 +352,18 @@ enum ip_vs_sctp_states { | |||
| 366 | IP_VS_SCTP_S_LAST | 352 | IP_VS_SCTP_S_LAST |
| 367 | }; | 353 | }; |
| 368 | 354 | ||
| 369 | /* | 355 | /* Delta sequence info structure |
| 370 | * Delta sequence info structure | 356 | * Each ip_vs_conn has 2 (output AND input seq. changes). |
| 371 | * Each ip_vs_conn has 2 (output AND input seq. changes). | 357 | * Only used in the VS/NAT. |
| 372 | * Only used in the VS/NAT. | ||
| 373 | */ | 358 | */ |
| 374 | struct ip_vs_seq { | 359 | struct ip_vs_seq { |
| 375 | __u32 init_seq; /* Add delta from this seq */ | 360 | __u32 init_seq; /* Add delta from this seq */ |
| 376 | __u32 delta; /* Delta in sequence numbers */ | 361 | __u32 delta; /* Delta in sequence numbers */ |
| 377 | __u32 previous_delta; /* Delta in sequence numbers | 362 | __u32 previous_delta; /* Delta in sequence numbers |
| 378 | before last resized pkt */ | 363 | * before last resized pkt */ |
| 379 | }; | 364 | }; |
| 380 | 365 | ||
| 381 | /* | 366 | /* counters per cpu */ |
| 382 | * counters per cpu | ||
| 383 | */ | ||
| 384 | struct ip_vs_counters { | 367 | struct ip_vs_counters { |
| 385 | __u32 conns; /* connections scheduled */ | 368 | __u32 conns; /* connections scheduled */ |
| 386 | __u32 inpkts; /* incoming packets */ | 369 | __u32 inpkts; /* incoming packets */ |
| @@ -388,17 +371,13 @@ struct ip_vs_counters { | |||
| 388 | __u64 inbytes; /* incoming bytes */ | 371 | __u64 inbytes; /* incoming bytes */ |
| 389 | __u64 outbytes; /* outgoing bytes */ | 372 | __u64 outbytes; /* outgoing bytes */ |
| 390 | }; | 373 | }; |
| 391 | /* | 374 | /* Stats per cpu */ |
| 392 | * Stats per cpu | ||
| 393 | */ | ||
| 394 | struct ip_vs_cpu_stats { | 375 | struct ip_vs_cpu_stats { |
| 395 | struct ip_vs_counters ustats; | 376 | struct ip_vs_counters ustats; |
| 396 | struct u64_stats_sync syncp; | 377 | struct u64_stats_sync syncp; |
| 397 | }; | 378 | }; |
| 398 | 379 | ||
| 399 | /* | 380 | /* IPVS statistics objects */ |
| 400 | * IPVS statistics objects | ||
| 401 | */ | ||
| 402 | struct ip_vs_estimator { | 381 | struct ip_vs_estimator { |
| 403 | struct list_head list; | 382 | struct list_head list; |
| 404 | 383 | ||
| @@ -491,9 +470,7 @@ struct ip_vs_protocol { | |||
| 491 | void (*timeout_change)(struct ip_vs_proto_data *pd, int flags); | 470 | void (*timeout_change)(struct ip_vs_proto_data *pd, int flags); |
| 492 | }; | 471 | }; |
| 493 | 472 | ||
| 494 | /* | 473 | /* protocol data per netns */ |
| 495 | * protocol data per netns | ||
| 496 | */ | ||
| 497 | struct ip_vs_proto_data { | 474 | struct ip_vs_proto_data { |
| 498 | struct ip_vs_proto_data *next; | 475 | struct ip_vs_proto_data *next; |
| 499 | struct ip_vs_protocol *pp; | 476 | struct ip_vs_protocol *pp; |
| @@ -520,9 +497,7 @@ struct ip_vs_conn_param { | |||
| 520 | __u8 pe_data_len; | 497 | __u8 pe_data_len; |
| 521 | }; | 498 | }; |
| 522 | 499 | ||
| 523 | /* | 500 | /* IP_VS structure allocated for each dynamically scheduled connection */ |
| 524 | * IP_VS structure allocated for each dynamically scheduled connection | ||
| 525 | */ | ||
| 526 | struct ip_vs_conn { | 501 | struct ip_vs_conn { |
| 527 | struct hlist_node c_list; /* hashed list heads */ | ||
