Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module mojo { | |
| 6 | |
| 7 enum NetAddressFamily { | |
| 8 UNSPECIFIED, | |
| 9 IPV4, | |
| 10 IPV6 | |
| 11 }; | |
| 12 | |
| 13 // All members are expressed in network byte order. | |
|
brettw
2014/09/29 17:49:16
Can you expand on this or give an example. Some us
yzshen1
2014/09/29 19:32:35
Done.
| |
| 14 struct NetAddressIPv4 { | |
| 15 uint16 port; | |
| 16 uint8[4] addr; | |
| 17 }; | |
| 18 | |
| 19 // All members are expressed in network byte order. | |
| 20 struct NetAddressIPv6 { | |
| 21 uint16 port; | |
| 22 uint8[16] addr; | |
| 23 }; | |
| 24 | |
| 25 struct NetAddress { | |
| 26 NetAddressFamily family = UNSPECIFIED; | |
| 27 NetAddressIPv4? ipv4; | |
|
yzshen1
2014/09/22 19:44:48
This approach has the disadvantage that whenever w
brettw
2014/09/29 17:41:22
I like the way you did it better, but it seems lik
yzshen1
2014/09/29 19:32:35
Done.
| |
| 28 NetAddressIPv6? ipv6; | |
| 29 }; | |
| 30 | |
| 31 } | |
| 32 | |
| OLD | NEW |