---
name: "FusionInventory::Agent::Tools::Network"
section: "3pm"
platform: "linux"
package: "fusioninventory-agent"
version: "2.2.3-8"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/FusionInventory::Agent::Tools::Network"
---

# FusionInventory::Agent::Tools::Network(3pm)

Network-related patterns and functions

## NAME

FusionInventory::Agent::Tools::Network - Network-related patterns and functions

## DESCRIPTION

This module provides some network-related patterns and functions.

## PATTERNS

### mac\_address\_pattern

This pattern matches a MAC address in canonical form (aa:bb:cc:dd:ee:ff).

### ip\_address\_pattern

This pattern matches an IP address in canonical form (xyz.xyz.xyz.xyz).

### alt\_mac\_address\_pattern

This pattern matches a MAC address in alternative form (aabbccddeeff).

### hex\_ip\_address\_pattern

This pattern matches an IP address in hexadecimal form (aabbccdd).

## FUNCTIONS

### hex2canonical($address)

Convert an ip address from hexadecimal to canonical form.

### alt2canonical($address)

Convert a mac address from alternative to canonical form.

### getSubnetAddress($address, $mask)

Returns the subnet address for IPv4.

### getSubnetAddressIPv6($address, $mask)

Returns the subnet address for IPv6.

### getNetworkMask($prefix)

Returns the network mask for IPv4.

### getNetworkMaskIPv6($prefix)

Returns the network mask for IPv6.
