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 */
34struct dccphdr {
38#if BYTE_ORDER == LITTLE_ENDIAN
41#endif
42#if BYTE_ORDER == BIG_ENDIAN
44 d_cscov:4;
45#endif
47#if BYTE_ORDER == LITTLE_ENDIAN
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 {
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
Definition: in.h:57
__uint8_t uint8_t
Definition: in.h:52
Definition: dccp.h:34
uint8_t d_doff
Definition: dccp.h:37
uint8_t d_type
Definition: dccp.h:49
uint8_t d_x
Definition: dccp.h:50
uint16_t d_sport
Definition: dccp.h:35
uint8_t d_ccval
Definition: dccp.h:40
union dccphdr::dccp_seqno d_seqno
uint8_t d_cscov
Definition: dccp.h:39
uint16_t d_dport
Definition: dccp.h:36
uint8_t d_res
Definition: dccp.h:48
uint8_t d_cksum[2]
Definition: dccp.h:46
uint8_t shortseq[3]
Definition: dccp.h:63
struct dccphdr::dccp_seqno::dccp_long_seqno longseq