Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: mojo/services/public/interfaces/network/net_address.mojom

Issue 612403003: Mojo UDP socket API definition review. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module mojo { 5 module mojo {
6 6
7 enum NetAddressFamily { 7 enum NetAddressFamily {
8 UNSPECIFIED, 8 UNSPECIFIED,
9 IPV4, 9 IPV4,
10 IPV6 10 IPV6
11 }; 11 };
12 12
13 // All members are expressed in network byte order, i.e., the most significant 13 // All members are expressed in network byte order, i.e., the most significant
14 // byte is stored in the smallest address. For example, if we store 127.0.0.1 in 14 // byte is stored in the smallest address. For example, if we store 127.0.0.1 in
15 // |addr|, 127 should be at index 0. 15 // |addr|, 127 should be at index 0.
16 struct NetAddressIPv4 { 16 struct NetAddressIPv4 {
17 uint16 port; 17 uint16 port;
18 uint8[4] addr; 18 uint8[4] addr;
19 }; 19 };
20 20
21 // All members are expressed in network byte order. 21 // All members are expressed in network byte order.
22 struct NetAddressIPv6 { 22 struct NetAddressIPv6 {
23 uint16 port; 23 uint16 port;
24 uint8[16] addr; 24 uint8[16] addr;
wtc 2014/10/02 02:00:51 IMPORTANT: this is missing the sin6_flowinfo and s
yzshen1 2014/10/02 19:15:27 This is the same as the Pepper API. IIRC, Ryan sug
25 }; 25 };
26 26
27 struct NetAddress { 27 struct NetAddress {
28 NetAddressFamily family = UNSPECIFIED; 28 NetAddressFamily family = UNSPECIFIED;
29
29 // At most one of the following fields is non-NULL depending on the value of 30 // At most one of the following fields is non-NULL depending on the value of
30 // |family|. 31 // |family|.
31 NetAddressIPv4? ipv4; 32 NetAddressIPv4? ipv4;
32 NetAddressIPv6? ipv6; 33 NetAddressIPv6? ipv6;
wtc 2014/10/02 02:00:51 Is this the equivalent of a C union?
yzshen1 2014/10/02 19:15:27 It is less efficient than union space-wise, but th
33 }; 34 };
34 35
35 } 36 }
36 37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698