root/net/tcp/protocols.c

/* [previous][next][first][last][top][bottom][index][help] */
   1 /* protocols.c */
   2 /* these headers are overkill, but until I clean up the socket header
   3    files, this is the best way. */
   4 
   5 #include <asm/segment.h>
   6 #include <asm/system.h>
   7 #include <linux/types.h>
   8 #include <linux/kernel.h>
   9 #include <linux/sched.h>
  10 #include <linux/string.h>
  11 #include <linux/socket.h>
  12 #include <netinet/in.h>
  13 #include "timer.h"
  14 #include "ip.h"
  15 #include "tcp.h"
  16 #include "sock.h"
  17 #include "icmp.h"
  18 
  19 int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
  20             unsigned long daddr, unsigned short len,
  21             unsigned long saddr, int redo, struct ip_protocol *protocol);
  22 
  23 void udp_err  (int err, unsigned char *header, unsigned long daddr,
  24                unsigned long saddr, struct ip_protocol *protocol);
  25 
  26 
  27 int tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
  28             unsigned long daddr, unsigned short len,
  29             unsigned long saddr, int redo, struct ip_protocol *protocol);
  30 
  31 void tcp_err  (int err, unsigned char *header, unsigned long daddr,
  32                unsigned long saddr, struct ip_protocol *protocol);
  33 
  34 int icmp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
  35              unsigned long daddr, unsigned short len,
  36              unsigned long saddr, int redo, struct ip_protocol *protocol);
  37 
  38 
  39 static struct ip_protocol tcp_protocol =
  40 {
  41    tcp_rcv,
  42    tcp_err,
  43    NULL,
  44    IP_TCP,
  45    0, /* copy */
  46    NULL
  47 };
  48 
  49 static struct ip_protocol udp_protocol =
  50 {
  51    udp_rcv,
  52    udp_err,
  53    &tcp_protocol,
  54    IP_UDP,
  55    0, /* copy */
  56    NULL
  57 };
  58 
  59 static struct ip_protocol icmp_protocol =
  60 {
  61    icmp_rcv,
  62    NULL,
  63    &udp_protocol,
  64    IP_ICMP,
  65    0, /* copy */
  66    NULL
  67 };
  68 
  69 struct ip_protocol *ip_protocol_base = &icmp_protocol;

/* [previous][next][first][last][top][bottom][index][help] */