Lines Matching refs:addr

78 coap_new_endpoint(const coap_address_t *addr, int flags) {  in coap_new_endpoint()  argument
90 coap_address_init(&ep->addr); in coap_new_endpoint()
91 uip_ipaddr_copy(&ep->addr.addr, &addr->addr); in coap_new_endpoint()
92 ep->addr.port = addr->port; in coap_new_endpoint()
93 udp_bind((struct uip_udp_conn *)ep->handle.conn, addr->port); in coap_new_endpoint()
120 coap_new_endpoint(const coap_address_t *addr, int flags) { in coap_new_endpoint() argument
121 int sockfd = socket(addr->addr.sa.sa_family, SOCK_DGRAM, 0); in coap_new_endpoint()
134 switch(addr->addr.sa.sa_family) { in coap_new_endpoint()
153 if (bind(sockfd, &addr->addr.sa, addr->size) < 0) { in coap_new_endpoint()
171 ep->addr.size = addr->size; in coap_new_endpoint()
172 if (getsockname(sockfd, &ep->addr.addr.sa, &ep->addr.size) < 0) { in coap_new_endpoint()
185 if (coap_print_addr(&ep->addr, addr_str, INET6_ADDRSTRLEN+8)) { in coap_new_endpoint()
259 mhdr.msg_name = (void *)&dst->addr; in coap_network_send()
265 switch (dst->addr.sa.sa_family) { in coap_network_send()
282 if (coap_is_mcast(&local_interface->addr)) { in coap_network_send()
290 &local_interface->addr.addr.sin6.sin6_addr, in coap_network_send()
291 local_interface->addr.size); in coap_network_send()
310 if (coap_is_mcast(&local_interface->addr)) { in coap_network_send()
318 &local_interface->addr.addr.sin.sin_addr, in coap_network_send()
319 local_interface->addr.size); in coap_network_send()
334 &dst->addr, dst->port); in coap_network_send()
384 memcpy(&target->addr, &packet->dst, sizeof(target->addr)); in coap_packet_populate_endpoint()
440 mhdr.msg_name = &(*packet)->src.addr.st; in coap_network_read()
441 mhdr.msg_namelen = sizeof((*packet)->src.addr.st); in coap_network_read()
461 (*packet)->dst.size = sizeof((*packet)->dst.addr); in coap_network_read()
462 if (getsockname(ep->handle.fd, &(*packet)->dst.addr.sa, &(*packet)->dst.size) < 0) { in coap_network_read()
482 memcpy(&(*packet)->dst.addr.sin6.sin6_addr, in coap_network_read()
488 (*packet)->src.addr.sin6.sin6_family = SIN6(mhdr.msg_name)->sin6_family; in coap_network_read()
489 (*packet)->src.addr.sin6.sin6_addr = SIN6(mhdr.msg_name)->sin6_addr; in coap_network_read()
490 (*packet)->src.addr.sin6.sin6_port = SIN6(mhdr.msg_name)->sin6_port; in coap_network_read()
505 memcpy(&(*packet)->dst.addr.sin.sin_addr, in coap_network_read()
509 memcpy(&(*packet)->src.addr.st, mhdr.msg_name, (*packet)->src.size); in coap_network_read()
515 if (!is_local_if(&ep->addr, &(*packet)->dst)) { in coap_network_read()
527 uip_ipaddr_copy(&(*packet)->src.addr, &UIP_IP_BUF->srcipaddr); in coap_network_read()
529 uip_ipaddr_copy(&(*packet)->dst.addr, &UIP_IP_BUF->destipaddr); in coap_network_read()
532 if (!is_local_if(&ep->addr, &(*packet)->dst)) { in coap_network_read()