New protocol :

MMS    Manufacturing Message Specification


svn path=/trunk/; revision=14836
This commit is contained in:
Ronnie Sahlberg 2005-07-03 06:08:53 +00:00
parent 50f4e721ce
commit 3440ba76fc
10 changed files with 13696 additions and 0 deletions

17
asn1/mms/Makefile Normal file
View File

@ -0,0 +1,17 @@
# $Id: Makefile 13071 2005-01-16 10:19:21Z guy $
DISSECTOR_FILES=packet-mms.c packet-mms.h
all: generate_dissector
generate_dissector: $(DISSECTOR_FILES)
$(DISSECTOR_FILES): ../../tools/asn2eth.py mms.asn packet-mms-template.c packet-mms-template.h mms.cnf
python ../../tools/asn2eth.py -X -b -e -p mms -c mms.cnf -s packet-mms-template mms.asn
clean:
rm -f parsetab.py $(DISSECTOR_FILES)
copy_files: generate_dissector
cp $(DISSECTOR_FILES) ../../epan/dissectors

42
asn1/mms/Makefile.nmake Normal file
View File

@ -0,0 +1,42 @@
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
# $Id: Makefile.nmake 13077 2005-01-16 23:26:02Z lroland $
include ../../config.nmake
UNIX2DOS=$(PERL) ../../tools/unix2dos.pl
PROTOCOL_NAME=mms
DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).h
all: generate_dissector
generate_dissector: $(DISSECTOR_FILES)
$(DISSECTOR_FILES): ../../tools/asn2eth.py mms.asn packet-$(PROTOCOL_NAME)-template.c packet-$(PROTOCOL_NAME)-template.h $(PROTOCOL_NAME).cnf
!IFDEF PYTHON
$(PYTHON) ../../tools/asn2eth.py -X -b -e -p $(PROTOCOL_NAME) -c $(PROTOCOL_NAME).cnf -s packet-$(PROTOCOL_NAME)-template mms.asn
!ELSE
@echo Error: You need Python to use asn2eth.py
@exit 1
!ENDIF
clean:
rm -f parsetab.py $(DISSECTOR_FILES)
# Fix EOL in generated dissectors. Cygwin's python generates files with
# mixed EOL styles, which can't be commited to the SVN repository.
# Stuff included from template and "cnf" files has "\r\n" on windows, while
# the generated stuff has "\n".
fix_eol: generate_dissector
move packet-$(PROTOCOL_NAME).c packet-$(PROTOCOL_NAME).c.tmp
move packet-$(PROTOCOL_NAME).h packet-$(PROTOCOL_NAME).h.tmp
$(UNIX2DOS) < packet-$(PROTOCOL_NAME).c.tmp > packet-$(PROTOCOL_NAME).c
$(UNIX2DOS) < packet-$(PROTOCOL_NAME).h.tmp > packet-$(PROTOCOL_NAME).h
del /f packet-$(PROTOCOL_NAME).c.tmp packet-$(PROTOCOL_NAME).h.tmp
copy_files: generate_dissector fix_eol
xcopy packet-$(PROTOCOL_NAME).c ..\..\epan\dissectors /d /y
xcopy packet-$(PROTOCOL_NAME).h ..\..\epan\dissectors /d /y

8
asn1/mms/mms-exp.cnf Normal file
View File

@ -0,0 +1,8 @@
#.IMPORT_TAG
MMSpdu BER_CLASS_CON -1/*choice*/
#.END
#.TYPE_ATTR
MMSpdu TYPE = FT_UINT32 DISPLAY = BASE_DEC STRINGS = VALS(mms_MMSpdu_vals) BITMASK = 0
#.END

2216
asn1/mms/mms.asn Normal file

File diff suppressed because it is too large Load Diff

32
asn1/mms/mms.cnf Normal file
View File

@ -0,0 +1,32 @@
# mms.cnf
# mms conformation file
# $Id: mms.cnf 12417 2004-10-27 20:34:21Z guy $
#.MODULE_IMPORT
ISO-8650-ACSE-1 acse
#.INCLUDE ../acse/acse-exp.cnf
#.EXPORTS
MMSpdu
#.PDU
#.NO_EMIT
#.TYPE_RENAME
#.FIELD_RENAME
#.FN_BODY ApplicationReference/ap-title
offset=dissect_acse_AP_title(FALSE, tvb, offset, pinfo, tree, hf_mms_ap_title);
#.FN_BODY ApplicationReference/ap-invocation-id
offset=dissect_acse_AP_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_mms_ap_invocation_id);
#.FN_BODY ApplicationReference/ae-qualifier
offset=dissect_acse_AE_qualifier(FALSE, tvb, offset, pinfo, tree, hf_mms_ae_qualifier);
#.FN_BODY ApplicationReference/ae-invocation-id
offset=dissect_acse_AE_invocation_identifier(FALSE, tvb, offset, pinfo, tree, hf_mms_ae_invocation_id);

