Lines Matching refs:ep
58 #define set_ip_epdisc(ep, addr) do { \
59 ep->length = 4; \
60 ep->value[0] = addr >> 24; \
61 ep->value[1] = addr >> 16; \
62 ep->value[2] = addr >> 8; \
63 ep->value[3] = addr; \
259 get_default_epdisc(ep)
260 struct epdisc *ep;
268 if (p != 0 && get_if_hwaddr(ep->value, p) >= 0) {
269 ep->class = EPD_MAC;
270 ep->length = 6;
281 ep->class = EPD_IP;
282 set_ip_epdisc(ep, addr);
300 epdisc_to_str(ep)
301 struct epdisc *ep;
304 u_char *p = ep->value;
308 if (ep->class == EPD_NULL && ep->length == 0)
310 if (ep->class == EPD_IP && ep->length == 4) {
320 if (ep->class == EPD_MAC && ep->length == 6)
322 else if (ep->class == EPD_MAGIC && (ep->length % 4) == 0)
325 if (ep->class <= EPD_PHONENUM)
327 endp_class_names[ep->class]);
329 q += slprintf(q, sizeof(str)-1, "%d", ep->class);
331 for (i = 0; i < ep->length && i < MAX_ENDP_LEN; ++i) {
336 q += slprintf(q, str + sizeof(str) - q, "%.2x", ep->value[i]);
351 str_to_epdisc(ep, str)
352 struct epdisc *ep;
372 ep->class = i;
374 ep->length = 0;
386 set_ip_epdisc(ep, addr);
389 if (i == EPD_MAC && get_if_hwaddr(ep->value, str) >= 0) {
390 ep->length = 6;
404 ep->value[l] = hexc_val(*str++);
406 ep->value[l] = (ep->value[l] << 4) + hexc_val(*str++);
410 if (*str != 0 || (ep->class == EPD_MAC && l != 6))
412 ep->length = l;