1/* 2 * Copyright 2017 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 17package android.system.net.netd@1.0; 18 19/** 20 * This is the root of the HAL module and is the interface returned when 21 * loading an implementation of the INetd HAL. 22 */ 23interface INetd { 24 /** 25 * Return values for INetd requests 26 */ 27 enum StatusCode : int32_t { 28 OK, 29 INVALID_ARGUMENTS, 30 NO_NETWORK, 31 ALREADY_EXISTS, 32 PERMISSION_DENIED, 33 UNKNOWN_ERROR 34 }; 35 36 /** 37 * Creates a physical network to be used for interfaces managed by the OEM 38 * 39 * @return networkHandle a handle to the OEM network. Zero implies 40 * no networks are available and created 41 * @return packetMark The packet mark that vendor network stack configuration code must use when 42 * routing packets to this network. No applications may use this mark. They must 43 * instead pass the networkHandle to the android_set*network LL-NDK APIs. 44 * @return status operation status 45 */ 46 @entry 47 @callflow(next={"*"}) 48 createOemNetwork() generates (uint64_t networkHandle, uint32_t packetMark, StatusCode status); 49 50 /** 51 * Destroys the specified network previously created using createOemNetwork() 52 * 53 * @return status operation status 54 */ 55 @exit 56 @callflow(next="createOemNetwork") 57 destroyOemNetwork(uint64_t networkHandle) generates (StatusCode status); 58}; 59