.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .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. | will give a .\" real vertical bar. \*(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-|\(bv\*(Tr .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" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::SAP::Packet 3" .TH Net::SAP::Packet 3 "2008-01-13" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::SAP::Packet \- A SAP Packet .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::SAP::Packet; .Ve .PP .Vb 1 \& my $packet = new Net::SAP::Packet(); .Ve .PP .Vb 3 \& $packet->type( 'advertisement' ); \& $packet->compressed( 0 ); \& $packet->payload( $sdp_data ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \f(CW\*(C`Net::SAP::Packet\*(C'\fR class represents a single \s-1SAP\s0 Packet. It provides methods for getting and setting the properties of the packet. .Sh "\s-1METHODS\s0" .IX Subsection "METHODS" .IP "\fBnew( [$binary_data] )\fR" 4 .IX Item "new( [$binary_data] )" Creates a new \f(CW\*(C`Net::SAP::Packet\*(C'\fR object with default values for all the properties. Takes an optional parameter which is passed straight to \f(CW\*(C`parse()\*(C'\fR if given. .ie n .IP "\fBparse( \fB$binary_data\fB )\fR" 4 .el .IP "\fBparse( \f(CB$binary_data\fB )\fR" 4 .IX Item "parse( $binary_data )" Parses a binary packet (as received from the network) and stores its data in the object. Returns non-zero if the binary data is invalid. .IP "\fB\f(BIgenerate()\fB\fR" 4 .IX Item "generate()" Generates a binary packet from the properties stored in the perl object. Returned undefined if there is a problem creating the packet. This method also calculates the message id hash field for the packet and compresses it if the \f(CW\*(C`compressed()\*(C'\fR field is set. .IP "\fB\f(BIorigin_address_type()\fB\fR" 4 .IX Item "origin_address_type()" Get or Set the family of the origin address (either ipv4 or ipv6). .Sp Example: .Sp .Vb 2 \& $type = $packet->origin_address_type(); \& $packet->origin_address_type( 'ipv6' ); .Ve .IP "\fB\f(BIorigin_address()\fB\fR" 4 .IX Item "origin_address()" Get or Set the origin address (IPv4 or IPv6 address of the host sending the packet). Be sure to also set the address type using \&\f(CW\*(C`origin_address_type()\*(C'\fR. .Sp Example: .Sp .Vb 2 \& $origin = $packet->origin_address(); \& $packet->origin_address( '152.78.104.83' ); .Ve .IP "\fB\f(BIcompressed()\fB\fR" 4 .IX Item "compressed()" Get or Set wether the packet was, or should be compressed. Note that the payload of the \s-1SAP\s0 packet should be no more than 1024 bytes. So compression should be used is the raw data is more than that. .Sp Example: .Sp .Vb 2 \& $compressed = $packet->compressed(); \& $packet->compressed( 1 ); .Ve .IP "\fB\f(BItype()\fB\fR" 4 .IX Item "type()" Get or Set the packet type \- advertisement or deletion. A delete packet is used to instruct clients that a previously advertised session is now no longer valid. .Sp Example: .Sp .Vb 3 \& $type = $packet->type(); \& $packet->type( 'advertisement' ); \& $packet->type( 'deletion' ); .Ve .IP "\fB\f(BIversion()\fB\fR" 4 .IX Item "version()" Get the \s-1SAP\s0 version number of a received packet. Usually 1 or 0. See the end of \s-1RFC2974\s0 for a description of the difference between packet versions. All packets created using \f(CW\*(C`Net::SAP\*(C'\fR are version 1. .IP "\fB\f(BImessage_id_hash()\fB\fR" 4 .IX Item "message_id_hash()" Get the Message \s-1ID\s0 Hash for the packet. The hash for a new packet is calculated when calling \f(CW\*(C`generate()\*(C'\fR. The hash is a 16\-bit unsigned integer (0 to 65535). .IP "\fB\f(BIencrypted()\fB\fR" 4 .IX Item "encrypted()" Gets whether a packet is encrypted or not. Note that \f(CW\*(C`Net::SAP\*(C'\fR can't currently encrypt or de-crypt packets. .IP "\fB\f(BIencryption_key_length()\fB\fR" 4 .IX Item "encryption_key_length()" Gets the length of the packet's encryption key. Note that \f(CW\*(C`Net::SAP\*(C'\fR can't currently encrypt or decrypt packets. .IP "\fB\f(BIencryption_key()\fB\fR" 4 .IX Item "encryption_key()" Gets the encryption key for a packet. Returns undefined value if there is no encryption key for the packet. Note that \f(CW\*(C`Net::SAP\*(C'\fR can't currently encrypt or de-crypt packets. .IP "\fB\f(BIpayload_type()\fB\fR" 4 .IX Item "payload_type()" Get or Set the packet's payload type. This field should be a \s-1MIME\s0 type. The default \s-1MIME\s0 type for packets is 'application/sdp'. .Sp Example: .Sp .Vb 2 \& $mime = $packet->payload_type(); \& $packet->payload_type( 'application/sdp' ); .Ve .IP "\fB\f(BIpayload()\fB\fR" 4 .IX Item "payload()" Get or Set the packet's payload. .Sp Example: .Sp .Vb 2 \& $payload = $packet->payload(); \& $packet->payload( $sdp_data ); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Net::SAP, Net::SDP, \fIperl\fR\|(1) .PP .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-net\-sap@rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you will automatically be notified of progress on your bug as I make changes. .SH "AUTHOR" .IX Header "AUTHOR" Nicholas Humfrey, njh@ecs.soton.ac.uk .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2004\-2006 University of Southampton .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.005 or, at your option, any later version of Perl 5 you may have available.