MCPcopy Create free account
hub / github.com/acl-dev/acl / res_a_create

Function res_a_create

lib_acl/samples/dgate/res_util.cpp:5–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "util.h"
4
5ACL_ARGV *res_a_create(const rfc1035_rr *answer, int n)
6{
7 int i;
8 struct in_addr sin_addr;
9 ACL_ARGV *a;
10 char ip[32];
11
12 if (n <= 0)
13 return (NULL);
14
15 a = acl_argv_alloc(n);
16
17 for (i = 0; i < n; i++) {
18 if (answer[i].type == RFC1035_TYPE_A) {
19 memcpy(&sin_addr, answer[i].rdata, 4);
20 ACL_SAFE_STRNCPY(ip, inet_ntoa(sin_addr), sizeof(ip));
21 acl_argv_add(a, ip, NULL);
22 }
23 }
24
25 return (a);
26}

Callers

nothing calls this directly

Calls 3

acl_argv_allocFunction · 0.85
memcpyFunction · 0.85
acl_argv_addFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…