ソースコード (27/28) void pptp_gre_copy(u_int16_t call_id, u_int16_t peer_call_id, int pty_fd, struct in_addr inetaddr) { .... s = socket(AF_INET, SOCK_RAW, PPTP_PROTO); ... while (stat1>=0 && stat2>=0) { /* Dispatch loop */ ... FD_SET(s, &rfds); FD_SET(pty_fd,&rfds); ... if (ack_sent!=seq_recv) retval = select(n, &rfds, NULL, NULL, &tv); ... if (retval==0 && ack_sent!=seq_recv) /* if outstanding ack */ encaps_gre(s, NULL, 0); /* send ack with no payload */ if (FD_ISSET(pty_fd, &rfds)) /* data waiting on pterm */ stat1=decaps_hdlc(pty_fd, encaps_gre, s); if (FD_ISSET(s, &rfds)) /* data waiting on socket */ stat2=decaps_gre(s, encaps_hdlc, pty_fd); } close(s); close(pty_fd); /* Close up when done. */ }