FreeBSD kernel IPv4 code
dccp.h
Go to the documentation of this file.
1
/*-
2
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3
*
4
* Copyright (c) 2019 Tom Jones <thj@freebsd.org>
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions
8
* are met:
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
* 2. Redistributions in binary form must reproduce the above copyright
12
* notice, this list of conditions and the following disclaimer in the
13
* documentation and/or other materials provided with the distribution.
14
*
15
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25
* SUCH DAMAGE.
26
*
27
* $FreeBSD$
28
*/
29
30
#ifndef _NETINET_DCCP_H_
31
#define _NETINET_DCCP_H_
32
33
/* DCCP protocol header as per RFC4340 */
34
struct
dccphdr
{
35
uint16_t
d_sport
;
36
uint16_t
d_dport
;
37
uint8_t
d_doff
;
38
#if BYTE_ORDER == LITTLE_ENDIAN
39
uint8_t
d_cscov
:4,
40
d_ccval
:4;
41
#endif
42
#if BYTE_ORDER == BIG_ENDIAN
43
uint8_t
d_ccval
:4,
44
d_cscov
:4;
45
#endif
46
uint8_t
d_cksum
[2];
47
#if BYTE_ORDER == LITTLE_ENDIAN
48
uint8_t
d_res
:3,
49
d_type
:4,
50
d_x
:1;
51
#endif
52
#if BYTE_ORDER == BIG_ENDIAN
53
uint8_t
d_x
:1,
54
d_type
:4,
55
d_res
:3;
56
#endif
57
/*
58
* Provide enough space for both the short (24 bit) sequence number and
59
* the long (48 bit) sequene number and a leading reserved byte in
60
* front of the long sequence number.
61
*/
62
union
dccp_seqno
{
63
uint8_t
shortseq
[3];
64
struct
dccp_long_seqno
{
65
uint8_t
res
;
66
uint8_t
seq
[6];
67
}
longseq
;
68
}
d_seqno
;
69
};
70
71
#define d_seqno_short d_seqno.shortseq;
72
#define d_seqno_long d_seqno.longseq.seq;
73
74
#define DCCP_SHORTHDR 12
75
#define DCCP_LONGHDR 16
76
#define DCCP_EXTHDR 0x80
77
78
#endif
/* _NETINET_DCCP_H */
uint16_t
__uint16_t uint16_t
Definition:
in.h:57
uint8_t
__uint8_t uint8_t
Definition:
in.h:52
dccphdr::dccp_seqno::dccp_long_seqno
Definition:
dccp.h:64
dccphdr::dccp_seqno::dccp_long_seqno::seq
uint8_t seq[6]
Definition:
dccp.h:66
dccphdr::dccp_seqno::dccp_long_seqno::res
uint8_t res
Definition:
dccp.h:65
dccphdr
Definition:
dccp.h:34
dccphdr::d_doff
uint8_t d_doff
Definition:
dccp.h:37
dccphdr::d_type
uint8_t d_type
Definition:
dccp.h:49
dccphdr::d_x
uint8_t d_x
Definition:
dccp.h:50
dccphdr::d_sport
uint16_t d_sport
Definition:
dccp.h:35
dccphdr::d_ccval
uint8_t d_ccval
Definition:
dccp.h:40
dccphdr::d_seqno
union dccphdr::dccp_seqno d_seqno
dccphdr::d_cscov
uint8_t d_cscov
Definition:
dccp.h:39
dccphdr::d_dport
uint16_t d_dport
Definition:
dccp.h:36
dccphdr::d_res
uint8_t d_res
Definition:
dccp.h:48
dccphdr::d_cksum
uint8_t d_cksum[2]
Definition:
dccp.h:46
dccphdr::dccp_seqno
Definition:
dccp.h:62
dccphdr::dccp_seqno::shortseq
uint8_t shortseq[3]
Definition:
dccp.h:63
dccphdr::dccp_seqno::longseq
struct dccphdr::dccp_seqno::dccp_long_seqno longseq
netinet
dccp.h
Generated by
1.9.3