File: dns_dnlabels.c

package info (click to toggle)
rbldnsd 0.998b~pre1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 744 kB
  • ctags: 1,132
  • sloc: ansic: 8,212; python: 549; sh: 502; makefile: 249; awk: 33
file content (11 lines) | stat: -rw-r--r-- 212 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
/* dns_dnlabels() returns number of individual labels in a domain name
 */

#include "dns.h"

unsigned dns_dnlabels(const unsigned char *dn) {
  unsigned l = 0;
  while(*dn)
    ++l, dn += 1 + *dn;
  return l;
}