<commit_before>/*
 * Part of DNS zone file validator `validns`.
 *
 * Copyright 2011, <NAME> <<EMAIL>>
 * Modified BSD license.
 * (See LICENSE file in the distribution.)
 *
 */
#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include "common.h"
#include "textparse.h"
#include "mempool.h"
#include "carp.h"
#include "rr.h"

static struct rr *cname_parse(char *name, long ttl, int type, char *s)
{
	struct rr_cname *rr = getmem(sizeof(*rr));

	rr->cname = extract_name(&s, "cname");
	if (!rr->cname)
		return NULL;
	if (*s) {
		return bitch("garbage after valid CNAME data");
	}

	return store_record(type, name, ttl, rr);
}

static char* cname_human(struct rr *rrv)
{
    struct rr_cname *rr = (struct rr_cname *)rrv;
    return rr->cname;
}

static struct binary_data cname_wirerdata(struct rr *rrv)
{
	return bad_binary_data();
}

struct rr_methods cname_methods = { cname_parse, cname_human, cname_wirerdata, NULL, NULL };<commit_msg>Wire format for CNAME.<commit_after>/*
 * Part of DNS zone file validator `validns`.
 *
 * Copyright 2011, <NAME> <<EMAIL>>
 * Modified BSD license.
 * (See LICENSE file in the distribution.)
 *
 */
#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include "common.h"
#include "textparse.h"
#include "mempool.h"
#include "carp.h"
#include "rr.h"

static struct rr *cname_parse(char *name, long ttl, int type, char *s)
{
	struct rr_cname *rr = getmem(sizeof(*rr));

	rr->cname = extract_name(&s, "cname");
	if (!rr->cname)
		return NULL;
	if (*s) {
		return bitch("garbage after valid CNAME data");
	}

	return store_record(type, name, ttl, rr);
}

static char* cname_human(struct rr *rrv)
{
    struct rr_cname *rr = (struct rr_cname *)rrv;
    return rr->cname;
}

static struct binary_data cname_wirerdata(struct rr *rrv)
{
	struct rr_cname *rr = (struct rr_cname *)rrv;
	return name2wire_name(rr->cname);
}

struct rr_methods cname_methods = { cname_parse, cname_human, cname_wirerdata, NULL, NULL };
{'fraction_non_alphanumeric': 0.14970355731225296, 'fraction_numerical': 0.004446640316205534, 'mean_word_length': 4.532786885245901, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1573166', 'n_tokens_mistral': 819, 'n_tokens_neox': 791, 'n_words': 215}