120
asn1/mms/packet-mms-template.c Executable file
View File

@ -0,0 +1,120 @@
/* packet-mms_asn1.c
*
* Ronnie Sahlberg 2005
*
* $Id: packet-mms-template.c 13967 2005-03-29 14:56:09Z gerald $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <glib.h>
#include <epan/packet.h>
#include <epan/conversation.h>
#include <stdio.h>
#include <string.h>
#include "packet-ber.h"
#include "packet-acse.h"
#include "packet-mms.h"
#define PNAME "MMS"
#define PSNAME "MMS"
#define PFNAME "mms"
/* Initialize the protocol and registered fields */
int proto_mms = -1;
static char object_identifier_id[MAX_OID_STR_LEN];
#include "packet-mms-hf.c"
/* Initialize the subtree pointers */
static gint ett_mms = -1;
#include "packet-mms-ett.c"
#include "packet-mms-fn.c"
/*
* Dissect MMS PDUs inside a PPDU.
*/
static void
dissect_mms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
int offset = 0;
int old_offset;
proto_item *item=NULL;
proto_tree *tree=NULL;
if(parent_tree){
item = proto_tree_add_item(parent_tree, proto_mms, tvb, 0, -1, FALSE);
tree = proto_item_add_subtree(item, ett_mms);
}
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MMS");
if (check_col(pinfo->cinfo, COL_INFO))
col_clear(pinfo->cinfo, COL_INFO);
while (tvb_reported_length_remaining(tvb, offset) > 0){
old_offset=offset;
offset=dissect_mms_MMSpdu(FALSE, tvb, offset, pinfo , tree, -1);
if(offset == old_offset){
proto_tree_add_text(tree, tvb, offset, -1,"Internal error, zero-byte MMS PDU");
offset = tvb_length(tvb);
break;
}
}
}
/*--- proto_register_mms -------------------------------------------*/
void proto_register_mms(void) {
/* List of fields */
static hf_register_info hf[] =
{
#include "packet-mms-hfarr.c"
};
/* List of subtrees */
static gint *ett[] = {
&ett_mms,
#include "packet-mms-ettarr.c"
};
/* Register protocol */
proto_mms = proto_register_protocol(PNAME, PSNAME, PFNAME);
register_dissector("mms", dissect_mms, proto_mms);
/* Register fields and subtrees */
proto_register_field_array(proto_mms, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
/*--- proto_reg_handoff_mms --- */
void proto_reg_handoff_mms(void) {
register_ber_oid_dissector("1.0.9506.2.3", dissect_mms, proto_mms,
"mms");
}

View File

@ -0,0 +1,32 @@
/* packet-mms.h
* Routines for MMS packet dissection
* Ronnie Sahlberg 2005
*
* $Id: packet-mms-template.h 12573 2004-11-22 03:36:26Z sahlberg $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef PACKET_MMS_H
#define PACKET_MMS_H
#include "packet-mms-exp.h"
#endif /* PACKET_MMS_H */

View File

@ -383,6 +383,7 @@ DISSECTOR_SRC = \
packet-media.c \
packet-mip.c \
packet-mip6.c \
packet-mms.c \
packet-mms-control.c \
packet-mms-data.c \
packet-mmse.c \

11182
epan/dissectors/packet-mms.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
/* ./packet-mms.h */
/* ../../tools/asn2eth.py -X -b -e -p mms -c mms.cnf -s packet-mms-template mms.asn */
/* Input file: packet-mms-template.h */
/* packet-mms.h
* Routines for MMS packet dissection
* Ronnie Sahlberg 2005
*
* $Id: packet-mms-template.h 12573 2004-11-22 03:36:26Z sahlberg $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef PACKET_MMS_H
#define PACKET_MMS_H
/*--- Included file: packet-mms-exp.h ---*/
extern const value_string mms_MMSpdu_vals[];
int dissect_mms_MMSpdu(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index);
/*--- End of included file: packet-mms-exp.h ---*/
#endif /* PACKET_MMS_H */