Lines Matching defs:alen
41 * | alen | proto | ckey | src-id | dst-id | src-addr | dst-addr |
47 * the 'alen' field. The length is in words and is either 1 or 4,
85 npf_connkey_setkey(npf_connkey_t *key, unsigned alen, unsigned proto,
101 KASSERT((alen >> 2) <= 0xf && proto <= 0xff);
102 k[0] = ((uint32_t)(alen >> 2) << 28) | (proto << 20);
105 if (__predict_true(alen == sizeof(in_addr_t))) {
110 const unsigned nwords = alen >> 2;
111 memcpy(&k[2], ips[isrc], alen);
112 memcpy(&k[2 + nwords], ips[idst], alen);
118 npf_connkey_getkey(const npf_connkey_t *key, unsigned *alen, unsigned *proto,
127 *alen = (k[0] >> 28) << 2;
132 switch (*alen) {
135 memcpy(&ips[NPF_SRC], &k[2], *alen);
136 memcpy(&ips[NPF_DST], &k[2 + ((unsigned)*alen >> 2)], *alen);
183 const unsigned alen = NPF_CONNKEY_ALEN(key);
185 uint32_t *addr = &k[2 + ((alen >> 2) * which)];
188 KASSERT(alen > 0);
189 memcpy(addr, naddr, alen);
207 const unsigned alen = NPF_CONNKEY_ALEN(skey);
208 const unsigned nwords = alen >> 2;
212 memcpy(&dk[2], &sk[2 + nwords], alen);
213 memcpy(&dk[2 + nwords], &sk[2], alen);
232 const unsigned alen = npc->npc_alen;
280 ret = npf_connkey_setkey(key, alen, proto, npc->npc_ips, id, flow);
302 npf_conn_getbackkey(npf_conn_t *conn, unsigned alen)
304 const unsigned off = 2 + ((alen * 2) >> 2);
316 unsigned alen, proto, ifid, di;
323 npf_connkey_getkey(key, &alen, &proto, ips, ids);
327 nvlist_add_binary(key_nv, "saddr", &ips[NPF_SRC], alen);
328 nvlist_add_binary(key_nv, "daddr", &ips[NPF_DST], alen);
383 unsigned alen, proto, ifid, di;
387 npf_connkey_getkey(key, &alen, &proto, ips, ids);
390 printf("%s:%u", npf_addr_dump(&ips[0], alen), ids[0]);
391 printf("-> %s:%u\n", npf_addr_dump(&ips[1], alen), ids[1]);