return (-1);
/* Validate Ethernet address. */
- if (bcmp(d->myea, eh->ether_dhost, 6) != 0 &&
- bcmp(bcea, eh->ether_dhost, 6) != 0) {
+ if (bcmp(d->myea, eh->ether_dhost, ETHER_ADDR_LEN) != 0 &&
+ bcmp(bcea, eh->ether_dhost, ETHER_ADDR_LEN) != 0) {
#ifdef ETHER_DEBUG
if (debug)
printf("readether: not ours (ea=%s)\n",
ether_sprintf(u_char *ap)
{
int i;
- static char etherbuf[18];
+ static char etherbuf[3 * ETHER_ADDR_LEN];
char *cp = etherbuf;
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < ETHER_ADDR_LEN; i++) {
*cp++ = digits[*ap >> 4];
*cp++ = digits[*ap++ & 0xf];
*cp++ = ':';
.\"
.\" $FreeBSD: src/lib/libstand/libstand.3,v 1.5.2.11 2002/06/26 19:14:43 schweikh Exp $
.\"
-.Dd February 15, 2009
+.Dd December 29, 2012
.Dt LIBSTAND 3
.Os
.Sh NAME
.Dv EOF ,
or 1 if the user elects to quit while reading.
.El
+.Sh NETWORK
+.Bl -hang -width 10n
+.It Xo
+.Ft "char *"
+.Fn ether_sprintf "u_char *ap"
+.Xc
+.Pp
+Convert an ethernet address to its human readable notation as specified in IEEE 802.
+.El
.Sh MISC
.Bl -hang -width 10n
.It Xo
void bootp(int, int);
/* Utilities: */
-char *ether_sprintf(u_char *);
int in_cksum(void *, int);
char *inet_ntoa(struct in_addr);
char *intoa(n_long); /* similar to inet_ntoa */
extern int optind, opterr, optopt, optreset;
extern int getopt(int, char * const [], const char *);
+/* ether.c */
+extern char *ether_sprintf(u_char *);
+
/* pager.c */
extern void pager_open(void);
extern void pager_close(void);