1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef _RAW_H
18#define _RAW_H
19
20
21#include <net/protocol.h>
22#include <linux/icmp.h>
23
24extern struct proto raw_prot;
25
26void raw_icmp_error(struct sk_buff *, int, u32);
27int raw_local_deliver(struct sk_buff *, int);
28
29int raw_rcv(struct sock *, struct sk_buff *);
30
31#define RAW_HTABLE_SIZE MAX_INET_PROTOS
32
33struct raw_hashinfo {
34 rwlock_t lock;
35 struct hlist_head ht[RAW_HTABLE_SIZE];
36};
37
38#ifdef CONFIG_PROC_FS
39int raw_proc_init(void);
40void raw_proc_exit(void);
41
42struct raw_iter_state {
43 struct seq_net_private p;
44 int bucket;
45 struct raw_hashinfo *h;
46};
47
48static inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)
49{
50 return seq->private;
51}
52void *raw_seq_start(struct seq_file *seq, loff_t *pos);
53void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
54void raw_seq_stop(struct seq_file *seq, void *v);
55int raw_seq_open(struct inode *ino, struct file *file,
56 struct raw_hashinfo *h, const struct seq_operations *ops);
57
58#endif
59
60int raw_hash_sk(struct sock *sk);
61void raw_unhash_sk(struct sock *sk);
62
63struct raw_sock {
64
65 struct inet_sock inet;
66 struct icmp_filter filter;
67 u32 ipmr_table;
68};
69
70static inline struct raw_sock *raw_sk(const struct sock *sk)
71{
72 return (struct raw_sock *)sk;
73}
74
75#endif
76