Changeset e2422ef3902d44137a67bacf12c21559325989c4 for src
- Timestamp:
- 09/14/11 15:59:49 (2 years ago)
- git-parent:
- Files:
-
- src/modules/check_test.c (modified) (2 diffs)
- src/noit_check.c (modified) (1 diff)
- src/noit_check.h (modified) (1 diff)
- src/noit_check_rest.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/modules/check_test.c
r212da6e re2422ef 96 96 noit_check_t * 97 97 noit_fire_check(xmlNodePtr attr, xmlNodePtr config, const char **error) { 98 char *target = NULL, *name = NULL, *module = NULL, *filterset = NULL, *resolve_rtype = NULL; 98 char *target = NULL, *name = NULL, *module = NULL, *filterset = NULL; 99 char *resolve_rtype = NULL; 99 100 int timeout = 0; 100 101 noit_module_t *m; … … 139 140 } 140 141 int flags = NP_TRANSIENT; 141 flags |= strcmp(resolve_rtype, PREFER_IPV6) == 0 || strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_PREFER_IPV6 : 0; 142 flags |= strcmp(resolve_rtype, FORCE_IPV4) == 0 || strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_SINGLE_RESOLVE : 0; 142 flags |= strcmp(resolve_rtype, PREFER_IPV6) == 0 || 143 strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_PREFER_IPV6 : 0; 144 flags |= strcmp(resolve_rtype, FORCE_IPV4) == 0 || 145 strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_SINGLE_RESOLVE : 0; 143 146 c = calloc(1, sizeof(*c)); 144 147 noit_check_update(c, target, name, filterset, src/noit_check.c
r212da6e re2422ef 222 222 else if(disabled) flags |= NP_DISABLED; 223 223 224 flags |= strcmp(resolve_rtype, PREFER_IPV6) == 0 || strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_PREFER_IPV6 : 0; 225 flags |= strcmp(resolve_rtype, FORCE_IPV4) == 0 || strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_SINGLE_RESOLVE : 0; 224 flags |= strcmp(resolve_rtype, PREFER_IPV6) == 0 || 225 strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_PREFER_IPV6 : 0; 226 flags |= strcmp(resolve_rtype, FORCE_IPV4) == 0 || 227 strcmp(resolve_rtype, FORCE_IPV6) == 0 ? NP_SINGLE_RESOLVE : 0; 226 228 227 229 if(noit_hash_retrieve(&polls, (char *)uuid, UUID_SIZE, src/noit_check.h
r212da6e re2422ef 163 163 #define NOIT_CHECK_SHOULD_RESOLVE(a) ((a)->flags & NP_RESOLVE) 164 164 /* It is resolved if it is resolved or never needed to be resolved */ 165 #define NOIT_CHECK_RESOLVED(a) (((a)->flags & NP_RESOLVED) || (((a)->flags & NP_RESOLVE) == 0)) 166 #define NOIT_CHECK_PREFER_V6(a) (((a)->flags & NP_PREFER_IPV6) == NP_PREFER_IPV6) 167 #define NOIT_CHECK_SINGLE_RESOLVE(a) (((a)->flags & NP_SINGLE_RESOLVE) == NP_SINGLE_RESOLVE) 165 #define NOIT_CHECK_RESOLVED(a) (((a)->flags & NP_RESOLVED) \ 166 || (((a)->flags & NP_RESOLVE) == 0)) 167 #define NOIT_CHECK_PREFER_V6(a) (((a)->flags & NP_PREFER_IPV6) \ 168 == NP_PREFER_IPV6) 169 #define NOIT_CHECK_SINGLE_RESOLVE(a) (((a)->flags & NP_SINGLE_RESOLVE) \ 170 == NP_SINGLE_RESOLVE) 168 171 169 172 API_EXPORT(void) noit_poller_init(); src/noit_check_rest.c
r212da6e re2422ef 247 247 const char **error) { 248 248 xmlNodePtr root, tl, an; 249 int name=0, module=0, target=0, resolve_rtype=0, period=0, timeout=0, filterset=0; 249 int name=0, module=0, target=0, resolve_rtype=0, period=0, timeout=0; 250 int filterset=0; 250 251 *a = *c = NULL; 251 252 root = xmlDocGetRootElement(doc); … … 289 290 noit_boolean invalid; 290 291 tmp = xmlNodeGetContent(an); 291 invalid = strcmp((char *)tmp, PREFER_IPV4) && strcmp((char *)tmp,PREFER_IPV6) && strcmp((char *)tmp, FORCE_IPV4) && strcmp((char *)tmp, FORCE_IPV6); 292 invalid = strcmp((char *)tmp, PREFER_IPV4) && 293 strcmp((char *)tmp,PREFER_IPV6) && 294 strcmp((char *)tmp, FORCE_IPV4) && 295 strcmp((char *)tmp, FORCE_IPV6); 292 296 xmlFree(tmp); 293 297 if(invalid) {
