summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-dev-kit/include/kodi/c-api/network.h
blob: 8bd987be605abe76f68cfff47c6875eef29918eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#ifndef C_API_NETWORK_H
#define C_API_NETWORK_H

#include <stdbool.h>

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

  /*
   * For interface between add-on and kodi.
   *
   * This structure defines the addresses of functions stored inside Kodi which
   * are then available for the add-on to call
   *
   * All function pointers there are used by the C++ interface functions below.
   * You find the set of them on xbmc/addons/interfaces/General.cpp
   *
   * Note: For add-on development itself this is not needed
   */
  typedef struct AddonToKodiFuncTable_kodi_network
  {
    bool (*wake_on_lan)(void* kodiBase, const char* mac);
    char* (*get_ip_address)(void* kodiBase);
    char* (*dns_lookup)(void* kodiBase, const char* url, bool* ret);
    char* (*url_encode)(void* kodiBase, const char* url);
    char* (*get_hostname)(void* kodiBase);
    bool (*is_local_host)(void* kodiBase, const char* hostname);
    bool (*is_host_on_lan)(void* kodiBase, const char* hostname, bool offLineCheck);
    char* (*get_user_agent)(void* kodiBase);
  } AddonToKodiFuncTable_kodi_network;

#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

#endif /* C_API_NETWORK_H */