1 /* 2 * Copyright (C) 2020 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 #ifndef CHPP_LOOPBACK_H_ 18 #define CHPP_LOOPBACK_H_ 19 20 #include <stdbool.h> 21 #include <stddef.h> 22 #include <stdint.h> 23 24 #include "chpp/app.h" 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 /************************************************ 31 * Public Definitions 32 ***********************************************/ 33 34 /************************************************ 35 * Public functions 36 ***********************************************/ 37 38 /* 39 * Processes an client request Rx datagram from the transport layer that is 40 * determined to be for the CHPP Loopback Service. 41 * 42 * @param context Maintains status for each app layer instance. 43 * @param buf Input data. Cannot be null. 44 * @param len Length of input data in bytes. 45 */ 46 bool chppDispatchLoopbackClientRequest(struct ChppAppState *context, 47 uint8_t *buf, size_t len); 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif // CHPP_LOOPBACK_H_ 54