Skip to content

Commit

Permalink
improve man pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Joungkyun committed Jul 9, 2016
1 parent e62bba0 commit ff0f29c
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 78 deletions.
9 changes: 5 additions & 4 deletions man/broadcast.3
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ broadcast \- returns broadcast address with IP and network mask
.SH SYNOPSIS
.BI "#include <ipcalc.h>"
.br
.BI "char * broadcast (ulong " ip ", ulong " mask ");"
.BI "unsigned long broadcast (ulong " ip ", ulong " mask ");"

.SH DESCRIPTION
.BI broadcast
.BI boradcast
API returns broadcast address of subnet using with ip address and network mask

.SH "RETURN VALUE"
.BI "unsigned long"
format value, and on fails, returns
return
.BI "32 bit positive integer"
on success, and returns
.BI 0
on fails.

.SH EXAMPLE
.nf
Expand Down
13 changes: 7 additions & 6 deletions man/guess_netmask.3
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
.TH NETMASK 3 "09 Jul 2016"
.TH GUESS_NETMASK 3 "09 Jul 2016"

.SH NAME
guess_netmask \- convert IPv4 cidr address from Long IP
guess_netmask \- returns minimum subnet mask that include range of ip address.

.SH SYNOPSIS
.BI "#include <ipcalc.h>"
.br
.BI "char * guess_netmask (ulong " start ", ulong " end ");"
.BI "unsigned long guess_netmask (ulong " start ", ulong " end ");"

.SH DESCRIPTION
.BI guess_netmask
api is returns minimum subnet mask of subnet that includes given ip range.

.SH "RETURN VALUE"
.PP
If success, returns
.BI "unsigned long"
format value, and on fails, returns
return
.BI "32 bit positive integer"
on success, and returns
.BI 0
on fails.

.SH EXAMPLE
.nf
Expand Down
2 changes: 1 addition & 1 deletion man/ip2long.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.SH NAME
.BI ip2long
\- convert 4byte disit from IPv4 cddr address
\- convert between 32bit positive integer and IPv4 dotted address

.SH SYNOPSIS
.BI "ip2long \-[hv] <" IP " " address "|" hostname "|" long " " ip ">"
Expand Down
13 changes: 7 additions & 6 deletions man/ip2long.3
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.TH IP2LONG 3 "09 Jul 2016"

.SH NAME
ip2long \- convert IPv4 ip address to long type
ip2long \- convert IPv4 ip address to 32bit positive integer

.SH SYNOPSIS
.BI "#include <ipcalc.h>"
.br
.BI "ulong ip2long (char * " ipaddress ");"
.BI "unsigned long ip2long (char * " ipaddress ");"

.SH DESCRIPTION
.BI ip2long
Expand All @@ -15,10 +15,11 @@ dotted address into a proper address

.SH "RETURN VALUE"
.PP
If success, returns
.BI "unsigned long"
format value, and on fails, returns
return
.BI "32 bit positive integer"
on success, and returns
.BI 0
on fails.

.SH EXAMPLE
.nf
Expand All @@ -29,7 +30,7 @@ int main (void) {
ulong r;

r = ip2long (addr);
printf ("LONG IP: %ld\n", r);
printf ("LONG IP: %lu\n", r);

return 0;
}
Expand Down
14 changes: 14 additions & 0 deletions man/is_ipv4.3
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ If given value is valid, returns
.BI "0",
otherwise returns
.BI "1".
.PP
If
.BI address
is domain name,
.BI "value of address"
is changed to
.BI "IPv4 address"
, and
.BI address
is not valid address,
.BI "value of address"
is changed to
.BI NULL
.

.SH EXAMPLE
.nf
Expand Down
6 changes: 4 additions & 2 deletions man/ko/broadcast.3
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ broadcast \- IP와 network mask를 이용하여 broadcast address를 반환
.SH 사용법
.BI "#include <ipcalc.h>"
.br
.BI "char * broadcast (ulong " ip ", ulong " mask ");"
.BI "unsigned long broadcast (ulong " ip ", ulong " mask ");"

.SH 설명
.BI broadcast
API는 IP 주소와 network mask를 이용하여 IP가 포함된 subnet의 broadcast address를 반환한다.

