tr069 节点模板定义c语言

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#include <stdio.h>
 
/* Signed */
typedef signed char     int8_t;
typedef short int       int16_t;
typedef int             int32_t;
 
 
/* Unsigned.  */
typedef unsigned char       uint8_t;
typedef unsigned short int  uint16_t;
typedef unsigned int        uint32_t;
 
typedef enum error_type
{
    ERR_NONE = 0,
    ERR_FAIL,
    ERR_BAD_PARAM,
    ERR_ACS_NOT_RESPONDING,
    ERR_MALLOC_FAILURE,
    ERR_MALLOC_SERVER_FAILURE = 9007,
} error_type_t;
 
 
typedef enum datatype
{
    INT=1,
    STRING,
    BOOL,
    UNSIGNEDINT,
    DATETIME,
    BASE64,
    OBJECT
}datatype_t;
 
typedef enum
{
    False=0,
    True,
} writable_t;
 
typedef struct DModel_template
{
    const char  *path;                        // Complete hierarchical path of TR parameter
    datatype_t datatypes ;
     writable_t writable ;
     error_type_t (*nv_cwmp_get_param)(uint8_t *, void**); // Get function for getting the param value
    error_type_t (*nv_cwmp_set_param)(uint8_t *, void*); // Set function for setting the param value
    //type of data if int, boolean, string, unsinged int
} dmodel_template_t;
 
 
typedef char* xsd__anySimpleType;
/// "urn:dslforum-org:cwmp-1-1":ParameterValueStruct is a complexType.
struct cwmp__ParameterValueStruct
{
/// Length of this string is within 0..256 characters
    char*                                                             
                                         Name                          ;    ///< Required element.
/// Element Value of type xs:anySimpleType.
    xsd__anySimpleType                   Value                         ;    ///< Required element.
};
 
/// "urn:dslforum-org:cwmp-1-1":ParameterValueList is a complexType with complexContent restriction of SOAP-ENC:Array.
/// SOAP encoded array of "urn:dslforum-org:cwmp-1-1":ParameterValueStruct
struct ParameterValueList
{
/// Pointer to array of struct cwmp__ParameterValueStruct*.
    struct cwmp__ParameterValueStruct*  *__ptrParameterValueStruct     ;
/// Size of the dynamic array.
    int                                  __size                        ;
/// Offset for partially transmitted arrays (uncomment only when required).
//  int                                  __offset                      ;
};
error_type_t
    nv_cwmp_parametervalue_alloc(
    struct ParameterValueList ** outptr,
    char * name,
    char * type,
    char *value)
{
 
    struct ParameterValueList * parametervaluelist =  *outptr;
 
   return 0;
}
 
error_type_t getLANDeviceNumberOfEntries(uint8_t *path, void **outptr)
{
  /*
    return (nv_cwmp_parametervalue_alloc(
                            (struct ParameterValueList **) outptr,
                            "InternetGatewayDevice.LANDeviceNumberOfEntries",
                            "string",
                            "8"));
   */
}
 
error_type_t getWANDeviceNumberOfEntries(uint8_t *path, void **outptr)
{
   /*
    return (nv_cwmp_parametervalue_alloc(
                            (struct ParameterValueList **) outptr,
                            "InternetGatewayDevice.WANDeviceNumberOfEntries",
                            "string",
                            "2"));
                     */
}
 
 
 
#define DM_MAX_ENTRIES  2048
dmodel_template_t cwmp_datamodel_common[DM_MAX_ENTRIES] = {
    {"InternetGatewayDevice",                                       OBJECT,False ,NULL,NULL}, // object
    {"InternetGatewayDevice.X_ASB_UserLimitCfg",                   OBJECT,False ,NULL,NULL}, // object
   {"InternetGatewayDevice.LANDeviceNumberOfEntries",               STRING,False ,getLANDeviceNumberOfEntries, NULL},
    {"InternetGatewayDevice.WANDeviceNumberOfEntries",              STRING,False ,getWANDeviceNumberOfEntries, NULL},
};
int main()
{
  
   printf("hello,world\n");
   return 0;
}

  

posted on   lydstory  阅读(77)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2022-06-15 quectel-CM
2022-06-15 QMI
2020-06-15 bdb版本输出查看

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示