Lines Matching refs:ifp
54 duid_make(unsigned char *d, const struct interface *ifp, uint16_t type)
65 u16 = htons(ifp->family);
77 memcpy(p, ifp->hwaddr, ifp->hwlen);
78 p += ifp->hwlen;
84 duid_get(unsigned char *d, const struct interface *ifp)
113 logger(ifp->ctx, LOG_ERR,
118 if (ifp->family == ARPHRD_NETROM) {
119 logger(ifp->ctx, LOG_WARNING,
120 "%s: is a NET/ROM psuedo interface", ifp->name);
121 TAILQ_FOREACH(ifp2, ifp->ctx->ifaces, next) {
126 ifp = ifp2;
127 logger(ifp->ctx, LOG_WARNING,
129 ifp->name);
131 logger(ifp->ctx, LOG_WARNING,
133 return duid_make(d, ifp, DUID_LL);
138 logger(ifp->ctx, LOG_ERR, "error writing DUID: %s: %m", DUID);
139 return duid_make(d, ifp, DUID_LL);
141 len = duid_make(d, ifp, DUID_LLT);
146 logger(ifp->ctx, LOG_ERR, "error writing DUID: %s: %m", DUID);
148 return duid_make(d, ifp, DUID_LL);
153 size_t duid_init(const struct interface *ifp)
156 if (ifp->ctx->duid == NULL) {
157 ifp->ctx->duid = malloc(DUID_LEN);
158 if (ifp->ctx->duid == NULL) {
159 logger(ifp->ctx, LOG_ERR, "%s: %m", __func__);
162 ifp->ctx->duid_len = duid_get(ifp->ctx->duid, ifp);
164 return ifp->ctx->duid_len;