Home | History | Annotate | Download | only in layers
      1 ## This file is part of Scapy
      2 ## See http://www.secdev.org/projects/scapy for more informations
      3 ## Copyright (C) Philippe Biondi <phil (at] secdev.org>
      4 ## This program is published under a GPLv2 license
      5 
      6 """
      7 MGCP (Media Gateway Control Protocol)
      8 
      9 [RFC 2805]
     10 """
     11 
     12 from scapy.packet import *
     13 from scapy.fields import *
     14 from scapy.layers.inet import UDP
     15 
     16 class MGCP(Packet):
     17     name = "MGCP"
     18     longname = "Media Gateway Control Protocol"
     19     fields_desc = [ StrStopField("verb","AUEP"," ", -1),
     20                     StrFixedLenField("sep1"," ",1),
     21                     StrStopField("transaction_id","1234567"," ", -1),
     22                     StrFixedLenField("sep2"," ",1),
     23                     StrStopField("endpoint","dummy (at] dummy.net"," ", -1),
     24                     StrFixedLenField("sep3"," ",1),
     25                     StrStopField("version","MGCP 1.0 NCS 1.0",b"\x0a", -1),
     26                     StrFixedLenField("sep4",b"\x0a",1),
     27                     ]
     28                     
     29     
     30 #class MGCP(Packet):
     31 #    name = "MGCP"
     32 #    longname = "Media Gateway Control Protocol"
     33 #    fields_desc = [ ByteEnumField("type",0, ["request","response","others"]),
     34 #                    ByteField("code0",0),
     35 #                    ByteField("code1",0),
     36 #                    ByteField("code2",0),
     37 #                    ByteField("code3",0),
     38 #                    ByteField("code4",0),
     39 #                    IntField("trasid",0),
     40 #                    IntField("req_time",0),
     41 #                    ByteField("is_duplicate",0),
     42 #                    ByteField("req_available",0) ]
     43 #
     44 bind_layers( UDP,           MGCP,          dport=2727)
     45 bind_layers( UDP,           MGCP,          sport=2727)
     46