<html>
<head>
<title>/vobs/ttcn/TCC_Common/Libraries/TCCUsefulFunctions_CNL113472/src/TCCInterface.cc - TCCUsefulFunctions</title>
<link rel="stylesheet" type="text/css" href="../styles/main.css">
<script language=JavaScript src="../javascript/main.js"></script></head>
<body class="FramedContentPage" onLoad="NDOnLoad()">
<script language=JavaScript>
<!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content>
<div class="CFile">
<div class=CTopic id=MainTopic>
<h1 class=CTitle>
<a name="TCCInterface.cc"></a>TCCInterface.cc</h1>
<div class=CBody>
<!--START_ND_SUMMARY-->
<div class=Summary>
<div class=STitle>Summary</div>
<div class=SBorder>
<table border=0 cellspacing=0 cellpadding=0 class=STable>
<tr class="SMain">
<td class=SEntry>
<a href="#TCCInterface.cc" >TCCInterface.cc</a></td>
<td class=SDescription></td></tr>
<tr class="SGroup">
<td class=SEntry>
<a href="#Functions" >Functions</a></td>
<td class=SDescription></td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__setIP" >f__setIP</a></td>
<td class=SDescription>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)</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__deleteIP" >f__deleteIP</a></td>
<td class=SDescription>Delete IP address from a network inteface</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__getIP" >f__getIP</a></td>
<td class=SDescription>Get IP address, subnet mask and broadcast address from a network inteface</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__setInterfaceUp" >f__setInterfaceUp</a></td>
<td class=SDescription>Set up a network interface</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__setInterfaceDown" >f__setInterfaceDown</a></td>
<td class=SDescription>Set down a network interface</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f__getHostName" >f__getHostName</a></td>
<td class=SDescription>Get name of host</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f__getIpAddr" >f__getIpAddr</a></td>
<td class=SDescription>Get IP address of host</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f_setIP_ip" >f_setIP_ip</a></td>
<td class=SDescription>Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.</td></tr>
<tr class="SFunction SIndent1 SMarked">
<td class=SEntry>
<a href="#f_delIP_ip" >f_delIP_ip</a></td>
<td class=SDescription>Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.</td></tr>
<tr class="SFunction SIndent1">
<td class=SEntry>
<a href="#f_getIpAddresses" >f_getIpAddresses</a></td>
<td class=SDescription>Get both IPv4 and IPv6 addresses of the given host</td></tr></table></div></div>
<!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup">
<div class=CTopic>
<h3 class=CTitle>
<a name="Functions"></a>Functions</h3></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__setIP"></a>f__setIP</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>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)</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr>
<tr>
<td class=CDLEntry>ipaddress</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - starting IP address</td></tr>
<tr>
<td class=CDLEntry>subnetmask</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - subnetmask</td></tr>
<tr>
<td class=CDLEntry>broadcast</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - broadcast</td></tr>
<tr>
<td class=CDLEntry>number</td>
<td class=CDLDescription>
<b>in</b>
<b>integer</b> - number of interfaces to set up</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__deleteIP"></a>f__deleteIP</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Delete IP address from a network inteface</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__getIP"></a>f__getIP</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Get IP address, subnet mask and broadcast address from a network inteface</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr>
<tr>
<td class=CDLEntry>ip</td>
<td class=CDLDescription>
<b>out</b>
<b>charstring</b> - IP address</td></tr>
<tr>
<td class=CDLEntry>netmask</td>
<td class=CDLDescription>
<b>out</b>
<b>charstring</b> - netmask</td></tr>
<tr>
<td class=CDLEntry>broadcast</td>
<td class=CDLDescription>
<b>out</b>
<b>charstring</b> - broadcast</td></tr>
<tr>
<td class=CDLEntry>addressType</td>
<td class=CDLDescription>
<b>in</b>
<a href="TCCInterface_Functions-ttcn.html#TCCInterface_IPAddressType" class=LType id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">TCCInterface_IPAddressType</a> - type of IP addresses (default is IPv4)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__setInterfaceUp"></a>f__setInterfaceUp</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Set up a network interface</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr>
<tr>
<td class=CDLEntry>addressType</td>
<td class=CDLDescription>
<b>in</b>
<a href="TCCInterface_Functions-ttcn.html#TCCInterface_IPAddressType" class=LType id=link2 onMouseOver="ShowTip(event, 'tt1', 'link2')" onMouseOut="HideTip('tt1')">TCCInterface_IPAddressType</a> - type of IP addresses (default is IPv4)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__setInterfaceDown"></a>f__setInterfaceDown</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Set down a network interface</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr>
<tr>
<td class=CDLEntry>addressType</td>
<td class=CDLDescription>
<b>in</b>
<a href="TCCInterface_Functions-ttcn.html#TCCInterface_IPAddressType" class=LType id=link3 onMouseOver="ShowTip(event, 'tt1', 'link3')" onMouseOut="HideTip('tt1')">TCCInterface_IPAddressType</a> - type of IP addresses (default is IPv4)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>-</p>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__getHostName"></a>f__getHostName</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Get name of host</p>
<h4 class=CHeading>Parameters</h4>
<p>-</p>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>charstring</td>
<td class=CDLDescription>name of the host</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f__getIpAddr"></a>f__getIpAddr</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Get IP address of host</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>hostname</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - name of the host</td></tr>
<tr>
<td class=CDLEntry>addressType</td>
<td class=CDLDescription>
<b>in</b>
<a href="TCCInterface_Functions-ttcn.html#TCCInterface_IPAddressType" class=LType id=link4 onMouseOver="ShowTip(event, 'tt1', 'link4')" onMouseOut="HideTip('tt1')">TCCInterface_IPAddressType</a> - type of IP addresses (default is IPv4)</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>charstring</td>
<td class=CDLDescription>IP address of the host</td></tr></table>
<h4 class=CHeading>Errors</h4>
<p>-</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f_setIP_ip"></a>f_setIP_ip</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr>
<tr>
<td class=CDLEntry>ipaddress</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - starting IP address</td></tr>
<tr>
<td class=CDLEntry>prefix</td>
<td class=CDLDescription>
<b>in</b>
<b>integer</b> - subnetmask of the ipaddress</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>True on success, false in other cases.</p>
<h4 class=CHeading>Errors</h4>
<p>Many possibilities, all generates a TTCN_warning</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f_delIP_ip"></a>f_delIP_ip</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Set IP address, subnet mask in a network inteface Uses RTLN netlink interface on linux, which is faster than original POSIX.</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>interface</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - network interface</td></tr>
<tr>
<td class=CDLEntry>ipaddress</td>
<td class=CDLDescription>
<b>in</b>
<b>charstring</b> - starting IP address</td></tr>
<tr>
<td class=CDLEntry>prefix</td>
<td class=CDLDescription>
<b>in</b>
<b>integer</b> - subnetmask of the ipaddress</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>True on success, false in other cases.</p>
<h4 class=CHeading>Errors</h4>
<p>Many possibilities, all generates a TTCN_warning</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

<div class="CFunction">
<div class=CTopic>
<h3 class=CTitle>
<a name="f_getIpAddresses"></a>f_getIpAddresses</h3>
<div class=CBody>
<h4 class=CHeading>Purpose</h4>
<p>Get both IPv4 and IPv6 addresses of the given host</p>
<h4 class=CHeading>Parameters</h4>
<table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList>
<tr>
<td class=CDLEntry>hostname</td>
<td class=CDLDescription>
<b>charstring</b> - the hostname</td></tr></table>
<h4 class=CHeading>Return Value</h4>
<p>Initialized IPAddress structure</p>
<h4 class=CHeading>Errors</h4>
<p>Many possibilities, all generates a TTCN_warning</p>
<h4 class=CHeading>Detailed description</h4>
<p>-</p></div></div></div>

</div>
<!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1">
<div class=CType>An enum type for setting the type of IP addresses. </div></div>
<!--END_ND_TOOLTIPS-->

<script language=JavaScript>
<!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>