Mercurial > hg > toybox
annotate toys/netcat.c @ 233:d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
toys/*.c. Move relevant info into comment at the top of each toys/*.c. Also
convert more of Makefile into a thin wrapper around shell scripts that actually
do the work. (Makefile is only still there for the user interface.)
author  Rob Landley <rob@landley.net> 

date  Sat, 19 Jan 2008 17:08:39 0600 
parents  30a6db5a95c2 
children  163498bf547b 
rev  line source 

233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

1 /* vi: set sw=4 ts=4: 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

2 * 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

3 * nc: mininetcat  Forward stdin/stdout to a file or network connection. 
189
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

4 * 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

5 * Copyright 2007 Rob Landley <rob@landley.net> 
194
30a6db5a95c2
Add comments about SUSv3 specs (or lack thereof).
Rob Landley <rob@landley.net>
parents:
189
diff
changeset

6 * 
30a6db5a95c2
Add comments about SUSv3 specs (or lack thereof).
Rob Landley <rob@landley.net>
parents:
189
diff
changeset

7 * Not in SUSv3. 
233
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

8 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

9 config NETCAT 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

10 bool "netcat" 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

11 default n 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

12 help 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

13 usage: netcat [iwlp] {IPADDR PORTNUMf FILENAME} [e COMMAND] 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

14 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

15 e exec the rest of the command line 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

16 i SECONDS delay after each line sent 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

17 w SECONDS timeout for connection 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

18 f filename use file (ala /dev/ttyS0) instead of network 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

19 l listen for incoming connection (twice for persistent connection) 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

20 p local port number 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

21 s local source address 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

22 q SECONDS quit this many seconds after EOF on stdin. 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

23 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

24 Use l twice with e for a quickanddirty server. 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

25 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

26 Use "stty 115200 F /dev/ttyS0 && stty raw echo ctlecho" with 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

27 netcat f to connect to a serial port. 
d4176f3f3835
Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents:
194
diff
changeset

28 */ 
189
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

29 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

30 #include "toys.h" 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

31 #include "toynet.h" 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

32 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

33 #define TT toy.netcat 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

34 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

35 static void timeout(int signum) 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

36 { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

37 error_exit("Timeout"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

38 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

39 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

40 // Translate x.x.x.x numeric IPv4 address, or else DNS lookup an IPv4 name. 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

41 void lookup_name(char *name, uint32_t *result) 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

42 { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

43 struct hostent *hostbyname; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

44 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

45 hostbyname = gethostbyname(*toys.optargs); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

46 if (!hostbyname) error_exit("name lookup failed"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

47 *result = *(uint32_t *)*hostbyname>h_addr_list; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

48 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

49 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

50 // Worry about a fancy lookup later. 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

51 void lookup_port(char *str, uint16_t *port) 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

52 { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

53 *port = SWAP_BE16(atoi(str)); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

54 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

55 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

56 void netcat_main(void) 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

57 { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

58 int sockfd, pollcount; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

59 struct pollfd pollfds[2]; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

60 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

61 if (TT.wait) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

62 signal(SIGALRM, timeout); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

63 alarm(TT.wait); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

64 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

65 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

66 if (TT.filename) pollfds[0].fd = xopen(TT.filename, O_RDWR); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

67 else { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

68 int temp; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

69 struct sockaddr_in address; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

70 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

71 // The argument parsing logic can't make "<2" conditional on "f", so... 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

72 if (!*toys.optargs  !toys.optargs[1]) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

73 toys.exithelp++; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

74 error_exit("Need address and port"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

75 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

76 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

77 // Setup socket 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

78 sockfd = socket(AF_INET, SOCK_STREAM, 0); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

79 if (1 == sockfd) perror_exit("socket"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

80 fcntl(sockfd, F_SETFD, FD_CLOEXEC); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

81 temp = 1; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

82 setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &temp, sizeof(temp)); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

83 memset(&address, 0, sizeof(address)); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

84 address.sin_family = AF_INET; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

85 if (TT.port) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

86 address.sin_port = TT.port; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

87 if (1 == bind(sockfd, &address, sizeof(address))) 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

88 perror_exit("bind"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

89 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

90 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

91 // Figure out where to dial out to. 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

92 lookup_name(*toys.optargs, (uint32_t *)&address.sin_addr); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

93 lookup_port(toys.optargs[1], &address.sin_port); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

94 temp = connect(sockfd, (struct sockaddr *)&address, sizeof(address)); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

95 if (temp<0) perror_exit("connect"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

96 pollfds[0].fd = sockfd; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

97 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

98 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

99 // We have a connection. Disarm timeout. 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

100 if (TT.wait) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

101 alarm(0); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

102 signal(SIGALRM, SIG_DFL); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

103 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

104 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

105 pollcount = 2; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

106 pollfds[1].fd = 0; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

107 pollfds[0].events = pollfds[1].events = POLLIN; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

108 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

109 // Poll loop copying stdin>socket and socket>stdout. 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

110 for (;;) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

111 int i; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

112 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

113 if (0>poll(pollfds, pollcount, 1)) perror_exit("poll"); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

114 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

115 for (i=0; i<pollcount; i++) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

116 if (pollfds[i].revents & POLLIN) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

117 int len = read(pollfds[i].fd, toybuf, sizeof(toybuf)); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

118 if (len<1) goto dohupnow; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

119 xwrite(i ? pollfds[0].fd : 1, toybuf, len); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

120 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

121 if (pollfds[i].revents & POLLHUP) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

122 dohupnow: 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

123 // Close halfconnect. This is needed for things like 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

124 // "echo GET /  netcat landley.net 80" to work. 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

125 if (i) { 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

126 shutdown(pollfds[0].fd, SHUT_WR); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

127 pollcount; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

128 } else goto cleanup; 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

129 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

130 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

131 } 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

132 cleanup: 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

133 close(pollfds[0].fd); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

134 // close(sockfd); 
22d22427dec6
Add first pass at netcat. Base applet, f, and w implemented.
Rob Landley <rob@landley.net>
parents:
diff
changeset

135 } 