NAME

Protocol::Sys::Virt::Devel - Helper module for Protocol::Sys::Virt and dependants

VERSION

0.0.4

SYNOPSIS

use Protocol::Sys::Virt::Devel qw(extract_all);

my $api_data = extract_all( './libvirt' );

DESCRIPTION

Given a cloned libvirt repository, this library extracts the constants and structure definitions required to build functionalities against its (XDR-based) wire protocol.

SUBROUTINES

extract_all($libvirt)

Extracts API data from the directory passed in $libvirt.

Returns a hashref with the following keys:

  • ast

    The value is a hashref with the values being the ASTs as generated by XDR::Parse for various parts of the wire protocol. The following keys

    • transport

      Taken from src/rpc/virnetprotocol.x , defines the lowest level of the protocol.

    • keepalive

      Taken from src/rpc/virkeepaliveprotocol.x , defines the keep alive "program" in the protocol. Very old clients may not support this program.

    • remote

      Taken from src/remote/remote_protocol.x , defines the remote "program" in the protocol.

  • header_syms

    An arrayref holding data of symbols (constant definitions) extracted from the public libvirt headers (and an internal header hiding some of the protocol constants).

    Each array element is a hashref with the following keys:

  • proc_entrypoints

    A hashref with the keys being the identifiers from the remote_protocol enum in the protocol definition with the values being hashes with the following keys:

    • header

      The C API header file where the entrypoint was found

    • name

      The C API entrypoint name matching the protocol procedure name

    • lineno

      The line number in the header file at which the entrypoint is defined

  • xdr_parse_version

    The value of the $XDR::Parse::VERSION dependency.

    • mod

      The name of the module which should hold the symbol as named by the sym key. This module name may be used to construct a Perl module name.

    • orig

      The original name of the symbol (as it occurs in the header file).

    • sym

      The symbol stripped from any prefixes; the name that is to be used in conjunction with the module.

    • value

      An expression defining the value of the symbol. Strings are quoted; numeric values may be expressed as (1 << 2) .

INCOMPATIBILITIES

This module has been written in Modern Perl , using function signatures, which makes the module compatible with Perl 5.36 and up.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the GitHub repository at https://github.com/ehuelsmann/perl-protocol-sys-virt-devel/issues

AUTHOR

  • Erik Huelsmann <ehuels@gmail.com>

LICENSE AND COPYRIGHT

Copyright (c) 2024, Erik Huelsmann <ehuels@gmail.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.