Lines Matching refs:ep
75 #define set_ip_epdisc(ep, addr) do { \
76 ep->length = 4; \
77 ep->value[0] = addr >> 24; \
78 ep->value[1] = addr >> 16; \
79 ep->value[2] = addr >> 8; \
80 ep->value[3] = addr; \
452 get_default_epdisc(ep)
453 struct epdisc *ep;
461 if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) {
462 ep->class = EPD_MAC;
463 ep->length = 6;
474 ep->class = EPD_IP;
475 set_ip_epdisc(ep, addr);
493 epdisc_to_str(ep)
494 struct epdisc *ep;
497 u_char *p = ep->value;
501 if (ep->class == EPD_NULL && ep->length == 0)
503 if (ep->class == EPD_IP && ep->length == 4) {
513 if (ep->class == EPD_MAC && ep->length == 6)
515 else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0)
518 if (ep->class <= EPD_PHONENUM)
520 endp_class_names[ep->class]);
522 q += slprintf(q, sizeof(str)-1, "%d", ep->class);
524 for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) {
529 q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]);
544 str_to_epdisc(ep, str)
545 struct epdisc *ep;
565 ep->class = i;
567 ep->length = 0;
579 set_ip_epdisc(ep, addr);
582 if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) {
583 ep->length = 6;
597 ep->value[l] = hexc_val(*str++);
599 ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++);
603 if (*str != 0 || (ep->class == EPD_MAC && l != 6))
605 ep->length = l;