+#define DCCPH_CCVAL(dh) ((GET_U_1((dh)->dccph_ccval_cscov) >> 4) & 0xF)
+#define DCCPH_CSCOV(dh) (GET_U_1((dh)->dccph_ccval_cscov) & 0xF)
+
+#define DCCPH_X(dh) (GET_U_1((dh)->dccph_xtr) & 1)
+#define DCCPH_TYPE(dh) ((GET_U_1((dh)->dccph_xtr) >> 1) & 0xF)
+
+/**
+ * struct dccp_hdr_request - Connection initiation request header
+ *
+ * @dccph_req_service - Service to which the client app wants to connect
+ */
+struct dccp_hdr_request {
+ nd_uint32_t dccph_req_service;
+};
+
+/**
+ * struct dccp_hdr_response - Connection initiation response header
+ *
+ * @dccph_resp_ack - 48 bit ack number, contains GSR
+ * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
+ */
+struct dccp_hdr_response {
+ nd_uint64_t dccph_resp_ack; /* always 8 bytes, first 2 reserved */
+ nd_uint32_t dccph_resp_service;
+};
+
+/**
+ * struct dccp_hdr_reset - Unconditionally shut down a connection
+ *
+ * @dccph_resp_ack - 48 bit ack number
+ * @dccph_reset_service - Echoes the Service Code on a received DCCP-Request
+ */
+struct dccp_hdr_reset {
+ nd_uint64_t dccph_reset_ack; /* always 8 bytes, first 2 reserved */
+ nd_uint8_t dccph_reset_code;
+ nd_uint8_t dccph_reset_data1;
+ nd_uint8_t dccph_reset_data2;
+ nd_uint8_t dccph_reset_data3;
+};
+
+enum dccp_pkt_type {
+ DCCP_PKT_REQUEST = 0,
+ DCCP_PKT_RESPONSE,
+ DCCP_PKT_DATA,
+ DCCP_PKT_ACK,
+ DCCP_PKT_DATAACK,
+ DCCP_PKT_CLOSEREQ,
+ DCCP_PKT_CLOSE,
+ DCCP_PKT_RESET,
+ DCCP_PKT_SYNC,
+ DCCP_PKT_SYNCACK
+};
+
+static const struct tok dccp_pkt_type_str[] = {
+ { DCCP_PKT_REQUEST, "DCCP-Request" },
+ { DCCP_PKT_RESPONSE, "DCCP-Response" },
+ { DCCP_PKT_DATA, "DCCP-Data" },
+ { DCCP_PKT_ACK, "DCCP-Ack" },
+ { DCCP_PKT_DATAACK, "DCCP-DataAck" },
+ { DCCP_PKT_CLOSEREQ, "DCCP-CloseReq" },
+ { DCCP_PKT_CLOSE, "DCCP-Close" },
+ { DCCP_PKT_RESET, "DCCP-Reset" },
+ { DCCP_PKT_SYNC, "DCCP-Sync" },
+ { DCCP_PKT_SYNCACK, "DCCP-SyncAck" },
+ { 0, NULL}
+};
+
+enum dccp_reset_codes {
+ DCCP_RESET_CODE_UNSPECIFIED = 0,
+ DCCP_RESET_CODE_CLOSED,
+ DCCP_RESET_CODE_ABORTED,
+ DCCP_RESET_CODE_NO_CONNECTION,
+ DCCP_RESET_CODE_PACKET_ERROR,
+ DCCP_RESET_CODE_OPTION_ERROR,
+ DCCP_RESET_CODE_MANDATORY_ERROR,
+ DCCP_RESET_CODE_CONNECTION_REFUSED,
+ DCCP_RESET_CODE_BAD_SERVICE_CODE,
+ DCCP_RESET_CODE_TOO_BUSY,
+ DCCP_RESET_CODE_BAD_INIT_COOKIE,
+ DCCP_RESET_CODE_AGGRESSION_PENALTY,
+};
+
+static const struct tok dccp_reset_code_str[] = {
+ { DCCP_RESET_CODE_UNSPECIFIED, "unspecified" },
+ { DCCP_RESET_CODE_CLOSED, "closed" },
+ { DCCP_RESET_CODE_ABORTED, "aborted" },
+ { DCCP_RESET_CODE_NO_CONNECTION, "no_connection" },
+ { DCCP_RESET_CODE_PACKET_ERROR, "packet_error" },
+ { DCCP_RESET_CODE_OPTION_ERROR, "option_error" },
+ { DCCP_RESET_CODE_MANDATORY_ERROR, "mandatory_error" },
+ { DCCP_RESET_CODE_CONNECTION_REFUSED, "connection_refused" },
+ { DCCP_RESET_CODE_BAD_SERVICE_CODE, "bad_service_code" },
+ { DCCP_RESET_CODE_TOO_BUSY, "too_busy" },
+ { DCCP_RESET_CODE_BAD_INIT_COOKIE, "bad_init_cookie" },
+ { DCCP_RESET_CODE_AGGRESSION_PENALTY, "aggression_penalty" },
+ { 0, NULL }
+};
+
+static const struct tok dccp_feature_num_str[] = {
+ { 0, "reserved" },
+ { 1, "ccid" },
+ { 2, "allow_short_seqno" },
+ { 3, "sequence_window" },
+ { 4, "ecn_incapable" },
+ { 5, "ack_ratio" },
+ { 6, "send_ack_vector" },
+ { 7, "send_ndp_count" },
+ { 8, "minimum_checksum_coverage" },
+ { 9, "check_data_checksum" },
+ { 0, NULL }
+};
+
+static u_int
+dccp_csum_coverage(netdissect_options *ndo,
+ const struct dccp_hdr *dh, u_int len)