diff options
author | Matthieu Boutier <boutier@pps.jussieu.fr> | 2012-01-23 23:46:32 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2012-03-25 18:06:53 +0200 |
commit | c35fafdf887aa32c5be6ad738d3a3b0140cea6e8 (patch) | |
tree | 4aa21a41dcd82247e467e5b955a6f7813bfd7ba7 /babeld/util.c | |
parent | babeld: remove unused variable. (diff) | |
download | frr-c35fafdf887aa32c5be6ad738d3a3b0140cea6e8.tar.xz frr-c35fafdf887aa32c5be6ad738d3a3b0140cea6e8.zip |
babeld: babelz merge.
Babelz is the last version of the stand-alone babel daemon. In
particular, it use multiple channels to diminuate
interferences. Please refer to this one for more details.
Diffstat (limited to 'babeld/util.c')
-rw-r--r-- | babeld/util.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/babeld/util.c b/babeld/util.c index 514e0ff39..011f3824e 100644 --- a/babeld/util.c +++ b/babeld/util.c @@ -200,17 +200,6 @@ parse_msec(const char *string) return -1; } -void -do_debugf(const char *format, ...) -{ - va_list args; - va_start(args, format); - vfprintf(stderr, format, args); - fprintf(stderr, "\n"); - fflush(stderr); - va_end(args); -} - int in_prefix(const unsigned char *restrict address, const unsigned char *restrict prefix, unsigned char plen) @@ -328,63 +317,6 @@ parse_address(const char *address, unsigned char *addr_r, int *af_r) } int -parse_net(const char *net, unsigned char *prefix_r, unsigned char *plen_r, - int *af_r) -{ - char buf[INET6_ADDRSTRLEN]; - char *slash, *end; - unsigned char prefix[16]; - long plen; - int af; - struct in_addr ina; - struct in6_addr ina6; - int rc; - - if(strcmp(net, "default") == 0) { - memset(prefix, 0, 16); - plen = 0; - } else { - slash = strchr(net, '/'); - if(slash == NULL) { - rc = parse_address(net, prefix, &af); - if(rc < 0) - return rc; - plen = 128; - } else { - if(slash - net >= INET6_ADDRSTRLEN) - return -1; - memcpy(buf, net, slash - net); - buf[slash - net] = '\0'; - rc = inet_pton(AF_INET, buf, &ina); - if(rc > 0) { - memcpy(prefix, v4prefix, 12); - memcpy(prefix + 12, &ina, 4); - plen = strtol(slash + 1, &end, 0); - if(*end != '\0' || plen < 0 || plen > 32) - return -1; - plen += 96; - af = AF_INET; - } else { - rc = inet_pton(AF_INET6, buf, &ina6); - if(rc > 0) { - memcpy(prefix, &ina6, 16); - plen = strtol(slash + 1, &end, 0); - if(*end != '\0' || plen < 0 || plen > 128) - return -1; - af = AF_INET6; - } else { - return -1; - } - } - } - } - mask_prefix(prefix_r, prefix, plen); - *plen_r = plen; - if(af_r) *af_r = af; - return 0; -} - -int parse_eui64(const char *eui, unsigned char *eui_r) { int n; |