1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.net.mdns.aidl;
18 
19 /**
20  * Discovery service information.
21  * This information combine all arguments that used by both request and callback.
22  * Arguments are used by request:
23  * - id
24  * - registrationType
25  * - interfaceIdx
26  *
27  * Arguments are used by callback:
28  * - id
29  * - serviceName
30  * - registrationType
31  * - domainName
32  * - interfaceIdx
33  * - netId
34  * - result
35  *
36  * {@hide}
37  */
38 @JavaOnlyImmutable
39 @JavaDerive(equals=true, toString=true)
40 parcelable DiscoveryInfo {
41     /**
42      * The operation ID.
43      * Must be unique among all operations (registration/discovery/resolution/getting address) and
44      * can't be reused.
45      * To stop a operation, it needs to use corresponding operation id.
46      */
47     int id;
48 
49     /**
50      * The discovery result.
51      */
52     int result;
53 
54     /**
55      * The discovered service name.
56      */
57     @utf8InCpp String serviceName;
58 
59     /**
60      * The service type being discovered for followed by the protocol, separated by a dot
61      * (e.g. "_ftp._tcp"). The transport protocol must be "_tcp" or "_udp".
62      */
63     @utf8InCpp String registrationType;
64 
65     /**
66      * The domain of the discovered service instance.
67      */
68     @utf8InCpp String domainName;
69 
70     /**
71      * The interface index on which to discover services. 0 indicates "all interfaces".
72      */
73     int interfaceIdx;
74 
75     /**
76      * The net id on which the service is advertised.
77      */
78     int netId;
79 }
80