1 /* $Id: upnpdescgen.h,v 1.24 2012/09/27 16:00:10 nanard Exp $ */
3 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4 * (c) 2006-2011 Thomas Bernard
5 * This software is subject to the conditions detailed
6 * in the LICENCE file provided within the distribution */
8 #ifndef UPNPDESCGEN_H_INCLUDED
9 #define UPNPDESCGEN_H_INCLUDED
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 */
18 const char * eltname
; /* begin with '/' if no child */
19 const char * data
; /* Value */
22 /* for service description */
24 const struct action
* actionList
;
25 const struct stateVar
* serviceStateTable
;
30 const struct argument
* args
;
33 struct argument
{ /* the name of the arg is obtained from the variable */
34 unsigned char dir
; /* MSB : don't append "New" Flag,
35 * 5 Medium bits : magic argument name index
36 * 2 LSB : 1 = in, 2 = out */
37 unsigned char relatedVar
; /* index of the related variable */
42 unsigned char itype
; /* MSB: sendEvent flag, 7 LSB: index in upnptypes */
43 unsigned char idefault
; /* default value */
44 unsigned char iallowedlist
; /* index in allowed values list
45 * or in allowed range list */
46 unsigned char ieventvalue
; /* fixed value returned or magical values */
50 * The code has now be tested on big endian architecture */
51 #define INITHELPER(i, n) ((char *)(((n)<<16)|(i)))
53 /* char * genRootDesc(int *);
54 * returns: NULL on error, string allocated on the heap */
56 genRootDesc(int * len
);
58 /* for the two following functions */
60 genWANIPCn(int * len
);
65 #ifdef ENABLE_L3F_SERVICE
70 #ifdef ENABLE_6FC_SERVICE
75 #ifdef ENABLE_DP_SERVICE
82 getVarsWANIPCn(int * len
);
85 getVarsWANCfg(int * len
);
87 #ifdef ENABLE_L3F_SERVICE
89 getVarsL3F(int * len
);
91 #ifdef ENABLE_6FC_SERVICE
93 getVars6FC(int * len
);
95 #ifdef ENABLE_DP_SERVICE
99 #endif /* ENABLE_EVENTS */