2 * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "tethering_dummy_client.h"
24 #define TETHERING_STR_INFO_LEN 40
28 char ip[TETHERING_STR_INFO_LEN];
29 char mac[TETHERING_STR_INFO_LEN];
32 } __tethering_client_h;
34 void tethering_mock_create_dummy_client(void **dummy_client)
36 __tethering_client_h *client = NULL;
38 client = malloc(sizeof(__tethering_client_h));
40 client->interface = 2; // wifi
41 snprintf(client->ip, TETHERING_STR_INFO_LEN - 1, "%s", "192.168.43.125");
42 snprintf(client->mac, TETHERING_STR_INFO_LEN - 1, "%s", "AB:CD:EF:AB:CD:EF");
43 client->hostname = strdup("tethering-gtest");
46 *dummy_client = (void *)client;
49 void tethering_mock_destroy_dummy_client(void *dummy_client)
51 __tethering_client_h *client = (__tethering_client_h *)dummy_client;
56 free(client->hostname);