RDK Documentation (Open Sourced RDK Components)
idm_client.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 /**
20  * @file idm_client.h
21  * @brief This source file contains functions that will run as task for maintaining the device list.
22  */
23 typedef struct _gwyDeviceData {
24  GString* serial_num;
25  GString* gwyipv6;
26  GString* bcastmacaddress;
27  GString* receiverid;
28  GUPnPServiceInfo* sproxy;
29  GUPnPServiceInfo* sproxy_i;
30  GString* clientip;
32 GList* xdevlist= NULL;
33 GMainContext *main_context;
34 GUPnPControlPoint *cp_bgw,*cp;
35 GString *ownSerialNo;
36 #define ACCOUNTID_SIZE 30
37 char accountId[ACCOUNTID_SIZE];
38 gboolean init_gwydata(GwyDeviceData* gwydata);
39 gboolean getserialnum(GString* ownSerialNo);
40 GUPnPContext *context,*upnpContextDeviceProtect;
41 gboolean discovery_interval_configuration(guint seconds,guint loss_detection_window);
42 static char certFile[24],keyFile[24];
43 static GMainLoop *main_loop;
44 #define MAC_ADDR_SIZE 18
45 #define IPv4_ADDR_SIZE 16
46 #define IPv6_ADDR_SIZE 128
47 #define BOOL unsigned char
48 BOOL getAccountId(char *outValue);
49 typedef struct {
50  char Ipv4[IPv4_ADDR_SIZE];
51  char Ipv6[IPv6_ADDR_SIZE];
52  char mac[MAC_ADDR_SIZE];
54 
55 unsigned int sleep_seconds=0;
56 typedef struct _discovery_config_t{
57  gchar interface[32];
58  unsigned int port;
59  unsigned int discovery_interval;
60  unsigned int loss_detection_window;
61  gchar base_mac[32];
63 
64 GMutex *mutex;
65 int (*callback)(device_info_t*,uint,uint);
66 int idm_server_start(char*interface, char * mac);
67 
68 void free_server_memory();
getserialnum
gboolean getserialnum(GString *ownSerialNo)
This function is used to get the serial number of the device from the vendor specific file.
Definition: xcal-device-library.c:227
_discovery_config_t
Definition: idm_client.h:56
_gwyDeviceData
Definition: xdiscovery_private.h:96
device_info_t
Definition: idm_client.h:49
init_gwydata
gboolean init_gwydata(GwyDeviceData *gwydata)
Initializes gateway attributes such as serial number, IP details , MAC details, URL details etc.
Definition: idm_client.c:267