OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [net/] [udp.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * INET         An implementation of the TCP/IP protocol suite for the LINUX
3
 *              operating system.  INET is implemented using the  BSD Socket
4
 *              interface as the means of communication with the user level.
5
 *
6
 *              Definitions for the UDP module.
7
 *
8
 * Version:     @(#)udp.h       1.0.2   05/07/93
9
 *
10
 * Authors:     Ross Biro, <bir7@leland.Stanford.Edu>
11
 *              Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
12
 *
13
 * Fixes:
14
 *              Alan Cox        : Turned on udp checksums. I don't want to
15
 *                                chase 'memory corruption' bugs that aren't!
16
 *
17
 *              This program is free software; you can redistribute it and/or
18
 *              modify it under the terms of the GNU General Public License
19
 *              as published by the Free Software Foundation; either version
20
 *              2 of the License, or (at your option) any later version.
21
 */
22
#ifndef _UDP_H
23
#define _UDP_H
24
 
25
#include <linux/udp.h>
26
#include <net/sock.h>
27
 
28
#define UDP_HTABLE_SIZE         128
29
 
30
/* udp.c: This needs to be shared by v4 and v6 because the lookup
31
 *        and hashing code needs to work with different AF's yet
32
 *        the port space is shared.
33
 */
34
extern struct sock *udp_hash[UDP_HTABLE_SIZE];
35
extern rwlock_t udp_hash_lock;
36
 
37
extern int udp_port_rover;
38
 
39
static inline int udp_lport_inuse(u16 num)
40
{
41
        struct sock *sk = udp_hash[num & (UDP_HTABLE_SIZE - 1)];
42
 
43
        for(; sk != NULL; sk = sk->next) {
44
                if(sk->num == num)
45
                        return 1;
46
        }
47
        return 0;
48
}
49
 
50
/* Note: this must match 'valbool' in sock_setsockopt */
51
#define UDP_CSUM_NOXMIT         1
52
 
53
/* Used by SunRPC/xprt layer. */
54
#define UDP_CSUM_NORCV          2
55
 
56
/* Default, as per the RFC, is to always do csums. */
57
#define UDP_CSUM_DEFAULT        0
58
 
59
extern struct proto udp_prot;
60
 
61
 
62
extern void     udp_err(struct sk_buff *, u32);
63
extern int      udp_connect(struct sock *sk,
64
                            struct sockaddr *usin, int addr_len);
65
 
66
extern int      udp_sendmsg(struct sock *sk, struct msghdr *msg, int len);
67
 
68
extern int      udp_rcv(struct sk_buff *skb);
69
extern int      udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
70
extern int      udp_disconnect(struct sock *sk, int flags);
71
 
72
extern struct udp_mib udp_statistics[NR_CPUS*2];
73
#define UDP_INC_STATS(field)            SNMP_INC_STATS(udp_statistics, field)
74
#define UDP_INC_STATS_BH(field)         SNMP_INC_STATS_BH(udp_statistics, field)
75
#define UDP_INC_STATS_USER(field)       SNMP_INC_STATS_USER(udp_statistics, field)
76
 
77
#endif  /* _UDP_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.