# TCCInterface.cc

Summary

TCCInterface.cc |
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__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_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 | Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.
f_getIpAddresses | Get both IPv4 and IPv6 addresses of the given host

### Functions

### f__setIP

#### 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__deleteIP

#### Purpose

Delete IP address from a network inteface

#### Parameters

interface | in charstring - network interface

#### Return Value

-

#### Errors

-

#### Detailed description

-

### f__getIP

#### 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

#### 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

#### 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

#### Purpose

Get name of host

#### Parameters

-

#### Return Value

charstring | name of the host

#### Errors

-

#### Detailed description

-

### f__getIpAddr

#### 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_setIP_ip

#### 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

#### Return Value

True on success, false in other cases.

#### Errors

Many possibilities, all generates a TTCN_warning

#### Detailed description

-

### f_delIP_ip

#### 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

#### Return Value

True on success, false in other cases.

#### Errors

Many possibilities, all generates a TTCN_warning

#### Detailed description

-

### f_getIpAddresses

#### Purpose

Get both IPv4 and IPv6 addresses of the given host

#### Parameters

hostname | charstring - the hostname

#### Return Value

Initialized IPAddress structure

#### Errors

Many possibilities, all generates a TTCN_warning

#### Detailed description

-

An enum type for setting the type of IP addresses.