Changeset a33aa52dc08eb296a042f396243bde78cf840b99
- Timestamp:
- 09/14/11 15:59:49
(2 years ago)
- Author:
- gdusbabek <gdusbabek@gmail.com>
- git-committer:
- gdusbabek <gdusbabek@gmail.com> 1316015989 -0500
- git-parent:
[1f3d77e42e6c55977e550e9ba33cd3ebe2228a1b]
- git-author:
- gdusbabek <gdusbabek@gmail.com> 1315924790 -0500
- Message:
validate resolve_rtype and show in xml
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1f3d77e |
ra33aa52 |
|
| 76 | 76 | #define NP_TRY_OTHER_RESOLVE 0x00008000 |
|---|
| 77 | 77 | |
|---|
| | 78 | #define NP_PREFER_IPV4 "prefer-ipv4" |
|---|
| | 79 | #define NP_PREFER_IPV6 "prefer-ipv6" |
|---|
| | 80 | #define NP_FORCE_IPV4 "force-ipv4" |
|---|
| | 81 | #define NP_FORCE_IPV6 "force-ipv6" |
|---|
| | 82 | |
|---|
| 78 | 83 | #define NP_UNKNOWN '0' /* stats_t.{available,state} */ |
|---|
| 79 | 84 | #define NP_AVAILABLE 'A' /* stats_t.available */ |
|---|
| r09ecd28 |
ra33aa52 |
|
| 197 | 197 | SHOW_ATTR(attr,node,module); |
|---|
| 198 | 198 | SHOW_ATTR(attr,node,target); |
|---|
| | 199 | SHOW_ATTR(attr,node,resolve_rtype); |
|---|
| 199 | 200 | SHOW_ATTR(attr,node,period); |
|---|
| 200 | 201 | SHOW_ATTR(attr,node,timeout); |
|---|
| … | … | |
| 246 | 247 | const char **error) { |
|---|
| 247 | 248 | xmlNodePtr root, tl, an; |
|---|
| 248 | | int name=0, module=0, target=0, period=0, timeout=0, filterset=0; |
|---|
| | 249 | int name=0, module=0, target=0, resolve_rtype=0, period=0, timeout=0, filterset=0; |
|---|
| 249 | 250 | *a = *c = NULL; |
|---|
| 250 | 251 | root = xmlDocGetRootElement(doc); |
|---|
| … | … | |
| 283 | 284 | } |
|---|
| 284 | 285 | target = 1; |
|---|
| | 286 | } |
|---|
| | 287 | else CHECK_N_SET(resolve_rtype) { |
|---|
| | 288 | xmlChar *tmp; |
|---|
| | 289 | noit_boolean invalid; |
|---|
| | 290 | tmp = xmlNodeGetContent(an); |
|---|
| | 291 | invalid = strcmp((char *)tmp, NP_PREFER_IPV4) && strcmp((char *)tmp, NP_PREFER_IPV6) && strcmp((char *)tmp, NP_FORCE_IPV4) && strcmp((char *)tmp, NP_FORCE_IPV6); |
|---|
| | 292 | xmlFree(tmp); |
|---|
| | 293 | if(invalid) { |
|---|
| | 294 | *error = "invalid reslove_rtype"; |
|---|
| | 295 | return 0; |
|---|
| | 296 | } |
|---|
| | 297 | resolve_rtype = 1; |
|---|
| 285 | 298 | } |
|---|
| 286 | 299 | else CHECK_N_SET(period) { |
|---|
| … | … | |
| 356 | 369 | ATTR2PROP(name); |
|---|
| 357 | 370 | ATTR2PROP(target); |
|---|
| | 371 | ATTR2PROP(resolve_rtype); |
|---|
| 358 | 372 | ATTR2PROP(module); |
|---|
| 359 | 373 | ATTR2PROP(period); |
|---|