The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IO::Socket::Netlink::Generic - Object interface to NETLINK_GENERIC netlink protocol sockets

SYNOPSIS

 use IO::Socket::Netlink::Generic;

 my $genlsock = IO::Socket::Netlink::Generic->new or die "socket: $!";

 printf "TASKSTATS family ID is %d\n",
    $genlsock->get_family_by_name( "TASKSTATS" )->{id};

DESCRIPTION

This subclass of IO::Socket::Netlink implements the NETLINK_GENERIC protocol. It is itself intended to serve as a base class for particular generic families to extend.

CLASS METHODS

register_family_name

   $class->register_family_name( $name )

Must be called by a subclass implementing a particular protocol family, to declare its family name. The first time a socket in that class is constructed, this name will be looked up into an ID number.

METHODS

get_family_by_name

   $family = $sock->get_family_by_name( $name )

get_family_by_id

   $family = $sock->get_family_by_id( $id )

Query the kernel for information on the NETLINK_GENERIC family specifed by name or ID number, and return information about it. Returns a HASH reference containing the following fields:

id => NUMBER
name => STRING
version => NUMBER
hdrsize => NUMBER
maxattr => NUMBER

MESSAGE OBJECTS

Sockets in this class provide the following extra field accessors on their message objects:

  • $message->cmd

    ID number of the command to give to the family

  • $message->version

    Version number of the interface

  • $message->genlmsg

    Accessor for the trailing data buffer; intended for subclasses to use

SEE ALSO

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>