MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsdAddIPMask

Function cupsdAddIPMask

scheduler/auth.c:99–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 */
98
99int /* O - 1 on success, 0 on failure */
100cupsdAddIPMask(
101 cups_array_t **masks, /* IO - Masks array (created as needed) */
102 const unsigned address[4], /* I - IP address */
103 const unsigned netmask[4]) /* I - IP netmask */
104{
105 cupsd_authmask_t temp; /* New host/domain mask */
106
107
108 cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdAddIPMask(masks=%p(%p), address=%x:%x:%x:%x, netmask=%x:%x:%x:%x)", (void *)masks, (void *)*masks, address[0], address[1], address[2], address[3], netmask[0], netmask[1], netmask[2], netmask[3]);
109
110 temp.type = CUPSD_AUTH_IP;
111 memcpy(temp.mask.ip.address, address, sizeof(temp.mask.ip.address));
112 memcpy(temp.mask.ip.netmask, netmask, sizeof(temp.mask.ip.netmask));
113
114 /*
115 * Create the masks array as needed and add...
116 */
117
118 if (!*masks)
119 *masks = cupsArrayNew3(NULL, NULL, NULL, 0,
120 (cups_acopy_func_t)copy_authmask,
121 (cups_afree_func_t)free_authmask);
122
123 return (cupsArrayAdd(*masks, &temp));
124}
125
126
127/*

Callers 1

parse_aaaFunction · 0.85

Calls 3

cupsdLogMessageFunction · 0.85
cupsArrayNew3Function · 0.85
cupsArrayAddFunction · 0.85

Tested by

no test coverage detected