Annotation of embedaddon/miniupnpd/upnpdescgen.h, revision 1.1.1.2

1.1.1.2 ! misho       1: /* $Id: upnpdescgen.h,v 1.22 2011/05/18 22:22:24 nanard Exp $ */
1.1       misho       2: /* MiniUPnP project
                      3:  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
1.1.1.2 ! misho       4:  * (c) 2006-2011 Thomas Bernard 
1.1       misho       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 */
1.1.1.2 ! misho      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 */
1.1       misho      37:        unsigned char relatedVar;       /* index of the related variable */
                     38: };
                     39: 
                     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 */
1.1.1.2 ! misho      44:        unsigned char iallowedlist;     /* index in allowed values list 
        !            45:                                     * or in allowed range list */
1.1       misho      46:        unsigned char ieventvalue;      /* fixed value returned or magical values */
                     47: };
                     48: 
                     49: /* little endian 
                     50:  * The code has now be tested on big endian architecture */
1.1.1.2 ! misho      51: #define INITHELPER(i, n) ((char *)(((n)<<16)|(i)))
1.1       misho      52: 
                     53: /* char * genRootDesc(int *);
                     54:  * returns: NULL on error, string allocated on the heap */
                     55: char *
                     56: genRootDesc(int * len);
                     57: 
                     58: /* for the two following functions */
                     59: char *
                     60: genWANIPCn(int * len);
                     61: 
                     62: char *
                     63: genWANCfg(int * len);
                     64: 
                     65: #ifdef ENABLE_L3F_SERVICE
                     66: char *
                     67: genL3F(int * len);
                     68: #endif
                     69: 
1.1.1.2 ! misho      70: #ifdef ENABLE_6FC_SERVICE
        !            71: char *
        !            72: gen6FC(int * len);
        !            73: #endif
        !            74: 
        !            75: #ifdef ENABLE_DP_SERVICE
        !            76: char *
        !            77: genDP(int * len);
        !            78: #endif
        !            79: 
1.1       misho      80: #ifdef ENABLE_EVENTS
                     81: char *
                     82: getVarsWANIPCn(int * len);
                     83: 
                     84: char *
                     85: getVarsWANCfg(int * len);
                     86: 
1.1.1.2 ! misho      87: #ifdef ENABLE_L3F_SERVICE
1.1       misho      88: char *
                     89: getVarsL3F(int * len);
                     90: #endif
1.1.1.2 ! misho      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 */
1.1       misho     100: 
                    101: #endif
                    102: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>