IPCALC
[ class tree: IPCALC ] [ index: IPCALC ] [ all elements ]

Class: IPCALC

Source Location: /IPCALC/ipcalc.php

Class Overview

IPCALCLogic
   |
   --IPCALC

IPCALC 의 frontend Class


Methods


Inherited Methods

Class: IPCALCLogic

IPCALCLogic::broadcast()
Get long type broadcast address for given ip address and network mask
IPCALCLogic::guess_netmask()
Get long type network mask about given start and end ip address
IPCALCLogic::guess_prefix()
Get decimical network prefix about given start and end ip address
IPCALCLogic::ip2long()
Return unsigned proper address about given dotted ipv4 address
IPCALCLogic::long2prefix()
Convert long type network mask to decimical network prefix
IPCALCLogic::network()
Get long type network address for given ip address and network mask
IPCALCLogic::prefix2long()
Convert network prefix to long type network mask
IPCALCLogic::valid_ipv4_addr()
Check given adddress is valid or not

Class Details

[line 28]
IPCALC 의 frontend Class



[ Top ]


Class Methods


static method broadcast [line 142]

static string broadcast( string $ip, string $mask)

주어진 IPv4 주소와 네트워크 mask로 구성된 서브넷의 브로드캐스트 주소를 반환

  1. result ($test == '222.222.222.255');




Tags:

return:  해당 서브넷의 브로드캐스트 주소
access:  public


Overrides IPCALCLogic::broadcast() (Get long type broadcast address for given ip address and network mask)

Parameters:

string   $ip   IPv4 주소 또는 long형 주소값
string   $mask   네트워크 mask

[ Top ]

static method guess_netmask [line 175]

static string guess_netmask( string $start, string $end)

시작 주소와 마지막 주소를 포함한 서브넷의 최소 mask를 반환

  1. result ($test === '255.255.255.192');




Tags:

return:  네트워크 mask
access:  public


Overrides IPCALCLogic::guess_netmask() (Get long type network mask about given start and end ip address)

Parameters:

string   $start   범위의 시작 IPv4 주소
string   $end   범위의 마지막 IPv4 주소

[ Top ]

static method guess_prefix [line 159]

static int guess_prefix( string $start, string $end)

시작 주소와 마지막 주소를 포함한 서브넷의 prefix를 반환

  1. result ($test === 26);




Tags:

return:  네트워크 prefix
access:  public


Overrides IPCALCLogic::guess_prefix() (Get decimical network prefix about given start and end ip address)

Parameters:

string   $start   범위의 시작 IPv4 주소
string   $end   범위의 마지막 IPv4 주소

[ Top ]

static method htonl [line 192]

static binary htonl( int $v)

4 Byte unsigned 정수를 host byte order에서 network byte order로 변환

x86/x86_64 cpu에서는 little endian을 big endian으로 변환 하는 것과 동일 함




Tags:

return:  network byte order로 변환된 binary
access:  public


Parameters:

int   $v   4 Byte 양수형 정수

[ Top ]

static method ip2long [line 53]

static long ip2long( string $ip)

Dot로 구분된 IPv4 주소를 정수형 주소로 변환

PHP의 ip2long API가 singed 형이기 때문에 음수의 값이 나올 수 있어, 이 API를 제공하여 항상 양수의 값이 나올 수 있도록 지원.

  1. $dest 3739147998;
  2. $test $ip->ip2long ($src);




Tags:

return:  unsigned 형의 정수형 네트워크 주소
access:  public


Overrides IPCALCLogic::ip2long() (Return unsigned proper address about given dotted ipv4 address)

Parameters:

string   $ip   Dot로 구분된 IPv4 주소

[ Top ]

static method is_ipaddr [line 61]

static void is_ipaddr( $ip)

alias IPCALC::valid_ipv4_addr



Parameters:

   $ip  

[ Top ]

static method mask2prefix [line 106]

static int mask2prefix( string $mask)

네트워크 mask를 네트워크 prefix로 변환

  1. result ($test == 26);




Tags:

return:  네트워크 prefix
access:  public


Parameters:

string   $mask   네트워크 mask

[ Top ]

static method network [line 124]

static string network( string $ip, string $mask)

주어진 IPv4 주소와 네트워크 mask로 구성된 서브넷의 네트워크 주소를 반환

  1. result ($test == '222.222.222.192');




Tags:

return:  해당 서브넷의 네트워크 주소
access:  public


Overrides IPCALCLogic::network() (Get long type network address for given ip address and network mask)

Parameters:

string   $ip   IPv4 주소
string   $mask   네트워크 mask 또는 prefix

[ Top ]

static method ntohl [line 209]

static long ntohl( binary $v)

Network oerder byte로 구성된 4 Byte 정수 binary data를 signed 정수로 변환

x86/x86_64 cpu에서는 big endian을 little endian으로 변환 하는 것과 동일 함




Tags:

return:  4 Byte signed 정수
access:  public


Parameters:

binary   $v   Network byte order로 구성된 4Byte 정수 binary

[ Top ]

static method prefix2mask [line 90]

static string prefix2mask( integer $prefix)

네트워크 prefix를 네트워크 mask로 변환

  1. result ($test == '255.255.255.192');




Tags:

return:  네트워크 mask
access:  public


Parameters:

integer   $prefix   네트워크 prefix

[ Top ]

static method valid_ipv4_addr [line 75]

static boolean valid_ipv4_addr( string $ip)

인자로 주어진 값이 정상적인 IPv4 주소인지를 체크

  1. $test $ip->valid_ipv4_addr ('1.1.1.1 :');
  2. result ($test);




Tags:

return:  정상적인 IP일 경우 true, 그 외 false
access:  public


Overrides IPCALCLogic::valid_ipv4_addr() (Check given adddress is valid or not)

Parameters:

string   $ip   Dot로 구분된 IPv4 주소

[ Top ]

constructor __construct [line 37]

void __construct( )

Initialize IPCALC class



Tags:

access:  public


[ Top ]


Documentation generated on Tue, 14 May 2019 02:00:07 +0900 by phpDocumentor 1.4.4