| 1 | /* $Id: upnpdev.h,v 1.6 2025/02/08 23:15:17 nanard Exp $ */ |
| 2 | /* Project : miniupnp |
| 3 | * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ |
| 4 | * Author : Thomas BERNARD |
| 5 | * copyright (c) 2005-2025 Thomas Bernard |
| 6 | * This software is subjet to the conditions detailed in the |
| 7 | * provided LICENSE file. */ |
| 8 | #ifndef UPNPDEV_H_INCLUDED |
| 9 | #define UPNPDEV_H_INCLUDED |
| 10 | |
| 11 | /*! \file upnpdev.h |
| 12 | * \brief UPNPDev device linked-list structure |
| 13 | * \todo could be merged into miniupnpc.h |
| 14 | */ |
| 15 | #include "miniupnpc_declspec.h" |
| 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | /*! |
| 22 | * \brief UPnP device linked-list |
| 23 | */ |
| 24 | struct UPNPDev { |
| 25 | /*! \brief pointer to the next element */ |
| 26 | struct UPNPDev * pNext; |
| 27 | /*! \brief root description URL */ |
| 28 | char * descURL; |
| 29 | /*! \brief ST: as advertised */ |
| 30 | char * st; |
| 31 | /*! \brief USN: as advertised */ |
| 32 | char * usn; |
| 33 | /*! \brief IPv6 scope id of the network interface */ |
| 34 | unsigned int scope_id; |
| 35 | #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L |
| 36 | /* C99 flexible array member */ |
| 37 | /*! \brief buffer for descURL, st and usn */ |
| 38 | char buffer[]; |
| 39 | #elif defined(__GNUC__) |
| 40 | char buffer[0]; |
| 41 | #else |
| 42 | /* Fallback to a hack */ |
| 43 | char buffer[1]; |
| 44 | #endif |
| 45 | }; |
| 46 | |
| 47 | /*! \brief free list returned by upnpDiscover() |
| 48 | * \param[in] devlist linked list to free |
| 49 | */ |
| 50 | MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist); |
| 51 | |
| 52 | |
| 53 | #ifdef __cplusplus |
| 54 | } |
| 55 | #endif |
| 56 | |
| 57 | |
| 58 | #endif /* UPNPDEV_H_INCLUDED */ |
| 59 | |