Skip to content

Commit

Permalink
update net.IPv4.md IPv4Mask.md
Browse files Browse the repository at this point in the history
精简示例;
修正函数输出;
改正对A类地址、B类地址等的错误引用;
A类地址范围:0.0.0.0到127.255.255.255
B类地址范围:128.0.0.0到191.255.255.255
C类地址范围:192.0.0.1到223.255.255.255
D类地址范围:224.0.0.0到239.255.255.255
  • Loading branch information
lomoalbert committed Jul 19, 2014
1 parent 9b0f81e commit 9cb3856
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions net/IPv4Mask.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

参数列表:

- a a类网络地址
- b b类网络地址
- c c类网络地址
- d d类网络地址
- a IP掩码的第1个字节
- b IP掩码的第2个字节
- c IP掩码的第3个字节
- d IP掩码的第4个字节

返回列表:

- IPMask 掩码

查找特定网络的端口和服务
函数功能

- 生成IP掩码的字节列表

代码实例:

Expand All @@ -21,6 +23,10 @@
import "net"

func main() {
mask := net.IPv4Mask(byte(127),byte(127),byte(127),byte(127))
fmt.Printf("%#v",mask) //返回 []byte{0x7f, 0x7f, 0x7f, 0x7f}
mask := net.IPv4Mask(127, 127, 127, 127)
fmt.Printf("%#v",mask)
}

代码输出:

net.IPMask{0x7f, 0x7f, 0x7f, 0x7f}
2 changes: 1 addition & 1 deletion net/ParseMAC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

参数列表:

- s 符合 IEEE 802 MAC-48, EUI-48 或 EUI-64 标准的MAC地址字符串。支持一下格式
- s 符合 IEEE 802 MAC-48, EUI-48 或 EUI-64 标准的MAC地址字符串。支持以下格式
- 01:23:45:67:89:ab
- 01:23:45:67:89:ab:cd:ef
- 01-23-45-67-89-ab
Expand Down

0 comments on commit 9cb3856

Please sign in to comment.