|
|
1.1 ! root 1: #include "u.h" ! 2: #include "../port/lib.h" ! 3: #include "mem.h" ! 4: #include "dat.h" ! 5: #include "fns.h" ! 6: #include "../port/error.h" ! 7: ! 8: /* ! 9: * This is a prototype file for writing a new network protocol ! 10: */ ! 11: ! 12: static void nulloput(Queue*, Block*); ! 13: static void protooput(Queue*, Block*); ! 14: static void protoiput(Queue*, Block*); ! 15: ! 16: static Qinfo XXXprotold = ! 17: { ! 18: protoiput, ! 19: protooput, ! 20: 0, ! 21: 0, ! 22: "proto", ! 23: 0 ! 24: }; ! 25: ! 26: static Qinfo XXXmuxld = ! 27: { ! 28: 0, ! 29: nulloput, ! 30: 0, ! 31: 0, ! 32: "mux" ! 33: }; ! 34: ! 35: static void ! 36: protooput(Queue *q, Block *bp) ! 37: { ! 38: PUTNEXT(q, bp); ! 39: } ! 40: ! 41: static void ! 42: protoiput(Queue *q, Block *bp) ! 43: { ! 44: PUTNEXT(q, bp); ! 45: } ! 46: ! 47: static void ! 48: nulloput(Queue *q, Block *bp) ! 49: { ! 50: freeb(bp); ! 51: } ! 52: ! 53: static void XXXaddr(Chan*, char*, int); ! 54: static void XXXother(Chan*, char*, int); ! 55: static void XXXraddr(Chan*, char*, int); ! 56: static void XXXruser(Chan*, char*, int); ! 57: static int XXXclone(Chan*); ! 58: static void XXXconnect(Chan*, char*); ! 59: ! 60: Network netXXX = ! 61: { ! 62: "XXX", ! 63: 4, ! 64: 32, /* # conversations */ ! 65: &XXXmuxld, ! 66: &XXXprotold, ! 67: 0, /* no listener */ ! 68: XXXclone, ! 69: XXXconnect, ! 70: 0, /* no announces */ ! 71: 4, /* info files */ ! 72: { { "addr", XXXaddr, }, ! 73: { "other", XXXother, }, ! 74: { "raddr", XXXraddr, }, ! 75: { "ruser", XXXruser, }, ! 76: }, ! 77: }; ! 78: ! 79: static void ! 80: XXXaddr(Chan *c, char *buf, int len) ! 81: { ! 82: strncpy(buf, "my address", len-1); ! 83: } ! 84: ! 85: static void ! 86: XXXother(Chan *c, char *buf, int len) ! 87: { ! 88: strncpy(buf, "other stuff", len-1); ! 89: } ! 90: ! 91: static void ! 92: XXXraddr(Chan *c, char *buf, int len) ! 93: { ! 94: strncpy(buf, "remote address", len-1); ! 95: } ! 96: ! 97: static void ! 98: XXXruser(Chan *c, char *buf, int len) ! 99: { ! 100: strncpy(buf, "remote user", len-1); ! 101: } ! 102: ! 103: static int ! 104: XXXclone(Chan *c) ! 105: { ! 106: return 5; ! 107: } ! 108: ! 109: static void ! 110: XXXconnect(Chan *c, char *dest) ! 111: { ! 112: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.