.SH 반환값
.PP
unsigned long 형식의 IP 주소 반환하며, 실패시에
성공 시에
.BI "32bit 정수"
를 반환하며, 실패 시에
.BI 0
을 반환한다.

Expand Down
10 changes: 5 additions & 5 deletions man/ko/guess_netmask.3
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
.TH NETMASK 3 "09 Jul 2016"

.SH 이름
guess_netmask \- Long IP를 (IPv4) ip 주소로 변환
guess_netmask \- 지정한 IP 범위를 포함하는 최소의 subnet mask를 구한다.

.SH 사용법
.BI "#include <ipcalc.h>"
.br
.BI "char * guess_netmask (ulong " start ", ulong " end ");"
.BI "unsigned long:* guess_netmask (ulong " start ", ulong " end ");"

.SH 설명
.BI guess_netmask
주어진 ip range의 시작 IP와 마지막 IP를 이용하여, 이 IP가 포함된 가장 작은 subnet mask를 반환한다.

.SH 반환값
.PP
성공시에
.BI "IPv4 주소"
형식의 subnet mask long type으로 반환하며, 실패시에
성공 시에
.BI "32bit 정수"
반환하며, 실패 시에
.BI 0
을 반환한다.

Expand Down
8 changes: 5 additions & 3 deletions man/ko/ip2long.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.TH IP2LONG 1 "22 May 2010"
.SH 이름
.BI ip2long
\- IPv4 주소를 4byte 정수로 변환
\- IPv4 IP 주소와 32bit 양수간의 변환을 제공한다.
.SH 사용법
.BI "ip2long \-[hv] <" IP " " address "|" hostname "|" long " " ip ">"
.SH 설명
Expand All @@ -11,8 +11,10 @@
.PP
.SH 옵션
.IP "-v"
기본적으로 ip2long은 변환된 값만 출력을 한다. 이 옵션이 주어지면, 질의한 값과
변환된 값을 모두 출력을 한다.
기본적으로
.BI ip2long
명령은 32bit 양수 또는 IPv4 IP 주소를 반환한다. 이 옵션이 주어지면,
32bit 양수 값과 IPv4 IP 주소 값을 모두 출력한다.
.IP "-h"
ip2long의 사용법을 출력한다.
.SH 저자
Expand Down
12 changes: 6 additions & 6 deletions man/ko/ip2long.3
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ ip2long \- (IPv4) ip 주소를 Long IP로 변환
.SH 사용법
.BI "#include <ipcalc.h>"
.br
.BI "ulong ip2long (char * " ipaddress ");"
.BI "unsigned long ip2long (char * " ipaddress ");"

.SH 설명
.BI ip2long
API는 (IPv4) 인터넷 주소(ip address)를 Long IP(unsigned long type)로 변환을 한다.
API는 (IPv4) 인터넷 주소(ip address)를 Long IP(32bit 양수)로 변환을 한다.

.SH 반환값
.PP
성공시에
.BI "unsigned long"
값을 반환하며, 실패시에
성공 시에
.BI "32bit 정수"
반환하며, 실패 시에
.BI 0
을 반환한다.

Expand All @@ -29,7 +29,7 @@ int main (void) {
ulong r;

r = ip2long (addr);
printf ("LONG IP: %ld\n", r);
printf ("LONG IP: %lu\n", r);

return 0;
}
Expand Down
13 changes: 13 additions & 0 deletions man/ko/is_ipv4.3
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ argument를 도메인 이름으로 주었을 경우, 유효한 도메인일 경
.BI 1
을 반환한다.

.BI address
값이 도메인 이름일 경우,
.BI address
의 값은
.BI "IP 주소"
로 변환이 된다.
.BI address
가 유효하지 않은 값일 경우,
.BI address
값은
.BI NULL
로 설정이 된다.

.SH 예제
.nf
#include <ipcalc.h>
Expand Down
10 changes: 5 additions & 5 deletions man/ko/long2ip.3
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ long2ip \- Long IP를 (IPv4) ip 주소로 변환
.PP
.SH 설명
.BI long2ip
API는 Long IP(unsigned long type)을 (IPv4) 인터넷 주소(ip address)로 변환을 한다.
API는 Long IP(32bit 양수)을 (IPv4) 인터넷 주소(ip address)로 변환을 한다.
.PP
.BI long2ip
API는 정적으로 할당된 버퍼를 반환하기 때문에, 다음에 호출될 때 이 버퍼를
Expand Down Expand Up @@ -44,16 +44,16 @@ API의 사용법은
#include <ipcalc.h>

int main (void) {
ulong addr = 3232235521;
ulong addr = 3232235521UL;
char * ip;
char buf[16];

ip = long2ip (addr);
printf ("%s IPv4 addr: %s\\n", addr, ip);

long2ip_r (addr, buf);
printf ("%s IPv4 addr: %s\\n, addr, buf);
printf ("%s IPv4 addr: %s\\n", addr, long2ip_r (addr));
ip = long2ip_r (addr, buf);
printf ("%s IPv4 addr: %s\\n", addr, ip);
printf ("%s IPv4 addr: %s\\n", addr, buf);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion man/ko/long2prefix.3
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ short형의 10진수 prefix

int main (void) {
long mask = guess_netmask ('1.1.1.1', '1.1.1.10');
ulong r;
short r;

r = long2prefix (mask);
printf ("Network Prefix: %d\n", r);
Expand Down
19 changes: 14 additions & 5 deletions man/ko/netcalc.1
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,26 @@ network prefix를 계산한다. 명령행 인자를 네트워크가 아닌 range
.IP "-a"
-bmnp 와 동일하다. 모든 값을 출력한다.
.IP "-b"
주어진 네트워크의 broadcast를 출력한다.
주어진 네트워크의
.BI "broadcast 주소"
를 출력한다.
.IP "-m"
주어진 네트워크의 network mask를 출력한다.
주어진 네트워크의
.BI "subnet mask"
를 출력한다.
.IP "-n"
주어진 네트워크의 network를 출력한다.
주어진 네트워크의
.BI "network 주소"
를 출력한다.
.IP "-p"
주어진 네트워크의 network prefix를 출력한다.
주어진 네트워크의
.BI "CIDR(network prefix)"
을 출력한다.
.IP "-s"
쉘 변수 형식으로 출력을 한다.
.IP "-h"
netcalc의 사용법을 출력한다.
.BI netcalc
의 사용법을 출력한다.
.SH 저자
김정균
.SH 버그 리포트
Expand Down
8 changes: 5 additions & 3 deletions man/ko/network.3
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ network \- IP와 network mask를 이용하여 network address를 반환
.SH 사용법
.BI "#include <ipcalc.h>"
.br
.BI "char * network (ulong " ip ", ulong " mask ");"
.BI "unsigned long network (ulong " ip ", ulong " mask ");"

.SH 설명
.BI network
API는 IP 주소와 network mask를 이용하여 IP가 포함된 subnet의 network address를 반환한다.

.SH 반환값
.PP
unsigned long 형식의 IP 주소 반환하며, 실패시에
성공 시에
.BI "32bit 정수"
를 반환하며, 실패 시에
.BI 0
을 반환한다.

Expand Down Expand Up @@ -48,4 +50,4 @@ Copyright (c) 2016 JoungKyun.Kim <http://oops.org>
을 따르며, 사용시의 어떠한 문제에 대하여 보증하지 않는다.

.SH 참조
guess_netmask(3), broadcast(3)
broadcast(3), ip2long(3), long2ip(3)
10 changes: 5 additions & 5 deletions man/ko/prefix2long.3
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
.SH 사용법
.BI "#include <ipcalc.h>"
.br
.BI "ulong prefix2long (char * " prefix ");"
.BI "ulong prefix2long (short * " prefix ");"

.SH 설명
.BI prefix2long
API는 10진수 네트워크 prefix를 unsigned long 형으로 변환을 한다.
API는 10진수 네트워크 prefix를 32bit 양수로 변환을 한다.

.SH 반환값
.PP
성공시에
.BI "unsigned long"
값을 반환하며, 실패시에
성공 시에
.BI "32bit 정수"
반환하며, 실패 시에
.BI 0
을 반환한다.

Expand Down
Loading

0 comments on commit ff0f29c

Please sign in to comment.