Sha256: 94eda76bcc1cd4fd13949159e345e763f3a35707ce155ea3329d5fc474be79ed

Contents?: true

Size: 1.72 KB

Versions: 14

Compression:

Stored size: 1.72 KB

Contents

/**
 * @file
 * Declares the FreeBSD networking fact resolver.
 */
#pragma once

#include "../bsd/networking_resolver.hpp"
#include <map>
#include <ifaddrs.h>

namespace facter { namespace facts { namespace freebsd {

    /**
     * Responsible for resolving networking facts.
     */
    struct networking_resolver : bsd::networking_resolver
    {
     protected:
        /**
         * Gets the MTU of the link layer data.
         * @param interface The name of the link layer interface.
         * @param data The data pointer from the link layer interface.
         * @return Returns The MTU of the interface.
         */
        virtual boost::optional<uint64_t> get_link_mtu(std::string const& interface, void* data) const override;

        /**
         * Determines if the given sock address is a link layer address.
         * @param addr The socket address to check.
         * @returns Returns true if the socket address is a link layer address or false if it is not.
         */
        virtual bool is_link_address(sockaddr const* addr) const override;

        /**
         * Gets the bytes of the link address.
         * @param addr The socket address representing the link address.
         * @return Returns a pointer to the address bytes or nullptr if not a link address.
         */
        virtual uint8_t const* get_link_address_bytes(sockaddr const* addr) const override;

        /**
         * Gets the length of the link address.
         * @param addr The socket address representing the link address.
         * @return Returns the length of the address or 0 if not a link address.
         */
        virtual uint8_t get_link_address_length(sockaddr const* addr) const override;
    };

}}}  // namespace facter::facts::freebsd

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.12.1.cfacter.20181031 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.11.6.cfacter.20181031 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.12.1.cfacter.20181023 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.11.5.cfacter.20181022 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.12.0.cfacter.20181004 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.12.0.cfacter.20181001 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.12.0.cfacter.20180918 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.11.4.cfacter.20180821 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.11.3.cfacter.20180716 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.11.2.cfacter.20180612 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.9.6.cfacter.20180612 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.11.2.cfacter.20180606 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp
facter-3.9.6.cfacter.20180606 ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp