.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "NetPacket::ICMPv6 3pm" .TH NetPacket::ICMPv6 3pm "2022-11-19" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" NetPacket::ICMPv6 \- Assemble and disassemble ICMPv6 (Internet Control Message Protocol for IPv6) packets. .SH "VERSION" .IX Header "VERSION" version 1.7.2 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use NetPacket::ICMPv6; \& \& $icmpv6_obj = NetPacket::ICMPv6\->decode($raw_pkt); \& $icmpv6_pkt = NetPacket::ICMPv6\->encode($ipv6_pkt); \& $icmpv6_data = NetPacket::ICMPv6::strip($raw_pkt); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`NetPacket::ICMPv6\*(C'\fR provides a set of routines for assembling and disassembling packets using ICMPv6 (Internet Control Message Protocol for IPv6). .SS "Methods" .IX Subsection "Methods" .ie n .IP """NetPacket::ICMPv6\->decode([RAW PACKET])""" 4 .el .IP "\f(CWNetPacket::ICMPv6\->decode([RAW PACKET])\fR" 4 .IX Item "NetPacket::ICMPv6->decode([RAW PACKET])" Decode the raw packet data given and return an object containing instance data. This method will quite happily decode garbage input. It is the responsibility of the programmer to ensure valid packet data is passed to this method. .ie n .IP """NetPacket::ICMPv6\->encode($ipv6_obj)""" 4 .el .IP "\f(CWNetPacket::ICMPv6\->encode($ipv6_obj)\fR" 4 .IX Item "NetPacket::ICMPv6->encode($ipv6_obj)" Return an ICMPv6 packet encoded with the instance data specified. Needs parts of the IPv6 header contained in \f(CW$ipv6_obj\fR in order to calculate the ICMPv6 checksum. .SS "Functions" .IX Subsection "Functions" .ie n .IP """NetPacket::ICMPv6::strip([RAW PACKET])""" 4 .el .IP "\f(CWNetPacket::ICMPv6::strip([RAW PACKET])\fR" 4 .IX Item "NetPacket::ICMPv6::strip([RAW PACKET])" Return the encapsulated data (or payload) contained in the ICMPv6 packet. .SS "Instance data" .IX Subsection "Instance data" The instance data for the \f(CW\*(C`NetPacket::ICMPv6\*(C'\fR object consists of the following fields. .IP "type" 4 .IX Item "type" The ICMPv6 message type of this packet. .IP "code" 4 .IX Item "code" The ICMPv6 message code of this packet. .IP "cksum" 4 .IX Item "cksum" The checksum for this packet. .IP "data" 4 .IX Item "data" The encapsulated data (payload) for this packet. .SS "Exports" .IX Subsection "Exports" .IP "default" 4 .IX Item "default" none .IP "exportable" 4 .IX Item "exportable" ICMPv6 message types: .Sp .Vb 10 \& ICMPv6_UNREACH ICMPv6_TOOBIG ICMPv6_TIMXCEED ICMPv6_PARAMPROB \& ICMPv6_PRIVATEERROR1 ICMPv6_PRIVATEERROR2 ICMPv6_EXPANSIONERROR \& ICMPv6_ECHOREQ ICMPv6_ECHOREPLY ICMPv6_MULTICASTQUERY \& ICMPv6_MULTICASTREPORT ICMPv6_MULTICASTDONE \& ICMPv6_ROUTERSOLICIT ICMPv6_ROUTERADVERT \& ICMPv6_NEIGHBORSOLICIT ICMPv6_NEIGHBORADVERT \& ICMPv6_REDIRECT ICMPv6_ROUTERRENUMBER \& ICMPv6_NODEINFOQUERY ICMPv6_NODEINFOREPLY \& ICMPv6_INVNEIGHBORSOLICIT ICMPv6_INVNEIGHBORADVERT \& ICMPv6_MULTICASTREPORTV2 \& ICMPv6_HOMEAGENTREQUEST ICMPv6_HOMEAGENTREPLY \& ICMPv6_MOBILEPREFIXSOLICIT ICMPv6_MOBILEPREFIXADVERT \& ICMPv6_CERTPATHSOLICIT ICMPv6_CERTPATHADVERT \& ICMPv6_MULTICASTADVERT ICMPv6_MULTICASTSOLICIT \& ICMPv6_MULTICASTTERM ICMPv6_FMIPv6 ICMPv6_RPLCONTROL \& ICMPv6_DUPREQUEST ICMPv6_DUPCONFIRM ICMPv6_MPLCONTROL \& ICMPv6_EXTECHOREQ ICMPv6_EXTECHOREPLY \& ICMPv6_PRIVATEINFO1 ICMPv6_PRIVATEINFO2 ICMPv6_EXPANSIONINFO .Ve .Sp ICMPv6 message codes: .Sp .Vb 10 \& ICMPv6_UNREACH_NO_ROUTE ICMPv6_UNREACH_COMM_PROHIB \& ICMPv6_UNREACH_BEYOND_SCOPE ICMPv6_UNREACH_ADDRESS ICMPv6_UNREACH_PORT \& ICMPv6_UNREACH_SRC_FAIL_POLICY ICMPv6_UNREACH_REJECT_DEST \& ICMPv6_TIMXCEED_INTRANS ICMPv6_TIMXCEED_REASS \& ICMPv6_PARAMPROB_HEADER_FIELD ICMPv6_PARAMPROB_NEXT_HEADER \& ICMPv6_PARAMPROB_OPTION \& ICMPv6_ROUTERRENUMBER_COMMAND ICMPv6_ROUTERRENUMBER_RESULT \& ICMPv6_ROUTERRENUMBER_RESET \& ICMPv6_NODEINFOQUERY_IPv6 ICMPv6_NODEINFOQUERY_NAME \& ICMPv6_NODEINFOQUERY_IPv4 ICMPv6_NODEINFOREPLY_SUCCESS \& ICMPv6_NODEINFOREPLY_REFUSED ICMPv6_NODEINFOREPLY_UNKNOWN \& ICMPv6_RPLCONTROL_DODAG_SOLICIT ICMPv6_RPLCONTROL_DODAG_OBJECT \& ICMPv6_RPLCONTROL_DEST_ADVERT ICMPv6_RPLCONTROL_DEST_ACK \& ICMPv6_RPLCONTROL_SECURE_DODAG_SOLICIT ICMPv6_RPLCONTROL_SECURE_DODAG_OBJECT \& ICMPv6_RPLCONTROL_SECURE_DEST_ADVERT ICMPv6_RPLCONTROL_SECURE_DEST_ACK \& ICMPv6_RPLCONTROL_CONSISTENCY \& ICMPv6_EXTECHOREPLY_NO_ERROR ICMPv6_EXTECHOREPLY_MALFORMED \& ICMPv6_EXTECHOREPLY_NO_INTERFACE ICMPv6_EXTECHOREPLY_NO_ENTRY \& ICMPv6_EXTECHOREPLY_MULTIPLE .Ve .IP "tags" 4 .IX Item "tags" The following tags group together related exportable items. .RS 4 .ie n .IP """:types""" 4 .el .IP "\f(CW:types\fR" 4 .IX Item ":types" .PD 0 .ie n .IP """:codes""" 4 .el .IP "\f(CW:codes\fR" 4 .IX Item ":codes" .ie n .IP """:strip""" 4 .el .IP "\f(CW:strip\fR" 4 .IX Item ":strip" .PD Import the strip function \f(CW\*(C`icmpv6_strip\*(C'\fR. .ie n .IP """:ALL""" 4 .el .IP "\f(CW:ALL\fR" 4 .IX Item ":ALL" All the above exportable items. .RE .RS 4 .RE .SH "EXAMPLE" .IX Header "EXAMPLE" The following example prints the ICMPv6 type, code, and checksum fields. .PP .Vb 1 \& #!/usr/bin/perl \& \& use strict; \& use warnings; \& use Net::PcapUtils; \& use NetPacket::Ethernet qw(:strip); \& use NetPacket::IPv6 qw(:strip); \& use NetPacket::ICMPv6; \& \& sub process_pkt { \& my ($user, $hdr, $pkt) = @_; \& \& my $icmpv6_obj = NetPacket::ICMPv6\->decode(ipv6_strip(eth_strip($pkt))); \& \& print("Type: $icmpv6_obj\->{type}\en"); \& print("Code: $icmpv6_obj\->{code}\en"); \& print("Checksum: $icmpv6_obj\->{cksum}\en\en"); \& } \& \& Net::PcapUtils::loop(\e&process_pkt, FILTER => \*(Aqicmp6\*(Aq); .Ve .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2018 Dan Book. .PP This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0. .PP 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. .SH "AUTHOR" .IX Header "AUTHOR" Dan Book