Lines Matching refs:sock

61 	int sock;  member
102 len = send(client->sock, buf, p - buf, 0); in tftp_send_data()
110 static int tftp_send_ack(int sock, int block) in tftp_send_ack() argument
117 return send(sock, &ack, sizeof(ack), 0); in tftp_send_ack()
120 static int tftp_send_oack(int sock, size_t *blocksize, size_t *tsize, in tftp_send_oack() argument
175 return send(sock, buf, p - buf, 0); in tftp_send_oack()
178 static int tftp_send_error(int sock, int code, const char *msg) in tftp_send_error() argument
194 rc = send(sock, buf, len, 0); in tftp_send_error()
214 int sock; in handle_rrq() local
262 sock = qrtr_open(0); in handle_rrq()
263 if (sock < 0) { in handle_rrq()
269 ret = connect(sock, (struct sockaddr *)sq, sizeof(*sq)); in handle_rrq()
279 tftp_send_error(sock, 1, "file not found"); in handle_rrq()
290 client->sock = sock; in handle_rrq()
302 tftp_send_oack(client->sock, &blksize, in handle_rrq()
317 int sock; in handle_wrq() local
339 sock = qrtr_open(0); in handle_wrq()
340 if (sock < 0) { in handle_wrq()
346 ret = connect(sock, (struct sockaddr *)sq, sizeof(*sq)); in handle_wrq()
355 client->sock = sock; in handle_wrq()
358 ret = tftp_send_ack(client->sock, 0); in handle_wrq()
361 close(sock); in handle_wrq()
385 len = recvfrom(client->sock, buf, sizeof(buf), 0, (void *)&sq, &sl); in handle_reader()
440 len = recvfrom(client->sock, buf, sizeof(buf), 0, (void *)&sq, &sl); in handle_writer()
457 tftp_send_error(client->sock, 4, "Expected DATA opcode"); in handle_writer()
470 tftp_send_ack(client->sock, block); in handle_writer()
478 close(client->sock); in client_close_and_free()
516 FD_SET(client->sock, &rfds); in main()
517 nfds = MAX(nfds, client->sock); in main()
521 FD_SET(client->sock, &rfds); in main()
522 nfds = MAX(nfds, client->sock); in main()
536 if (FD_ISSET(client->sock, &rfds)) { in main()
544 if (FD_ISSET(client->sock, &rfds)) { in main()