Lines Matching refs:ep
80 #define set_ip_epdisc(ep, addr) do { \
81 ep->length = 4; \
82 ep->value[0] = addr >> 24; \
83 ep->value[1] = addr >> 16; \
84 ep->value[2] = addr >> 8; \
85 ep->value[3] = addr; \
281 get_default_epdisc(ep)
282 struct epdisc *ep;
290 if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) {
291 ep->class = EPD_MAC;
292 ep->length = 6;
303 ep->class = EPD_IP;
304 set_ip_epdisc(ep, addr);
322 epdisc_to_str(ep)
323 struct epdisc *ep;
326 u_char *p = ep->value;
330 if (ep->class == EPD_NULL && ep->length == 0)
332 if (ep->class == EPD_IP && ep->length == 4) {
342 if (ep->class == EPD_MAC && ep->length == 6)
344 else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0)
347 if (ep->class <= EPD_PHONENUM)
349 endp_class_names[ep->class]);
351 q += slprintf(q, sizeof(str)-1, "%d", ep->class);
353 for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) {
358 q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]);
373 str_to_epdisc(ep, str)
374 struct epdisc *ep;
394 ep->class = i;
396 ep->length = 0;
408 set_ip_epdisc(ep, addr);
411 if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) {
412 ep->length = 6;
426 ep->value[l] = hexc_val(*str++);
428 ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++);
432 if (*str != 0 || (ep->class == EPD_MAC && l != 6))
434 ep->length = l;