/* packet-dmp.c * * Routines for STANAG 4406 Direct Message Profile packet disassembly. * A protocol for optimised transfer of time-critical short messages * for use with a reliable bearer service. Checksum and retransmission * mechanisms are activated when using unreliable bearer services. * * Copyright 2006, Stig Bjorlykke , Thales Norway AS * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Ref: http://jcs.dtic.mil/j6/cceb/acps/acp123/ */ /* * TODO: * - Dissect extended Restrictive security categories * - Add Transmission/Retransmission statistics */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "packet-p1.h" #include "packet-p22.h" #include "packet-s5066sis.h" void proto_register_dmp(void); void proto_reg_handoff_dmp(void); #define PNAME "Direct Message Profile" #define PSNAME "DMP" #define PFNAME "dmp" /* Default UDP Port Number */ #define DEFAULT_DMP_PORT_RANGE "5031" /* Protocol Identifier */ #define PROT_NAT 0x0D #define PROT_DMP 0x1D /* Versions supported */ #define DMP_VERSION_1 1 #define DMP_VERSION_2 2 /* Message Type (dmp.msg_type) */ #define STANAG 0x0 #define IPM 0x1 #define REPORT 0x2 #define NOTIF 0x3 #define ACK 0x4 /* Message Identifier Type (dmp.msg_id_type) */ #define ONLY_DMP_ID 0x0 #define X400_MSG_ID 0x1 #define NAT_MSG_ID 0x2 /* Report Type (dmp.report_type) */ #define DR 0x0 #define NDR 0x1 /* Notification Type (dmp.notif_type) */ #define RN 0x0 #define NRN 0x1 #define ON 0x2 /* Address Encoding (dmp.addr_enc) */ #define DIRECT_ADDR 0x0 #define EXTENDED_ADDR 0x1 /* Address type (internal values) */ #define ORIGINATOR 1 #define P1_ADDRESS 2 #define P2_ADDRESS 3 #define ORIG_P2_ADDRESS 4 /* Extended Address Form (dmp_addr_form) */ #define P1_DIRECT 0x0 #define P2_DIRECT 0x1 #define P1_EXTENDED 0x2 #define P2_EXTENDED 0x3 #define P1_P2_DIRECT 0x4 #define P1_DIRECT_P2_EXTENDED 0x5 #define P1_EXTENDED_P2_DIRECT 0x6 #define P1_P2_EXTENDED 0x7 /* Extended Address Type */ #define ASN1_BER 0x0 #define ASN1_PER 0x1 /* Security Policy (dmp_sec_pol) */ #define NATO 0x4 #define NATIONAL 0x5 #define EXTENDED_NATIONAL 0x6 #define EXTENDED_MISSION 0x7 #define SEC_CAT_EXT_NONE 0x0 #define SEC_CAT_EXT_PERMISSIVE 0x1 #define SEC_CAT_EXT_RESTRICTIVE 0x2 /* Body Format (dmp.body_format) */ #define FREE_TEXT 0x0 #define FREE_TEXT_SUBJECT 0x1 #define STRUCTURED 0x2 /* Encoded Information Types */ #define EIT_BILATERAL 0x3 /* Compression Algorithm */ #define ALGORITHM_NONE 0x0 #define ALGORITHM_ZLIB 0x1 /* Type of structured id to print */ #define STRUCT_ID_NONE 0 #define STRUCT_ID_UINT8 1 #define STRUCT_ID_UINT16 2 #define STRUCT_ID_UINT32 3 #define STRUCT_ID_UINT64 4 #define STRUCT_ID_STRING 5 #define STRUCT_ID_ZSTRING 6 #define NAT_DECODE_NONE 0 #define NAT_DECODE_DMP 1 #define NAT_DECODE_THALES 2 #define IPM_MODIFIER_X400 0 /* Internal values for not present and reserved time values */ #define DMP_TIME_NOT_PRESENT -1 #define DMP_TIME_RESERVED -2 #define ILLEGAL_FORMAT "" #define TIME_NOT_REPRESENTABLE "