# TCCInterface_Functions

#### Purpose

This module supports network related operations

#### Module Parameters

-

#### Module depends on

-

Summary

TCCInterface_Functions | This module supports network related operations
Enumerations |
TCCInterface_IPAddressType | An enum type for setting the type of IP addresses.
Functions |
f_setIP | Set IP address, subnet mask and broadcast address in a network inteface If number is set, a range of virtual interfaces are set up with continuous IP address (no subnet mask, broadcast checking)
f_setIP_ip | Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.
f_delIP_ip | Deletes IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.
f_deleteIP | Delete IP address from a network inteface
f_getIP | Get IP address, subnet mask and broadcast address from a network inteface
f_setInterfaceUp | Set up a network interface
f_setInterfaceDown | Set down a network interface
f_getHostName | Get name of host
f_getIpAddr | Get IP address of host
f_getIpAddresses | Get both IPv4 and IPv6 addresses of host.

### Enumerations

### TCCInterface_IPAddressType

#### Purpose

An enum type for setting the type of IP addresses. Possible values: IPv4 - for IPv4 type addresses IPv6 - for IPv6 type addresses etc

### Functions

### f_setIP

> external function f_setIP( | in | charstring | interface, |  |
> | in | charstring | ipaddress, |  |
> | in | charstring | subnetmask, |  |
> | in | charstring | broadcast, |  |
> | in integer | number | : | = | 1 | )

#### Purpose

Set IP address, subnet mask and broadcast address in a network inteface If number is set, a range of virtual interfaces are set up with continuous IP address (no subnet mask, broadcast checking)

#### Parameters

interface | in charstring - network interface
ipaddress | in charstring - starting IP address
subnetmask | in charstring - subnetmask
broadcast | in charstring - broadcast
number | in integer - number of interfaces to set up

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f_setIP_ip

> external function f_setIP_ip( | in | charstring | interface, |  |
> | in | charstring | ipaddress, |  |
> | in integer | prefix | : | = | 32,
> | in integer | v_set | : | = | 1 | ) return boolean

#### Purpose

Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.

#### Parameters

interface | in charstring - network interface
ipaddress | in charstring - starting IP address
prefix | in integer - subnetmask of the ipaddress
v_set | in integer - Determines behavior, 1 sets, other deletes the IP

#### Return Value

True on success, false in other cases.

#### Errors

Many possibilities, all generates a TTCN_warning

#### Detailed description

-

### f_delIP_ip

> external function f_delIP_ip( | in | charstring | interface, |  |
> | in | charstring | ipaddress, |  |
> | in integer | prefix | : | = | 32 | ) return boolean

#### Purpose

Deletes IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.

#### Parameters

interface | in charstring - network interface
ipaddress | in charstring - starting IP address
prefix | in integer - subnetmask of the ipaddress

#### Return Value

True on success, false in other cases.

#### Errors

Many possibilities, all generates a TTCN_warning

#### Detailed description

-

### f_deleteIP

> external function f_deleteIP( | in | charstring | interface | )

#### Purpose

Delete IP address from a network inteface

#### Parameters

interface | in charstring - network interface

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f_getIP

> external function f_getIP( | in | charstring | interface, |  |
> | out | charstring | ip, |  |
> | out | charstring | netmask, |  |
> | out | charstring | broadcast, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4 | )

#### Purpose

Get IP address, subnet mask and broadcast address from a network inteface

#### Parameters

interface | in charstring - network interface
ip | out charstring - IP address
netmask | out charstring - netmask
broadcast | out charstring - broadcast
addressType | in TCCInterface_IPAddressType - type of IP addresses (default is IPv4)

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f_setInterfaceUp

> external function f_setInterfaceUp(
> | in | charstring | interface, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4
> )

#### Purpose

Set up a network interface

#### Parameters

interface | in charstring - network interface
addressType | in TCCInterface_IPAddressType - type of IP addresses (default is IPv4)

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f_setInterfaceDown

> external function f_setInterfaceDown(
> | in | charstring | interface, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4
> )

#### Purpose

Set down a network interface

#### Parameters

interface | in charstring - network interface
addressType | in TCCInterface_IPAddressType - type of IP addresses (default is IPv4)

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f_getHostName

> external function f_getHostName() return charstring

#### Purpose

Get name of host

#### Parameters

-

#### Return Value

charstring | name of the host

#### Errors

-

#### Detailed description

-

### f_getIpAddr

> external function f_getIpAddr(
> | in | charstring | hostname, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4
> ) return charstring

#### Purpose

Get IP address of host

#### Parameters

hostname | in charstring - name of the host
addressType | in TCCInterface_IPAddressType - type of IP addresses (default is IPv4)

#### Return Value

charstring | IP address of the host

#### Errors

-

#### Detailed description

-

### f_getIpAddresses

> external function f_getIpAddresses( | in | charstring | hostname | ) return IPAddresses

#### Purpose

Get both IPv4 and IPv6 addresses of host.

#### Parameters

hostname | in charstring - name of the host

#### Return Value

Initialized IPAddresses structure

#### Errors

Drops TTCN_Warnings on fault

#### Detailed description

-

> external function f_setIP( | in | charstring | interface, |  |
> | in | charstring | ipaddress, |  |
> | in | charstring | subnetmask, |  |
> | in | charstring | broadcast, |  |
> | in integer | number | : | = | 1 | )

Set IP address, subnet mask and broadcast address in a network inteface If number is set, a range of virtual interfaces are set up with continuous IP address (no subnet mask, broadcast checking)

> external function f_setIP_ip( | in | charstring | interface, |  |
> | in | charstring | ipaddress, |  |
> | in integer | prefix | : | = | 32,
> | in integer | v_set | : | = | 1 | ) return boolean

Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.

> external function f_delIP_ip( | in | charstring | interface, |  |
> | in | charstring | ipaddress, |  |
> | in integer | prefix | : | = | 32 | ) return boolean

Deletes IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.

> external function f_deleteIP( | in | charstring | interface | )

Delete IP address from a network inteface

> external function f_getIP( | in | charstring | interface, |  |
> | out | charstring | ip, |  |
> | out | charstring | netmask, |  |
> | out | charstring | broadcast, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4 | )

Get IP address, subnet mask and broadcast address from a network inteface

> external function f_setInterfaceUp(
> | in | charstring | interface, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4
> )

Set up a network interface

> external function f_setInterfaceDown(
> | in | charstring | interface, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4
> )

Set down a network interface

> external function f_getHostName() return charstring

Get name of host

> external function f_getIpAddr(
> | in | charstring | hostname, |  |
> | in | TCCInterface_IPAddressType | addressType: | = | IPv4
> ) return charstring

Get IP address of host

> external function f_getIpAddresses( | in | charstring | hostname | ) return IPAddresses

Get both IPv4 and IPv6 addresses of host.
An enum type for setting the type of IP addresses.