home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeJava and XSLTSearch this book

8.161. Net::protoent

Returns information for an Internet protocol. Overrides the core getprotoent, getprotobyname, and getprotobynumber functions with object-oriented versions that return Net::protoent objects. The functions take a default second argument of tcp. The objects have methods that return the fields of the same name from the protoent structure in netdb.h:

Field

Description

aliases

List of aliases

name

Name of host

proto

Protocol

You can access the structure fields with the methods or by importing the fields into your namespace with the :FIELDS import tag and accessing them by prepending p_ to the field name:

$proto_obj->name( )
$p_name
getproto

getproto (protocol)

Frontend for getprotobynumber and getprotobyname. If protocol is numeric, calls getprotobynumber; otherwise, calls getprotobyname.

getprotobyname

getprotobyname (addr, addrtype)

Returns information about the host with address addr of type addrtype.

getprotobynumber

getprotobynumber (hostname)

Returns information about the host with name hostname.

getprotoent

getprotoent (protocol)

Frontend for getprotobynumber and getprotobyname. If protocol is numeric, calls getprotobynumber; otherwise, calls getprotobyname.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.