<commit_before>#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>

#include "mdnsd.h"

/* Print an answer */
int ans(mdns_answer_t *a, void *arg)
{
	int now;

	if (a->ttl == 0)
		now = 0;
	else
		now = a->ttl - time(0);

	switch (a->type) {
	case QTYPE_A:
		printf("A %s for %d seconds to ip %s\n", a->name, now, inet_ntoa(a->ip));
		break;

	case QTYPE_PTR:
		printf("PTR %s for %d seconds to %s\n", a->name, now, a->rdname);
		break;

	case QTYPE_SRV:
		printf("SRV %s for %d seconds to %s:%d\n", a->name, now, a->rdname, a->srv.port);
		break;

	default:
		printf("%d %s for %d seconds with %d data\n", a->type, a->name, now, a->rdlen);
	}
}

/* Create multicast 172.16.31.10:5353 socket */
int msock(void)
{
	int s, flag = 1, ittl = 255;
	struct sockaddr_in in;
	struct ip_mreq mc;
	char ttl = 255;

	memset(&in, 0, sizeof(in));
	in.sin_family = AF_INET;<commit_msg>Clang fixes: Add missing `return 0;` in mdnsd_query() callback<commit_after>#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>

#include "mdnsd.h"

/* Print an answer */
int ans(mdns_answer_t *a, void *arg)
{
	int now;

	if (a->ttl == 0)
		now = 0;
	else
		now = a->ttl - time(0);

	switch (a->type) {
	case QTYPE_A:
		printf("A %s for %d seconds to ip %s\n", a->name, now, inet_ntoa(a->ip));
		break;

	case QTYPE_PTR:
		printf("PTR %s for %d seconds to %s\n", a->name, now, a->rdname);
		break;

	case QTYPE_SRV:
		printf("SRV %s for %d seconds to %s:%d\n", a->name, now, a->rdname, a->srv.port);
		break;

	default:
		printf("%d %s for %d seconds with %d data\n", a->type, a->name, now, a->rdlen);
	}

	return 0;
}

/* Create multicast 172.16.31.10:5353 socket */
int msock(void)
{
	int s, flag = 1, ittl = 255;
	struct sockaddr_in in;
	struct ip_mreq mc;
	char ttl = 255;

	memset(&in, 0, sizeof(in));
	in.sin_family = AF_INET;
{'fraction_non_alphanumeric': 0.1905424200278164, 'fraction_numerical': 0.023180343069077423, 'mean_word_length': 3.6408602150537632, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5156272', 'n_tokens_mistral': 1030, 'n_tokens_neox': 956, 'n_words': 259}