henesyinit from p9fce6d0435 years agoHistory
36 lines · 428 B · C
RawDownload
#include <u.h>#include <ctype.h> /* *  return ndb attribute type of an ip name */char*ipattr(char *name){	char *p;	int dot = 0;	int alpha = 0; 	for(p = name; *p; p++){		if(isdigit(*p))			;		else if(isalpha(*p) || *p == '-')			alpha = 1;		else if(*p == '.')			dot = 1;		else			return "sys";	} 	if(alpha){		if(dot)			return "dom";		else			return "sys";	} 	if(dot)		return "ip";	else		return "sys";}

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