Lines Matching refs:socknum
986 process_message(u_int socknum) in process_message() argument
994 if (socknum >= sockets_alloc) in process_message()
995 fatal_f("sock %u >= allocated %u", socknum, sockets_alloc); in process_message()
996 e = &sockets[socknum]; in process_message()
1004 socknum, e->fd, msg_len, AGENT_MAX_LEN); in process_message()
1022 debug_f("socket %u (fd=%d) type %d", socknum, e->fd, type); in process_message()
1125 handle_socket_read(u_int socknum) in handle_socket_read() argument
1134 fd = accept(sockets[socknum].fd, (struct sockaddr *)&sunaddr, &slen); in handle_socket_read()
1155 handle_conn_read(u_int socknum) in handle_conn_read() argument
1161 if ((len = read(sockets[socknum].fd, buf, sizeof(buf))) <= 0) { in handle_conn_read()
1166 socknum, sockets[socknum].fd, strerror(errno)); in handle_conn_read()
1170 if ((r = sshbuf_put(sockets[socknum].input, buf, len)) != 0) in handle_conn_read()
1174 if ((r = process_message(socknum)) == -1) in handle_conn_read()
1183 handle_conn_write(u_int socknum) in handle_conn_write() argument
1188 if (sshbuf_len(sockets[socknum].output) == 0) in handle_conn_write()
1190 if ((len = write(sockets[socknum].fd, in handle_conn_write()
1191 sshbuf_ptr(sockets[socknum].output), in handle_conn_write()
1192 sshbuf_len(sockets[socknum].output))) <= 0) { in handle_conn_write()
1197 socknum, sockets[socknum].fd, strerror(errno)); in handle_conn_write()
1201 if ((r = sshbuf_consume(sockets[socknum].output, len)) != 0) in handle_conn_write()
1210 u_int socknum, activefds = npfd; in after_poll() local
1216 for (socknum = 0; socknum < sockets_alloc; socknum++) { in after_poll()
1217 if (sockets[socknum].type != AUTH_SOCKET && in after_poll()
1218 sockets[socknum].type != AUTH_CONNECTION) in after_poll()
1220 if (pfd[i].fd == sockets[socknum].fd) in after_poll()
1223 if (socknum >= sockets_alloc) { in after_poll()
1228 switch (sockets[socknum].type) { in after_poll()
1237 if (handle_socket_read(socknum) == 0) in after_poll()
1242 handle_conn_read(socknum) != 0) { in after_poll()
1246 handle_conn_write(socknum) != 0) { in after_poll()
1250 close_socket(&sockets[socknum]); in after_poll()