|
1 | | -/* $Id: igd_desc_parse.h,v 1.12 2014/11/17 17:19:13 nanard Exp $ */ |
| 1 | +/* $Id: igd_desc_parse.h,v 1.14 2025/02/08 23:15:16 nanard Exp $ */ |
2 | 2 | /* Project : miniupnp |
3 | | - * http://miniupnp.free.fr/ |
| 3 | + * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ |
4 | 4 | * Author : Thomas Bernard |
5 | | - * Copyright (c) 2005-2014 Thomas Bernard |
| 5 | + * Copyright (c) 2005-2025 Thomas Bernard |
6 | 6 | * This software is subject to the conditions detailed in the |
7 | 7 | * LICENCE file provided in this distribution. |
8 | 8 | * */ |
9 | 9 | #ifndef IGD_DESC_PARSE_H_INCLUDED |
10 | 10 | #define IGD_DESC_PARSE_H_INCLUDED |
11 | 11 |
|
12 | | -/* Structure to store the result of the parsing of UPnP |
13 | | - * descriptions of Internet Gateway Devices */ |
| 12 | +/*! \file igd_desc_parse.h |
| 13 | + * \brief API to parse UPNP device description XML |
| 14 | + * \todo should not be exposed in the public API |
| 15 | + */ |
| 16 | + |
| 17 | +/*! \brief maximum lenght of URLs */ |
14 | 18 | #define MINIUPNPC_URL_MAXSIZE (128) |
| 19 | + |
| 20 | +/*! \brief Structure to store the result of the parsing of UPnP |
| 21 | + * descriptions of Internet Gateway Devices services */ |
15 | 22 | struct IGDdatas_service { |
| 23 | + /*! \brief controlURL for the service */ |
16 | 24 | char controlurl[MINIUPNPC_URL_MAXSIZE]; |
| 25 | + /*! \brief eventSubURL for the service */ |
17 | 26 | char eventsuburl[MINIUPNPC_URL_MAXSIZE]; |
| 27 | + /*! \brief SCPDURL for the service */ |
18 | 28 | char scpdurl[MINIUPNPC_URL_MAXSIZE]; |
| 29 | + /*! \brief serviceType */ |
19 | 30 | char servicetype[MINIUPNPC_URL_MAXSIZE]; |
20 | 31 | /*char devicetype[MINIUPNPC_URL_MAXSIZE];*/ |
21 | 32 | }; |
22 | 33 |
|
| 34 | +/*! \brief Structure to store the result of the parsing of UPnP |
| 35 | + * descriptions of Internet Gateway Devices */ |
23 | 36 | struct IGDdatas { |
| 37 | + /*! \brief current element name */ |
24 | 38 | char cureltname[MINIUPNPC_URL_MAXSIZE]; |
| 39 | + /*! \brief URLBase */ |
25 | 40 | char urlbase[MINIUPNPC_URL_MAXSIZE]; |
| 41 | + /*! \brief presentationURL */ |
26 | 42 | char presentationurl[MINIUPNPC_URL_MAXSIZE]; |
| 43 | + /*! \brief depth into the XML tree */ |
27 | 44 | int level; |
28 | | - /*int state;*/ |
29 | | - /* "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */ |
| 45 | + /*! \brief "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */ |
30 | 46 | struct IGDdatas_service CIF; |
31 | | - /* "urn:schemas-upnp-org:service:WANIPConnection:1" |
32 | | - * "urn:schemas-upnp-org:service:WANPPPConnection:1" */ |
| 47 | + /*! \brief first of "urn:schemas-upnp-org:service:WANIPConnection:1" |
| 48 | + * or "urn:schemas-upnp-org:service:WANPPPConnection:1" */ |
33 | 49 | struct IGDdatas_service first; |
34 | | - /* if both WANIPConnection and WANPPPConnection are present */ |
| 50 | + /*! \brief second of "urn:schemas-upnp-org:service:WANIPConnection:1" |
| 51 | + * or "urn:schemas-upnp-org:service:WANPPPConnection:1" */ |
35 | 52 | struct IGDdatas_service second; |
36 | | - /* "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1" */ |
| 53 | + /*! \brief "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1" */ |
37 | 54 | struct IGDdatas_service IPv6FC; |
38 | | - /* tmp */ |
| 55 | + /*! \brief currently parsed service */ |
39 | 56 | struct IGDdatas_service tmp; |
40 | 57 | }; |
41 | 58 |
|
| 59 | +/*! |
| 60 | + * \brief XML start element handler |
| 61 | + */ |
42 | 62 | void IGDstartelt(void *, const char *, int); |
| 63 | +/*! |
| 64 | + * \brief XML end element handler |
| 65 | + */ |
43 | 66 | void IGDendelt(void *, const char *, int); |
| 67 | +/*! |
| 68 | + * \brief XML characted data handler |
| 69 | + */ |
44 | 70 | void IGDdata(void *, const char *, int); |
45 | 71 | #ifdef DEBUG |
46 | 72 | void printIGD(struct IGDdatas *); |
|
0 commit comments