1NetPacket(3) User Contributed Perl Documentation NetPacket(3)
2
3
4
6 NetPacket - assemble/disassemble network packets at the protocol level
7
9 version 1.7.2
10
12 # NetPacket is a base class only
13
15 "NetPacket" provides a base class for a cluster of modules related to
16 decoding and encoding of network protocols. Each "NetPacket"
17 descendent module knows how to encode and decode packets for the
18 network protocol it implements. Consult the documentation for the
19 module in question for protocol-specific implementation.
20
21 Note that there is no inheritance in the "NetPacket::" cluster of
22 modules other than each protocol module being a "NetPacket". This was
23 seen to be too restrictive as imposing inheritance relationships (for
24 example between the IP, UDP and TCP protocols) would make things like
25 tunneling or other unusual situations difficult.
26
28 You are encouraged to write additional "NetPacket::" modules as well as
29 improve existing ones. Contact the maintainer of the module in
30 question with your suggestions or changes.
31
32 The following sections are a list of suggestions and conventions for
33 writing a "NetPacket::" module.
34
35 Naming Conventions
36 When creating a module in the "NetPacket::" namespace, it is suggested
37 that you stick to a couple of conventions when naming packet contents.
38 This will hopefully lead to a consistent namespace making the
39 "NetPacket::" easier to use.
40
41 Content names are all lowercase, with underscores separating multiple
42 words. The following abbreviations are recommended:
43
44 Word Abbreviation
45 --------------------------------
46 source src
47 destination dest
48 checksum cksum
49 identifier id
50 version ver
51 protocol proto
52
53 Required Methods
54 encode(), decode(), strip()
55
56 Required Fields
57 Every NetPacket:: object should have the following fields.
58
59 _parent
60 A link to the parent "NetPacket::" object in which this
61 "NetPacket::" object is encaulated. This field is undefined if
62 there is no parent object.
63
64 _frame
65 A copy of the raw data of the packet.
66
67 data
68 This field should contain the data encapsulated in the packet (i.e
69 any headers or trailers stripped off) or undef if the packet
70 contains no data. Note that in this sense, "data" is taken to mean
71 information not relevant to the particular protocol being decoded.
72 For example, an ARP packet contains many header fields but no data.
73 A UDP datagram, however contains header fields and a payload.
74
76 Joel Knight has a patch for NetPacket for IPv6 support available at
77 http://www.packetmischief.ca/code/netpacket/.
78
80 Copyright (c) 2001 Tim Potter and Stephanie Wehner.
81
82 Copyright (c) 1995,1996,1997,1998,1999 ANU and CSIRO on behalf of the
83 participants in the CRC for Advanced Computational Systems ('ACSys').
84
85 This module is free software. You can redistribute it and/or modify it
86 under the terms of the Artistic License 2.0.
87
88 This program is distributed in the hope that it will be useful, but
89 without any warranty; without even the implied warranty of
90 merchantability or fitness for a particular purpose.
91
93 Tim Potter <tpot@samba.org>
94
95 Stephanie Wehner <atrak@itsx.com>
96
97 Yanick Champoux <yanick@cpan.org>
98
99
100
101perl v5.36.0 2023-01-20 NetPacket(3)