MCPcopy Create free account
hub / github.com/F-Stack/f-stack / IpMask

Function IpMask

freebsd/netinet/libalias/alias_proxy.c:145–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143static void ProxyEncodeIpHeader(struct ip *, int);
144
145static int
146IpMask(int nbits, struct in_addr *mask)
147{
148 int i;
149 u_int imask;
150
151 if (nbits < 0 || nbits > 32)
152 return (-1);
153
154 imask = 0;
155 for (i = 0; i < nbits; i++)
156 imask = (imask >> 1) + 0x80000000;
157 mask->s_addr = htonl(imask);
158
159 return (0);
160}
161
162static int
163IpAddr(char *s, struct in_addr *addr)

Callers 1

LibAliasProxyRuleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected