usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / miniupnpd / upnpdescgen.h
blob417341721deab9fb4c0ed3aacab35b3202dcbbbd
1 /* $Id: upnpdescgen.h,v 1.24 2012/09/27 16:00:10 nanard Exp $ */
2 /* MiniUPnP project
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
11 #include "config.h"
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 */
22 /* for service description */
23 struct serviceDesc {
24 const struct action * actionList;
25 const struct stateVar * serviceStateTable;
28 struct action {
29 const char * name;
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 */
40 struct stateVar {
41 const char * name;
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 */
49 /* little endian
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 */
55 char *
56 genRootDesc(int * len);
58 /* for the two following functions */
59 char *
60 genWANIPCn(int * len);
62 char *
63 genWANCfg(int * len);
65 #ifdef ENABLE_L3F_SERVICE
66 char *
67 genL3F(int * len);
68 #endif
70 #ifdef ENABLE_6FC_SERVICE
71 char *
72 gen6FC(int * len);
73 #endif
75 #ifdef ENABLE_DP_SERVICE
76 char *
77 genDP(int * len);
78 #endif
80 #ifdef ENABLE_EVENTS
81 char *
82 getVarsWANIPCn(int * len);
84 char *
85 getVarsWANCfg(int * len);
87 #ifdef ENABLE_L3F_SERVICE
88 char *
89 getVarsL3F(int * len);
90 #endif
91 #ifdef ENABLE_6FC_SERVICE
92 char *
93 getVars6FC(int * len);
94 #endif
95 #ifdef ENABLE_DP_SERVICE
96 char *
97 getVarsDP(int * len);
98 #endif
99 #endif /* ENABLE_EVENTS */
101 #endif