2 #include <sys/socket.h>
3 #include <netinet/in.h>
10 fprint(2, "usage: vmount [-v] [-h handle] address mountpoint\n");
17 0x42, 0x09, 0x9B, 0x4A, 0xF0, 0x21, 0xE5, 0x3F, 0xD8, 0xFD,
18 0x4E, 0x05, 0x6C, 0x25, 0x68, 0xD7, 0xC2, 0xE3, 0xFF, 0xA8
22 main(int argc, char **argv)
26 int n, port, proto, verbose;
27 struct sockaddr_in sa;
35 sysfatal("bad handle '%s'", p);
36 if(n > 2*sizeof handle)
37 sysfatal("handle too long '%s'", p);
39 if(dec16(handle, n/2, p, n) != n/2)
40 sysfatal("bad hex in handle '%s'", p);
54 p = p9netmkaddr(argv[0], "udp", "nfs");
55 if(p9dialparse(strdup(p), &net, &unx, &host, &port) < 0)
56 sysfatal("bad address '%s'", p);
59 print("nfs server is net=%s addr=%d.%d.%d.%d port=%d\n",
60 net, host&0xFF, (host>>8)&0xFF, (host>>16)&0xFF, host>>24, port);
63 if(strcmp(net, "tcp") == 0)
65 else if(strcmp(net, "udp") == 0)
68 sysfatal("bad proto %s: can only handle tcp and udp", net);
70 memset(&sa, 0, sizeof sa);
71 memmove(&sa.sin_addr, &host, 4);
72 sa.sin_family = AF_INET;
73 sa.sin_port = htons(port);
75 mountnfs(proto, &sa, handle, handlelen, argv[1]);