plan 9 kernel history: overview | file list | diff list

1991/1109/port/net.c (diff list | history)

1991/1108/sys/src/9/port/net.c:34,401991/1109/sys/src/9/port/net.c:34,40 (short | long | prev | next)
1991/1107    
		case 0: 
			q.path = CHDIR | Q2nd; 
			strcpy(buf, np->name); 
			devdir(c, q, buf, 0, 0666, dp); 
1991/1109    
			devdir(c, q, buf, 0, eve, 0666, dp); 
1991/1107    
			break; 
		default: 
			return -1; 
1991/1108/sys/src/9/port/net.c:46,561991/1109/sys/src/9/port/net.c:46,56
1991/1108    
	if(STREAMID(c->qid.path) == 0){ 
1991/1107    
		if(i == 0){ 
			q.path = Qclone; 
			devdir(c, q, "clone", 0, 0666, dp); 
1991/1109    
			devdir(c, q, "clone", 0, eve, 0666, dp); 
1991/1107    
		}else if(i < np->nconv){ 
			q.path = CHDIR|STREAMQID(i, Q3rd); 
			sprint(buf, "%d", i); 
			devdir(c, q, buf, 0, 0666, dp); 
1991/1109    
			devdir(c, q, buf, 0, eve, 0666, dp); 
1991/1107    
		}else 
			return -1; 
		return 1; 
1991/1108/sys/src/9/port/net.c:60,761991/1109/sys/src/9/port/net.c:60,76
1991/1107    
	switch(i){ 
	case 0: 
		q.path = STREAMQID(STREAMID(c->qid.path), Sdataqid); 
		devdir(c, q, "data", 0, 0666, dp); 
1991/1109    
		devdir(c, q, "data", 0, eve, 0666, dp); 
1991/1107    
		break; 
	case 1: 
		q.path = STREAMQID(STREAMID(c->qid.path), Sctlqid); 
		devdir(c, q, "ctl", 0, 0666, dp); 
1991/1109    
		devdir(c, q, "ctl", 0, eve, 0666, dp); 
1991/1107    
		break; 
	case 2: 
		if(np->listen == 0) 
			return 0; 
		q.path = STREAMQID(STREAMID(c->qid.path), Qlisten); 
		devdir(c, q, "listen", 0, 0666, dp); 
1991/1109    
		devdir(c, q, "listen", 0, eve, 0666, dp); 
1991/1107    
		break; 
	default: 
		i -= 3; 
1991/1108/sys/src/9/port/net.c:77,831991/1109/sys/src/9/port/net.c:77,83
1991/1108    
		if(i >= np->ninfo) 
			return -1; 
		q.path = STREAMQID(STREAMID(c->qid.path), Qinf+i); 
1991/1107    
		devdir(c, q, np->info[i].name, 0, 0666, dp); 
1991/1109    
		devdir(c, q, np->info[i].name, 0, eve, 0666, dp); 
1991/1108    
		break; 
1991/1107    
	} 
	return 1; 
1991/1108/sys/src/9/port/net.c:117,1231991/1109/sys/src/9/port/net.c:117,123
1991/1108    
			 * here, which is good because we've lost the name by now. 
			 */ 
			if(c->qid.path & CHDIR){ 
				devdir(c, c->qid, ".", 0L, CHDIR|0700, &dir); 
1991/1109    
				devdir(c, c->qid, ".", 0L, eve, CHDIR|0700, &dir); 
1991/1108    
				convD2M(&dir, db); 
				return; 
			} 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)