r5012 Significant part of IP-related code was rewritten for clarity, unification...
authorAlexey Andriyanov <alan@al-an.info>
Fri, 23 Mar 2012 11:28:42 +0000 (11:28 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Fri, 23 Mar 2012 11:28:42 +0000 (11:28 +0000)
commit4318ced5a1d51e7f8b2854be7337decd597863a0
tree2bf25f6f9054a67218e629ff3e4e372db071ec8f
parent9ad003fae1f5757621e7239838ca0c006d7027e8
r5012 Significant part of IP-related code was rewritten for clarity, unification and extendability.

Visible changes:
 * IP tree rendering speed has been increased
 * IP tree filtering does not affect child networks of the filtered ones
 * In "do not show IPv4 usage" mode the network usage is availible by click through AJAX
 * Each arrow aside backtrace element in IP net pages is now clickable to display IP subtree with the corresponing net as root
 * Clicking on 'IP space' link in navigation bar from within IP net page resets saved filter
 * VLAN numbers in IP tree are rendered below CIDR, no more dedicated column
 * Auto scroll-down is performed when clicking on 'expand IP tree element' button
 * Row highlight color became nicer
 * 'knights' support for IPv6
 * IP log (allocation history) support for IPv6
 * 'collapse all' link in IP tree
 * '$spare_XX' and '$aggregate' autotags for IPv6 nets
 * v4 net usage progressbar displays both allocated and unallocated spaces
 * '$vlan_XX' autotags added to ipv4net/ipv6net cells
 * IPV4_TREE_RTR_AS_CELL config variable has another state 'none'
 * '$masklen_ge_XX' and '$masklen_le_XX' autotags removed from 'ipv4net' cells
 * Object's 'IPv4' and 'IPv6' tabs were merged into single 'IP' tab

Data structures changes:
 * all binary IPs of integer, class instance types were replaced by 4- and 16-bytes binary strings
 * range list items of scanIPv4Space parameter are now keyed by 'first' and 'last' instead if 'i32_first' and 'i32_last'
 * scanIPv6Space and scanIPv6Space results are indexed by binary string IP
 * most SQL queries were cleaned of INET_NTOA and INET_ATON - now they accept and return uint32 IPs
 * 'ip' key of getIPv4AddressSearchResult result item is now binary string
 * loadIPAddrList sets 'addrlist', 'own_addrlist', 'addrc', 'own_addrc'. No more 'addrt'.
 * findRouters output: no more 'addr', but 'ip_bin' key

 ipv4net, ipv6net entities:
 * no more 'parent_id' key
 * no more 'mask_bin_inv', 'db_first', 'db_last' keys
 * 'ip_bin', 'mask_bin' keys are now binary strings, nor integers neither IPv6Address objects
 * 'child_nets' key of ip nets is renamed to 'kidc'
 * new data structure IPRange with keys 'ip', 'ip_bin', 'mask', 'mask_bin'. ipv4net and ipv6 net are descendants of it
 * 'spare_ranges' key in ipv6net

Navigation changes:
 * new 'ip' object tab instead of 'ipv4' and 'ipv6' tabs
 * instead of updIPv4Allocation, addIPv4Allocation, delIPv4Allocation,
     updIPv6Allocation, addIPv6Allocation, delIPv6Allocation on 'ipv4' and 'ipv6' object tab, ops are named 'upd', 'add', 'del'.
 * the same for 'ipaddress' page
 * no more 'ipv6address' page, it is merged with 'ipaddress'
 * 'hl_ipaddress' and 'hl_ipv6address' http params were renamed to 'hl_ip'

Changed function list (+: new function, -: deleted function, ~: function prototype changed, *: function body changed)
- IPv6Address class
~ InvalidRequestArgException class is now a descendant of InvalidArgException
+ addIPLogEntry: v4/v6 wrapper
~ addIPv4LogEntry
+ addIPv6LogEntry
~ getAllIPv4Allocations
+ amplifyAllocationList: takes a list of allocs (returned by getObjectIPAllocationList) and fills ['addrinfo'] subarray for any IP address
+ bindIPToObject: v4/v6 wrapper
- bindIpToObject: renamed to bindIPv4ToObject
+ bindIPv4ToObject: renamed from bindIpToObject
~ bindIPv6ToObject
~ commitAddFile: now returns created id
~ commitAddObject: idem
~ commitCreateUserAccount: idem
- constructIPv4Address: replaced by constructIPAddress
- constructIPv6Address: idem
* createIPv4Prefix
* createIPv6Prefix
~ deletePortForwarding
+ fetchIPLogEntry: v4/v6 wrapper
~ fetchIPv4AddressNetworkRow
~ fetchIPv6AddressNetworkRow
~ fetchIPv4LogEntry
+ fetchIPv6LogEntry
* generateEntityAutoTags
+ getIPAddress: v4/v6 wrapper
~ getIPv4Address
~ getIPv6Address
+ getIPAddressNetworkId: v4/v6 wrapper
~ getIPv4AddressNetworkId
~ getIPv6AddressNetworkId
~ getIPv4AddressSearchResult
+ getObjectIPAllocationList: merges together the results of getObjectIPv4AllocationList and getObjectIPv6AllocationList
~ getObjectIPv4AllocationList
+ getObjectIPAllocations: v4/v6 wrapper
~ getObjectIPv4Allocations
~ getObjectIPv6Allocations
~ listCells
~ newPortForwarding
- produceTagsForLastRecord: removed if favor of produceTagsForNewRecord
+ produceTagsForNewRecord: the same as produceTagsForLastRecord, but requires new item id on input, does not call lastInsertID
+ scanIPSpace: v4/v6 wrapper
~ scanIPv4Space
~ scanIPv6Space
~ spotEntity
+ spotNetworkByIP: wrapper around getIPAddressNetworkId and spotEntity
- unbindIpFromObject: renamed into unbindIPv4FromObject
+ unbindIPFromObject: v4/v6 wrapper
+ unbindIPv4FromObject: it is the renamed unbindIpFromObject
~ unbindIPv6FromObject
~ updateAddress: v4/v6 wrapper
~ updateV4Address
~ updateV6Address
- updateBond: renamed into updateIPv4Bond
+ updateIPBond: v4/v6 wrapper
+ updateIPv4Bond: renamed from updateBond
~ updateIPv6Bond
~ updatePortForwarding

+ IPNetContains: returns TRUE if first range contains second
+ IPNetContainsOrEqual: returns TRUE if first range contains or equal to second
+ IPNetworkCmp: compares two IP ranges
- IPv4NetworkCmp: removed in favor of IPNetworkCmp
- IPv6NetworkCmp: idem
~ assertIPArg: now it returns binary IP
~ assertIPv4Arg: idem
~ assertIPv6Arg: idem
- binInvMaskFromDec: removed in favor of ~ip4_mask
- binMaskFromDec: removed in favor of ip4_mask
+ constructIPAddress: replaces constructIPv4Address and constructIPv6Address
+ constructIPRange: generates IP network array by IP and mask
- countOwnIPv4Addresses: replaced by loadIPAddrList
+ fillIPNetsCorrelation: renamed from fillIPv4NetsCorrelation
- fillIPv4SpareList: removed in favor of fillIPSpareListBstr
+ fillIPSpareListBstr: replacement of fillIPv4SpareList
- fillIPv4NetsCorrelation: renamed into fillIPNetsCorrelation
* findAllEndpoints
~ findRouters
* genericAssertion
* getCellFilter
* getEmployedVlans
~ getIPAddress
+ getIPv4OwnRangeSize: does what countOwnIPv4Addresses used to, but do not call this directly.
+ ip4_bin2db: part of IP format convertation toolkit
+ ip4_bin2int: idem
+ ip4_format: idem
+ ip4_int2bin: idem
+ ip4_parse: idem
+ ip4_checkparse: idem
+ ip6_checkparse: idem
+ ip_checkparse: idem
+ ip6_format: idem
+ ip6_parse: idem
+ ip_parse: idem
+ ip_format: idem
+ ip_mask: v4/v6 wrapper
+ ip4_mask: get binary mask from prefix length
+ ip6_mask: idem
+ ip4_range_size: part of IP range calculation toolkit
+ ip4_mask_size: idem
+ ip_last: idem
+ ip_next: idem
+ ip_prev: idem
- ip_long2quad: removed
- ip_quad2long: removed
~ iptree_construct: made v4/v6 compliant
~ iptree_embed: made v4/v6 compliant
* iptree_fill: made v4/v6 compliant
- ipv6tree_construct
- ipv6tree_embed
- ipv6tree_fill
* iptree_markup_collapsion
+ isCheckSet: function to check if HTML form's checkbox is set
+ loadIPAddrList: universal function instead of loadIPv4AddrList, loadIPv6AddrList, loadOwnIPv4Addresses, loadOwnIPv6Addresses, countOwnIPv4Addresses
- loadIPv4AddrList: removed in favor of loadIPAddrList
- loadIPv6AddrList: removed in favor of loadIPAddrList
- loadOwnIPv4Addresses: removed in favor of loadIPAddrList
- loadOwnIPv6Addresses: removed in favor of loadIPAddrList
+ makeIPTree: calculate parent_id for items in netlist
+ prepareIPTree: universal function instead of prepareIPv4Tree, prepareIPv6Tree
- prepareIPv4Tree: removed in favor of prepareIPTree
- prepareIPv6Tree removed in favor of prepareIPTree
~ searchEntitiesByText
+ set_word_value: former IPv6Address class method

+ getRenderedIPNetCapacity: v4/v6 wrapper
+ getRenderedIPv4NetCapacity
+ getRenderedIPv6NetCapacity
- formatIPv6NetUsage: code has gone into getRenderedIPv6NetCapacity
* renderProgressBar: moved from interface.php to interface-lib.php
* getProgressBar: idem
* dynamic_title_decoder
~ getPageNumOfIPv6: moved
~ getRenderedAlloc
* getRenderedIPNetBacktrace
* printIPNetInfoTDs
~ printRoutersTD
* renderCell
* renderDepot
~ renderEmptyIPv6
* renderIPAddress
* renderIPAddressAllocations
+ renderIPAddressLog: new universal renderer
- renderIPv4AddressLog: removed in favor of renderIPAddressLog
* renderIPAddressProperties
+ renderIPForObject: new universal renderer
- renderIPv4ForObject: removed in favor of renderIPTabForObject
- renderIPv6ForObject: removed in favor of renderIPTabForObjectt
+ renderIPNetworkAddresses
+ renderIPSpace: new universal renderer
- renderIPv4Space: removed in favor of renderIPv4Space
- renderIPv6Space: removed in favor of renderIPv6Space
+ renderIPSpaceEditor: new universal renderer
- renderIPv4SpaceEditor: removed in favor of renderIPSpaceEditor
- renderIPv6SpaceEditor:  removed in favor of renderIPv6SpaceEditor
+ renderIPNetwork: new universal renderer
- renderIPv4Network: removed in favor of renderIPNetwork
- renderIPv6Network: removed in favor of renderIPNetwork
+ renderIPv4NetworkAddresses: v4-specific part of renderIPv4Network gone here
* renderIPv6NetworkAddresses
+ renderIPSpaceRecords: replaces renderIPv4SpaceRecords and renderIPv6SpaceRecords
- renderIPv4SpaceRecords: removed in favor of renderIPSpaceRecords
- renderIPv6SpaceRecords: removed in favor of renderIPSpaceRecords
- renderIPTabForObject: removed in favor of renderIPForObject
* renderLivePTR
* renderNATv4ForObject
+ renderNetVLAN
* renderObject
~ renderRouterCell
* renderSearchResults
~ renderSeparator
* showPathAndSearch

* addFileWithoutLink
+ addIPAllocation: new universal ophandler
- addIPv4Allocation: removed in favor or addIPAllocation
- addIPv6Allocation: removed in favor or addIPAllocation
* addIPv4Prefix
* addIPv6Prefix
* addPortForwarding
* addRack
* addRealServer
* addRealServers
* addVService
* cloneRSPool
* createUser
+ delIPAllocation: new universal ophandler
- delIPv4Allocation: removed in favor or delIPAllocation
- delIPv6Allocation: removed in favor or delIPAllocation
* delIPv4Prefix
* delIPv6Prefix
* delPortForwarding
* editAddress: universal ophandler instead of v4-only
- editv6Address: removed in favor of editAddress
* importPTRData
+ updIPAllocation: new universal ophandler
- updIPv4Allocation: removed in favor or updIPAllocation
- updIPv6Allocation: removed in favor of updIPAllocation
* updPortForwarding
* updateObject
* updateRack
* updateRealServer
* updateVService

* renderSLBTriplets
~ addRStoRSPool
* commitCreateRSPool
~ commitUpdateRS
~ commitUpdateVS
+ renderProgressBar4Image: 4-fields progress-bar renderer
+ triggerIPAddressLog: universal trigger
- triggerIPv4AddressLog: removed in favor of triggerIPAddressLog
+ trigger_ip: universal trigger
- trigger_ipv4: removed in favor of trigger_ip
- trigger_ipv6: removed in favor of trigger_ip
* trigger_natv4
* executeUpgradeBatch
19 files changed:
Makefile
wwwroot/css/pi.css
wwwroot/inc/IPv6.php [deleted file]
wwwroot/inc/ajax-interface.php
wwwroot/inc/database.php
wwwroot/inc/exceptions.php
wwwroot/inc/functions.php
wwwroot/inc/init.php
wwwroot/inc/install.php
wwwroot/inc/interface-lib.php
wwwroot/inc/interface.php
wwwroot/inc/navigation.php
wwwroot/inc/ophandlers.php
wwwroot/inc/slb-interface.php
wwwroot/inc/slb.php
wwwroot/inc/solutions.php
wwwroot/inc/triggers.php
wwwroot/inc/upgrade.php
wwwroot/index.php