Lines Matching refs:type

52     int type;
84 static int _socket(int type) {
90 switch (type) {
126 static int _close(int fd, int type) {
137 static int _bind(int fd, int type) {
142 switch (type) {
174 static int _listen(int fd, int type) {
198 static int _accept(int fd, int type) {
203 switch (type) {
251 static int _connect(int fd, int type) {
256 switch (type) {
288 static int _write(int fd, int type) {
334 _close(args->fd, args->type);
375 _accept(args->fd, args->type);
382 _connect(args->fd, args->type);
389 _close(args->fd, args->type);
391 _write(args->fd, args->type);
398 _accept(args->fd, args->type);
400 _write(args->fd, args->type);
407 args->fd = _socket(args->type);
408 _connect(args->fd, args->type);
412 static int do_accept_accept_accept(int type) {
415 fd = _socket(type);
418 if (_bind(fd, type) < 0) goto error;
420 if (_listen(fd, type) < 0) goto error;
423 _accept(fd, type);
432 static int do_accept_and_close(int type) {
435 struct thread_args args = {-1, type, 1};
437 fd = _socket(type);
440 if (_bind(fd, type) < 0) goto error;
442 if (_listen(fd, type) < 0) goto error;
447 _accept(fd, type);
457 static int do_accept_shutdown(int type) {
460 struct thread_args args = {-1, type, 0};
462 fd = _socket(type);
465 if (_bind(fd, type) < 0) goto error;
467 if (_listen(fd, type) < 0) goto error;
477 _close(fd, type);
485 static int do_connect_shutdown(int type) {
488 struct thread_args args = {-1, type, 0};
490 fd = _socket(type);
501 _close(fd, type);
509 static int do_connectnb_shutdown(int type) {
513 struct thread_args args = {-1, type, 0};
516 fd = _socket(type);
525 _connect(fd, type);
532 _close(fd, type);
540 static int do_connectnb_close(int type) {
543 struct thread_args args = {-1, type, 0};
546 fd = _socket(type);
555 _connect(fd, type);
559 _close(fd, type);
568 static int do_accept_close_write(int type) {
571 struct thread_args args = {-1, type, 1};
573 fd = _socket(type);
576 if (_bind(fd, type) < 0) goto error;
578 if (_listen(fd, type) < 0) goto error;
583 _accept(fd, type);
593 static int do_poll_poll_poll_shutdown(int type) {
599 fd = _socket(type);
611 _close(fd, type);
616 static int do_poll_poll_poll_close(int type) {
622 fd = _socket(type);
629 _close(fd, type);
637 static int do_read_read_read_close(int type) {
643 fd = _socket(type);
650 _close(fd, type);
658 static int do_read_read_read_shutdown(int type) {
664 fd = _socket(type);
676 _close(fd, type);
681 static int do_connected_read1_shutdown1(int type) {
685 struct thread_args a1 = {-1, type, 0};
686 struct thread_args a2 = {-1, type, 2};
688 fd1 = _socket(type);
691 if (_bind(fd1, type) < 0) goto error;
693 if (_listen(fd1, type) < 0) goto error;
698 fd2 = _socket(type);
699 if (_connect(fd2, type)) goto error;
715 static int do_accept_connect_connect(int type) {
719 struct thread_args a1 = {-1, type, 1};
720 struct thread_args a2 = {-1, type, 2};
722 fd = _socket(type);
725 if (_bind(fd, type) < 0) goto error;
727 if (_listen(fd, type) < 0) goto error;
732 _accept(fd, type);
765 enum sock_type type;
791 int type = -1;
799 type = type_table[i].type;
803 if (type == -1) {
809 printf("TYPE = %s ACTION = %s\n", type_table[type].name,
811 return (*action_table[i].ptr)(type);