| /plan9/sys/src/cmd/auth/secstore/ |
| H A D | aescbc.c | 23 safewrite(uchar *buf, int n) in safewrite() argument 25 if(Bwrite(&bout, buf, n) != n) in safewrite() 30 saferead(uchar *buf, int n) in saferead() argument 32 if(Bread(&bin, buf, n) != n) in saferead() 43 uchar buf[BUF+SHA1dlen]; /* assumption: CHK <= SHA1dlen */ in main() local 68 n = readn(3, buf, (sizeof buf)-1); in main() 71 buf[n] = 0; in main() 72 while(buf[n-1] == '\n') in main() 73 buf[--n] = 0; in main() 77 strecpy((char*)buf, (char*)buf+sizeof buf, (char*)nvr.config); in main() [all …]
|
| /plan9/sys/src/9/boot/ |
| H A D | aux.c | 59 char buf[ERRMAX]; in warning() local 61 buf[0] = '\0'; in warning() 62 errstr(buf, sizeof buf); in warning() 63 fprint(2, "boot: %s: %s\n", s, buf); in warning() 70 char buf[ERRMAX]; in fatal() local 72 buf[0] = '\0'; in fatal() 73 errstr(buf, sizeof buf); in fatal() 74 msg = smprint("%s: %s", s, buf); in fatal() 80 readfile(char *name, char *buf, int len) in readfile() argument 84 buf[0] = 0; in readfile() [all …]
|
| H A D | bootip.c | 103 char buf[128]; in setauthaddr() local 105 snprint(buf, sizeof buf, "%s!%I!%d", proto, auip, port); in setauthaddr() 106 authaddr = strdup(buf); in setauthaddr() 122 char buf[64]; in connecttcp() local 124 snprint(buf, sizeof buf, "tcp!%I!564", fsip); in connecttcp() 125 dprint("dial %s...", buf); in connecttcp() 126 fd = dial(buf, 0, 0, 0); in connecttcp() 128 werrstr("dial %s: %r", buf); in connecttcp() 146 char buf[128]; in netenv() local 149 snprint(buf, sizeof(buf), "#e/%s", attr); in netenv() [all …]
|
| /plan9/sys/src/cmd/aux/ |
| H A D | mouse.c | 47 dumpbuf(char *buf, int nbytes, char *s) in dumpbuf() argument 51 print("#%ux ", *buf++ & 0xFF); in dumpbuf() 74 char buf[ERRMAX]; in readbyte() local 79 errstr(buf, sizeof buf); in readbyte() 80 if(strcmp(buf, "interrupted") == 0) in readbyte() 82 fprint(2, "%s: readbyte failed - %s\n", argv0, buf); in readbyte() 90 slowread(int fd, char *buf, int nbytes, char *msg) in slowread() argument 95 for(p = buf; nbytes > 1 && (c = readbyte(fd)) != -1; *p++ = c, nbytes--) in slowread() 98 DEBUG dumpbuf(buf, p-buf, msg); in slowread() 99 return p-buf; in slowread() [all …]
|
| /plan9/sys/src/9/bcm/ |
| H A D | vcore.c | 112 vcreq(int tag, void *buf, int vallen, int rsplen) in vcreq() argument 131 memmove(prop->data, buf, vallen); in vcreq() 147 memmove(buf, prop->data, rsplen); in vcreq() 161 u32int buf[3]; in fbdefault() local 163 if(vcreq(TagGetres, &buf[0], 0, 2*4) != 2*4 || in fbdefault() 164 vcreq(TagGetdepth, &buf[2], 0, 4) != 4) in fbdefault() 166 *width = buf[0]; in fbdefault() 167 *height = buf[1]; in fbdefault() 168 *depth = buf[2]; in fbdefault() 200 u32int buf[1]; in fbblank() local [all …]
|
| /plan9/sys/src/cmd/disk/kfs/ |
| H A D | ofcallfmt.c | 10 char buf[512]; in ofcallfmt() local 21 sprint(buf, "Tnop9p1 tag %ud", tag); in ofcallfmt() 24 sprint(buf, "Rnop9p1 tag %ud", tag); in ofcallfmt() 27 sprint(buf, "Tsession9p1 tag %ud", tag); in ofcallfmt() 30 sprint(buf, "Rsession9p1 tag %ud", tag); in ofcallfmt() 33 sprint(buf, "Rerror9p1 tag %ud error %.64s", tag, f->ename); in ofcallfmt() 36 sprint(buf, "Tflush9p1 tag %ud oldtag %d", tag, f->oldtag); in ofcallfmt() 39 sprint(buf, "Rflush9p1 tag %ud", tag); in ofcallfmt() 42 sprint(buf, "Tattach9p1 tag %ud fid %d uname %.28s aname %.28s auth %.28s", in ofcallfmt() 46 sprint(buf, "Rattach9p1 tag %ud fid %d qid 0x%lux|0x%lux", in ofcallfmt() [all …]
|
| /plan9/sys/src/cmd/unix/drawterm/libsec/ |
| H A D | blowfish.c | 20 u32int n, buf[2]; in setupBFstate() local 23 memset(buf, 0, sizeof buf); in setupBFstate() 61 bfencrypt(buf, s); in setupBFstate() 62 s->pbox[i] = buf[0]; in setupBFstate() 63 s->pbox[i+1] = buf[1]; in setupBFstate() 67 bfencrypt(buf, s); in setupBFstate() 68 s->sbox[i] = buf[0]; in setupBFstate() 69 s->sbox[i+1] = buf[1]; in setupBFstate() 76 bfCBCencrypt(uchar *buf, int n, BFstate *s) in bfCBCencrypt() argument 87 for(i=0; i < n; i += 8, buf += 8) { in bfCBCencrypt() [all …]
|
| /plan9/sys/src/libsec/port/ |
| H A D | blowfish.c | 20 u32int n, buf[2]; in setupBFstate() local 23 memset(buf, 0, sizeof buf); in setupBFstate() 61 bfencrypt(buf, s); in setupBFstate() 62 s->pbox[i] = buf[0]; in setupBFstate() 63 s->pbox[i+1] = buf[1]; in setupBFstate() 67 bfencrypt(buf, s); in setupBFstate() 68 s->sbox[i] = buf[0]; in setupBFstate() 69 s->sbox[i+1] = buf[1]; in setupBFstate() 76 bfCBCencrypt(uchar *buf, int n, BFstate *s) in bfCBCencrypt() argument 87 for(i=0; i < n; i += 8, buf += 8) { in bfCBCencrypt() [all …]
|
| /plan9/sys/src/libflate/ |
| H A D | adler.c | 15 uchar *buf, *ebuf; in adler32() local 18 buf = vbuf; in adler32() 26 for(ebuf = buf + m; buf < ebuf; buf += 16){ in adler32() 27 s1 += buf[0]; in adler32() 29 s1 += buf[1]; in adler32() 31 s1 += buf[2]; in adler32() 33 s1 += buf[3]; in adler32() 35 s1 += buf[4]; in adler32() 37 s1 += buf[5]; in adler32() 39 s1 += buf[6]; in adler32() [all …]
|
| /plan9/sys/src/cmd/mk/ |
| H A D | lex.c | 10 assline(Biobuf *bp, Bufblock *buf) in assline() argument 15 buf->current=buf->start; in assline() 22 if (buf->current != buf->start) { in assline() 23 insert(buf, 0); in assline() 30 rinsert(buf, c); in assline() 31 if (escapetoken(bp, buf, 1, c) == 0) in assline() 35 if (bquote(bp, buf) == 0) in assline() 49 if (buf->current != buf->start) { in assline() 50 insert(buf, 0); in assline() 55 rinsert(buf, c); in assline() [all …]
|
| /plan9/sys/src/libventi/ |
| H A D | fcall.c | 8 uchar buf[4]; in vtfcallpack() local 13 buf[0] = f->msgtype; in vtfcallpack() 14 buf[1] = f->tag; in vtfcallpack() 15 packetappend(p, buf, 2); in vtfcallpack() 37 buf[0] = f->strength; in vtfcallpack() 38 buf[1] = f->ncrypto; in vtfcallpack() 39 packetappend(p, buf, 2); in vtfcallpack() 41 buf[0] = f->ncodec; in vtfcallpack() 42 packetappend(p, buf, 1); in vtfcallpack() 49 buf[0] = f->rcrypto; in vtfcallpack() [all …]
|
| /plan9/sys/src/libc/9sys/ |
| H A D | announce.c | 19 char buf[Maxpath]; in announce() local 50 n = snprint(buf, sizeof(buf), "%s/", netdir); in announce() 51 m = read(ctl, &buf[n], sizeof(buf)-n-1); in announce() 57 buf[n+m] = 0; in announce() 73 strncpy(dir, buf, NETPATHLEN); in announce() 86 char buf[Maxpath]; in listen() local 92 snprint(buf, sizeof(buf), "%s/listen", dir); in listen() 93 ctl = open(buf, ORDWR); in listen() 95 werrstr("listen opening %s: %r", buf); in listen() 102 strncpy(buf, dir, sizeof(buf) - 1); in listen() [all …]
|
| H A D | fcallfmt.c | 16 char buf[512], tmp[200]; in fcallfmt() local 21 e = buf+sizeof(buf); in fcallfmt() 28 seprint(buf, e, "Tversion tag %ud msize %ud version '%s'", tag, f->msize, f->version); in fcallfmt() 31 seprint(buf, e, "Rversion tag %ud msize %ud version '%s'", tag, f->msize, f->version); in fcallfmt() 34 seprint(buf, e, "Tauth tag %ud afid %d uname %s aname %s", tag, in fcallfmt() 38 seprint(buf, e, "Rauth tag %ud qid " QIDFMT, tag, in fcallfmt() 42 seprint(buf, e, "Tattach tag %ud fid %d afid %d uname %s aname %s", tag, in fcallfmt() 46 seprint(buf, e, "Rattach tag %ud qid " QIDFMT, tag, in fcallfmt() 50 seprint(buf, e, "Rerror tag %ud ename %s", tag, f->ename); in fcallfmt() 53 seprint(buf, e, "Tflush tag %ud oldtag %ud", tag, f->oldtag); in fcallfmt() [all …]
|
| /plan9/sys/src/cmd/ssh2/ |
| H A D | ssh2.c | 206 char buf[Arbbufsz]; in cmdmode() local 213 m = read(0, buf + n, sizeof buf - n - 1); in cmdmode() 216 write(1, buf + n, m); in cmdmode() 218 buf[n] = '\0'; in cmdmode() 219 if (buf[n-1] == ('u' & 037)) in cmdmode() 221 } while (buf[n-1] != '\n' && buf[n-1] != '\r'); in cmdmode() 222 switch (buf[0]) { in cmdmode() 247 keyprompt(char *buf, int size, int n) in keyprompt() argument 249 if (*buf == 'c') { in keyprompt() 251 write(kconsfd, buf+5, n); in keyprompt() [all …]
|
| /plan9/sys/src/cmd/auth/ |
| H A D | passwd.c | 10 asrdresp(int fd, char *buf, int len) in asrdresp() argument 14 if(read(fd, buf, 1) != 1){ in asrdresp() 19 switch(buf[0]){ in asrdresp() 21 if(readn(fd, buf, len) < 0){ in asrdresp() 50 char buf[512]; in main() local 76 convTR2M(&tr, buf); in main() 77 if(write(fd, buf, TICKREQLEN) != TICKREQLEN) in main() 79 if(asrdresp(fd, buf, TICKETLEN) < 0) in main() 81 memmove(tbuf, buf, TICKETLEN); in main() 98 readln("change Plan 9 Password? (y/n) ", buf, sizeof buf, 0); in main() [all …]
|
| /plan9/sys/src/cmd/unix/u9fs/ |
| H A D | fcallconv.c | 18 char buf[512], tmp[200]; in fcallconv() local 28 sprint(buf, "Tversion tag %ud msize %ud version '%s'", tag, f->msize, f->version); in fcallconv() 31 sprint(buf, "Rversion tag %ud msize %ud version '%s'", tag, f->msize, f->version); in fcallconv() 34 sprint(buf, "Tauth tag %ud afid %d uname %s aname %s", tag, in fcallconv() 38 sprint(buf, "Rauth tag %ud qid " QIDFMT, tag, in fcallconv() 42 sprint(buf, "Tattach tag %ud fid %d afid %d uname %s aname %s", tag, in fcallconv() 46 sprint(buf, "Rattach tag %ud qid " QIDFMT, tag, in fcallconv() 50 sprint(buf, "Rerror tag %ud ename %s", tag, f->ename); in fcallconv() 53 sprint(buf, "Tflush tag %ud oldtag %ud", tag, f->oldtag); in fcallconv() 56 sprint(buf, "Rflush tag %ud", tag); in fcallconv() [all …]
|
| /plan9/sys/src/ape/lib/ap/plan9/ |
| H A D | dirread.c | 8 statcheck(uchar *buf, uint nbuf) in statcheck() argument 13 ebuf = buf + nbuf; in statcheck() 15 buf += STATFIXLEN - 4 * BIT16SZ; in statcheck() 18 if(buf + BIT16SZ > ebuf) in statcheck() 20 buf += BIT16SZ + GBIT16(buf); in statcheck() 23 if(buf != ebuf) in statcheck() 31 dirpackage(uchar *buf, long ts, Dir **d) in dirpackage() argument 47 m = BIT16SZ + GBIT16(&buf[i]); in dirpackage() 48 if(statcheck(&buf[i], m) < 0) in dirpackage() 67 m = BIT16SZ + GBIT16((uchar*)&buf[i]); in dirpackage() [all …]
|
| /plan9/sys/src/cmd/auth/lib/ |
| H A D | netcheck.c | 11 uchar buf[8]; in checksum() local 13 memset(buf, 0, 8); in checksum() 14 encrypt(key, buf, 8); in checksum() 15 sprint(csum, "C %.2ux%.2ux%.2ux%.2ux", buf[0], buf[1], buf[2], buf[3]); in checksum() 27 uchar buf[8]; in netresp() local 29 memset(buf, 0, 8); in netresp() 30 snprint((char *)buf, sizeof buf, "%lud", chal); in netresp() 31 if(encrypt(key, buf, 8) < 0) in netresp() 33 chal = (buf[0]<<24)+(buf[1]<<16)+(buf[2]<<8)+buf[3]; in netresp() 87 uchar buf[2*8]; in smartcheck() local [all …]
|
| /plan9/sys/src/cmd/ |
| H A D | netstat.c | 30 char buf[128]; in main() local 78 snprint(buf, sizeof buf, "%s/%s/0/local", netroot, d[i].name); in main() 79 if(access(buf, 0) >= 0) in main() 91 char buf[128]; in nstat() local 93 snprint(buf, sizeof buf, "%s/%s", netroot, net); in nstat() 94 fdir = open(buf, OREAD); in nstat() 126 char buf[128], *p; in pip() local 134 snprint(buf, sizeof buf, "%s/%s/%s/status", netroot, net, db->name); in pip() 135 fd = open(buf, OREAD); in pip() 138 n = read(fd, buf, sizeof(buf)); in pip() [all …]
|
| H A D | webfsget.c | 8 char buf[12*1024]; in xfer() local 11 while((n = read(from, buf, sizeof buf)) > 0) in xfer() 12 if(write(to, buf, n) < 0) in xfer() 29 char buf[128], *base, *mtpt, *post, *url; in main() local 53 snprint(buf, sizeof buf, "%s/clone", mtpt); in main() 54 if((ctlfd = open(buf, ORDWR)) < 0) in main() 55 sysfatal("couldn't open %s: %r", buf); in main() 56 if((n = read(ctlfd, buf, sizeof buf-1)) < 0) in main() 60 buf[n] = '\0'; in main() 61 conn = atoi(buf); in main() [all …]
|
| /plan9/sys/src/cmd/9nfs/ |
| H A D | chat.c | 16 char buf[NSIZE]; in killchat() local 20 snprint(buf, sizeof buf, "/proc/%d/note", chatpid); in killchat() 21 fd = open(buf, OWRITE); in killchat() 30 char *p, buf[256]; in chatsrv() local 61 n = read(pfd[0], buf, sizeof(buf)-1); in chatsrv() 66 buf[n] = 0; in chatsrv() 67 if(buf[0] == 'c') in chatsrv() 69 chatty = strtol(buf, 0, 0); in chatsrv() 83 char buf[SIZE]; in chat() local 90 fmtfdinit(&f, 2, buf, sizeof buf); in chat() [all …]
|
| /plan9/sys/src/cmd/ext2srv/ |
| H A D | chat.c | 17 char buf[SIZE], *out; in chat() local 24 out = vseprint(buf, buf+sizeof(buf), fmt, arg); in chat() 26 write(2, buf, (long)(out-buf)); in chat() 32 char buf[SIZE], *out; in mchat() local 36 out = vseprint(buf, buf+sizeof(buf), fmt, arg); in mchat() 38 write(2, buf, (long)(out-buf)); in mchat() 43 char buf[SIZE]; in panic() local 47 n = sprint(buf, "%s %d: panic ", argv0, getpid()); in panic() 49 vseprint(buf+n, buf+sizeof(buf)-n, fmt, arg); in panic() 51 fprint(2, "%s: %r\n", buf); in panic()
|
| /plan9/sys/src/cmd/webfs/ |
| H A D | webget.c | 10 char buf[12*1024]; in xfer() local 13 while((n = read(from, buf, sizeof buf)) > 0) in xfer() 14 if(write(to, buf, n) < 0) in xfer() 31 char buf[128], *base, *mtpt, *post, *url; in main() local 55 snprint(buf, sizeof buf, "%s/clone", mtpt); in main() 56 if((ctlfd = open(buf, ORDWR)) < 0) in main() 57 sysfatal("couldn't open %s: %r", buf); in main() 58 if((n = read(ctlfd, buf, sizeof buf-1)) < 0) in main() 62 buf[n] = '\0'; in main() 63 conn = atoi(buf); in main() [all …]
|
| /plan9/sys/src/libplumb/ |
| H A D | mesg.c | 10 char buf[128], err[ERRMAX]; in plumbopen() local 38 snprint(buf, sizeof buf, "%s/%s", plumber, name); in plumbopen() 39 fd = open(buf, omode); in plumbopen() 45 fd = create(buf, omode, 0600); in plumbopen() 71 quote(char *s, char *buf, char *bufe) in quote() argument 77 buf[0] = '\0'; in quote() 78 return buf; in quote() 82 t = buf; in quote() 94 return buf; in quote() 102 char *s, *t, *buf, *bufe; in plumbpackattr() local [all …]
|
| /plan9/sys/src/cmd/cec/ |
| H A D | plan9.c | 13 char buf[128], ctl[13]; in netopen0() local 16 snprint(buf, sizeof buf, "%s/clone", e); in netopen0() 17 if((efd = open(buf, ORDWR)) == -1) in netopen0() 23 snprint(buf, sizeof buf, "connect %d", Etype); in netopen0() 24 if(write(efd, buf, strlen(buf)) != strlen(buf)) in netopen0() 26 snprint(buf, sizeof buf, "%s/%d/ctl", e, n); in netopen0() 27 if((cfd = open(buf, ORDWR)) < 0) in netopen0() 29 snprint(buf, sizeof buf, "nonblocking"); in netopen0() 30 if(write(cfd, buf, strlen(buf)) != strlen(buf)) in netopen0() 32 snprint(buf, sizeof buf, "%s/%d/data", e, n); in netopen0() [all …]
|