/////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2000-2019 Ericsson Telecom AB // // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v2.0 // which accompanies this distribution, and is available at // https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html /////////////////////////////////////////////////////////////////////////////// // // File: IPL4asp_Functions.ttcn // Reference: module IPL4asp_Functions { import from IPL4asp_Types all; import from IPL4asp_PortType all; import from TCCInterface_Functions all; function f_setUpInterface( in charstring startIPAddress, in charstring netmask, in charstring broadcast, in integer count, in charstring ifname, in integer virtualIfaceStart ) { var ro_integer startIPAddress_Record := f_splitIpAddress(startIPAddress); // var ro_integer netmask_Record := f_splitIpAddress(netmask); // var ro_integer broadcast_Record := f_splitIpAddress(broadcast); for (var integer i := virtualIfaceStart ; i < virtualIfaceStart + count; i := i + 1) { f_setIP(ifname & ":" & int2str(i), f_presentIpAddress(startIPAddress_Record), netmask, broadcast); f_nextIpAddress(startIPAddress_Record); } } // function f_setUpInterface function f_setDownInterface( in charstring ifname, in integer count, in integer virtualIfaceStart ) { for (var integer i :=virtualIfaceStart; i < virtualIfaceStart + count; i := i + 1) { f_deleteIP(ifname & ":" & int2str(i)); } } // function f_setDownInterface function f_hasColon(in charstring str) return boolean{ if (not isvalue(str)){return false}; for (var integer i:=0;i= 0; i := i - 1) { if (addr[i] < segMax) { addr[i] := addr[i] + 1; return //goto ConvertAddressDone; } else { addr[i] := 0; } } // label ConvertAddressDone; } // function f_nextAddress external function f_findIpAddressesWithDhcp ( inout IPL4asp_PT portRef, in charstring expIfName, in charstring expIfIpAddress, in charstring exclIfIpAddress, in charstring ethernetAddress, in integer leaseTime, in charstring leaseFile, in integer nOfAddresses, out ro_charstring ipAddresses, out charstring netMask, out charstring broadcastAddr, out charstring ifName ) return boolean; external function f_releaseIpAddressesFromDhcp ( inout IPL4asp_PT portRef ) return boolean; external function f_findIpAddressesWithARP ( inout IPL4asp_PT portRef, in charstring expIfName, in charstring expIfIpAddress, in charstring exclIfIpAddress, in integer nOfAddresses, out ro_charstring ipAddresses, out charstring netMask, out charstring broadcastAddr, out charstring ifName ) return boolean; external function f_findIpAddresses ( inout IPL4asp_PT portRef, out ro_charstring ipAddresses, out charstring netMask, out charstring broadcastAddr, out charstring ifName ) return boolean; } // module IPL4asp_Functions