henesyinit from p9fce6d0435 years agoHistory
26 lines · 515 B · C
RawDownload
#include <u.h>#include <libc.h>#include "ip.h" inteipconv(void *v, Fconv *f){	static char buf[64];	static char *efmt = "%.2lux%.2lux%.2lux%.2lux%.2lux%.2lux";	static char *ifmt = "%d.%d.%d.%d";	uchar *p; 	p = *((uchar**)v);	switch(f->chr) {	case 'E':		/* Ethernet address */		sprint(buf, efmt, p[0], p[1], p[2], p[3], p[4], p[5]);		break;	case 'I':		/* Ip address */		sprint(buf, ifmt, p[0], p[1], p[2], p[3]);		break;	default:		strcpy(buf, "BAD");	}	strconv(buf, f);	return sizeof(uchar*);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t