Annotation of embedaddon/miniupnpd/upnpdescgen.h, revision 1.1.1.1
1.1 misho 1: /* $Id: upnpdescgen.h,v 1.18 2008/03/06 18:09:10 nanard Exp $ */
2: /* MiniUPnP project
3: * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4: * (c) 2006-2008 Thomas Bernard
5: * This software is subject to the conditions detailed
6: * in the LICENCE file provided within the distribution */
7:
8: #ifndef __UPNPDESCGEN_H__
9: #define __UPNPDESCGEN_H__
10:
11: #include "config.h"
12:
13: /* for the root description
14: * The child list reference is stored in "data" member using the
15: * INITHELPER macro with index/nchild always in the
16: * same order, whatever the endianness */
17: struct XMLElt {
18: const char * eltname; /* begin with '/' if no child */
19: const char * data; /* Value */
20: };
21:
22: /* for service description */
23: struct serviceDesc {
24: const struct action * actionList;
25: const struct stateVar * serviceStateTable;
26: };
27:
28: struct action {
29: const char * name;
30: const struct argument * args;
31: };
32:
33: struct argument { /* the name of the arg is obtained from the variable */
34: unsigned char dir; /* 1 = in, 2 = out */
35: unsigned char relatedVar; /* index of the related variable */
36: };
37:
38: struct stateVar {
39: const char * name;
40: unsigned char itype; /* MSB: sendEvent flag, 7 LSB: index in upnptypes */
41: unsigned char idefault; /* default value */
42: unsigned char iallowedlist; /* index in allowed values list */
43: unsigned char ieventvalue; /* fixed value returned or magical values */
44: };
45:
46: /* little endian
47: * The code has now be tested on big endian architecture */
48: #define INITHELPER(i, n) ((char *)((n<<16)|i))
49:
50: /* char * genRootDesc(int *);
51: * returns: NULL on error, string allocated on the heap */
52: char *
53: genRootDesc(int * len);
54:
55: /* for the two following functions */
56: char *
57: genWANIPCn(int * len);
58:
59: char *
60: genWANCfg(int * len);
61:
62: #ifdef ENABLE_L3F_SERVICE
63: char *
64: genL3F(int * len);
65: #endif
66:
67: #ifdef ENABLE_EVENTS
68: char *
69: getVarsWANIPCn(int * len);
70:
71: char *
72: getVarsWANCfg(int * len);
73:
74: char *
75: getVarsL3F(int * len);
76: #endif
77:
78: #endif
79:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>