Chromium Code Reviews| Index: mojo/services/public/interfaces/network/net_address.mojom |
| diff --git a/mojo/services/public/interfaces/network/net_address.mojom b/mojo/services/public/interfaces/network/net_address.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..82da48bf2f5f31cf922cb9b0a1ada89713c2a29a |
| --- /dev/null |
| +++ b/mojo/services/public/interfaces/network/net_address.mojom |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module mojo { |
| + |
| +enum NetAddressFamily { |
| + UNSPECIFIED, |
| + IPV4, |
| + IPV6 |
| +}; |
| + |
| +// 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.
|
| +struct NetAddressIPv4 { |
| + uint16 port; |
| + uint8[4] addr; |
| +}; |
| + |
| +// All members are expressed in network byte order. |
| +struct NetAddressIPv6 { |
| + uint16 port; |
| + uint8[16] addr; |
| +}; |
| + |
| +struct NetAddress { |
| + NetAddressFamily family = UNSPECIFIED; |
| + 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.
|
| + NetAddressIPv6? ipv6; |
| +}; |
| + |
| +} |
| + |