blob: ad0d96809d0218f52283d9e005577050633a5daa [file] [log] [blame]
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -08001/*
2 * Copyright (C) 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#pragma once
17
Jorge E. Moreira4b9bbb12017-12-28 15:49:06 -080018#include <memory>
19
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -080020#include "common/vsoc/lib/typed_region_view.h"
21#include "common/vsoc/shm/wifi_exchange_layout.h"
22#include "uapi/vsoc_shm.h"
23
24namespace vsoc {
25namespace wifi {
26
27class WifiExchangeView
Ryan Haining59063a92018-02-08 17:32:22 -080028 : public vsoc::TypedRegionView<
29 WifiExchangeView,
30 vsoc::layout::wifi::WifiExchangeLayout> {
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -080031 public:
32 // Send netlink packet to peer.
33 // returns true, if operation was successful.
Tomasz Wiszkowski95ee07f2017-12-04 12:52:15 -080034 intptr_t Send(const void* buffer, intptr_t length);
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -080035
36 // Receive netlink packet from peer.
37 // Returns number of bytes read, or negative value, if failed.
Tomasz Wiszkowski95ee07f2017-12-04 12:52:15 -080038 intptr_t Recv(void* buffer, intptr_t max_length);
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -080039
40 // Set guest MAC address.
41 void SetGuestMACAddress(const uint8_t* mac_address);
42 void GetGuestMACAddress(uint8_t* mac_address);
43
44 void SetConfigReady();
45 void WaitConfigReady();
Tomasz Wiszkowski719ce862017-12-01 12:31:17 -080046};
47
48} // namespace wifi
49} // namespace vsoc