Lines Matching refs:sdn
309 int dn_sockaddr2username(struct sockaddr_dn *sdn, unsigned char *buf, unsigned char type) in dn_sockaddr2username() argument
317 *buf++ = sdn->sdn_objnum; in dn_sockaddr2username()
321 *buf++ = dn_ntohs(sdn->sdn_objnamel); in dn_sockaddr2username()
322 memcpy(buf, sdn->sdn_objname, dn_ntohs(sdn->sdn_objnamel)); in dn_sockaddr2username()
323 len = 3 + dn_ntohs(sdn->sdn_objnamel); in dn_sockaddr2username()
328 *buf++ = dn_ntohs(sdn->sdn_objnamel); in dn_sockaddr2username()
329 memcpy(buf, sdn->sdn_objname, dn_ntohs(sdn->sdn_objnamel)); in dn_sockaddr2username()
330 len = 7 + dn_ntohs(sdn->sdn_objnamel); in dn_sockaddr2username()
344 int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *sdn, unsigned char *fmt) in dn_username2sockaddr() argument
350 sdn->sdn_objnum = 0; in dn_username2sockaddr()
351 sdn->sdn_objnamel = dn_htons(0); in dn_username2sockaddr()
352 memset(sdn->sdn_objname, 0, DN_MAXOBJL); in dn_username2sockaddr()
363 sdn->sdn_objnum = type; in dn_username2sockaddr()
385 sdn->sdn_objnamel = dn_htons(*data++); in dn_username2sockaddr()
386 len -= dn_ntohs(sdn->sdn_objnamel); in dn_username2sockaddr()
388 if ((len < 0) || (dn_ntohs(sdn->sdn_objnamel) > namel)) in dn_username2sockaddr()
391 memcpy(sdn->sdn_objname, data, dn_ntohs(sdn->sdn_objnamel)); in dn_username2sockaddr()