Merge from vendor branch OPENSSH:
[dragonfly.git] / contrib / libpcap-0.8.3 / rawss7.h
1 /* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */
2 /*
3  * Copyright (c) 2003  -        The tcpdump group.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the University nor of the Laboratory may be used
14  *    to endorse or promote products derived from this software without
15  *    specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * @(#) $Header: /tcpdump/master/libpcap/rawss7.h,v 1.1 2003/09/10 19:55:36 mcr Exp $ (LBL)
30  */
31
32 /*
33  * This file is never used in libpcap or tcpdump. It is provided as
34  * documentation linktypes 139 through 142 only.
35  */
36
37 /*
38  * Date: Tue, 09 Sep 2003 09:41:04 -0400
39  * From: Jeff Morriss <jeff.morriss[AT]ulticom.com>
40  * To: tcpdump-workers@tcpdump.org
41  * Subject: [tcpdump-workers] request for LINKTYPE_
42  *
43  * We've had some discussion over on ethereal-dev about a "fake link" or
44  * "raw SS7" dissector that allows dumping an arbitrary protocol into a
45  * file without any (otherwise necessary) lower level protocols.  The
46  * common example has been dumping MTP3 into a file without, well, MTP2 or
47  * M2PA.
48  *
49  * We want to store these protocols directly in PCAP file format because
50  * it's well defined and there isn't another (popular) file format for
51  * capturing SS7 messages that we can reverse engineer (and we want to read
52  * these files into Ethereal).  Rather than creating a new file format, it's
53  * a lot easier to just allocate a LINKTYPE_.
54  *
55  * Here is the original post thread:
56  *
57  * http://ethereal.com/lists/ethereal-dev/200306/threads.html#00200
58  *
59  * July's thread on the subject:
60  * 
61  * http://ethereal.com/lists/ethereal-dev/200307/threads.html#00124
62  *
63  * August's thread:
64  *
65  * http://ethereal.com/lists/ethereal-dev/200308/threads.html#00193
66  *
67  *
68  * and one of the last messages--which is why I'm mailing you today:
69  * 
70  * http://ethereal.com/lists/ethereal-dev/200308/msg00193.html
71  *
72  *
73  * Based on the message in the last URL, I'd like to request a new
74  * LINKTYPE_:  LINKTYPE_RAWSS7.
75  *
76  * This packets in this file type will contain a header:
77  */
78
79 typedef struct _rawss7_hdr {
80          /* NOTE: These are in network-byte order. */
81          guint32 type;
82          guint16 length;
83          guint16 spare;
84 } rawss7_hdr;
85
86 /*
87  *
88  * followed by protocol data for whatever protocol 'type' indicates.
89  *
90  * There was some discussion about these protocol 'type's being allocated by
91  * tcpdump-workers as well.  In fact it would be handy to have one place to
92  * allocate such numbers, so what do you think about allocating 3 more (for
93  * now) LINKTYPE_'s:
94  */
95
96 #define LINKTYPE_RAWSS7_MTP2    140
97 #define LINKTYPE_RAWSS7_MTP3    141
98 #define LINKTYPE_RAWSS7_SCCP    142
99
100 /*
101  *
102  *  There is no reason this can't be used to store non-SS7 protocols, but
103  *  it's what we need to use it for now...
104  *
105  */