Lines Matching refs:rc
263 int rc; in tcp_md5sig() local
287 rc = setsockopt(sd, IPPROTO_TCP, opt, &md5sig, sizeof(md5sig)); in tcp_md5sig()
288 if (rc < 0) { in tcp_md5sig()
291 rc = 0; in tcp_md5sig()
296 return rc; in tcp_md5sig()
337 int sd, rc; in get_ifidx() local
352 rc = ioctl(sd, SIOCGIFINDEX, (char *)&ifdata); in get_ifidx()
354 if (rc != 0) { in get_ifidx()
364 int rc; in bind_to_device() local
366 rc = setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, name, strlen(name)+1); in bind_to_device()
367 if (rc < 0) in bind_to_device()
370 return rc; in bind_to_device()
375 int rc; in get_bind_to_device() local
379 rc = getsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, name, &optlen); in get_bind_to_device()
380 if (rc < 0) in get_bind_to_device()
383 return rc; in get_bind_to_device()
417 int rc; in set_pktinfo_v4() local
419 rc = setsockopt(sd, SOL_IP, IP_PKTINFO, &one, sizeof(one)); in set_pktinfo_v4()
420 if (rc < 0 && rc != -ENOTSUP) in set_pktinfo_v4()
423 return rc; in set_pktinfo_v4()
429 int rc; in set_recvpktinfo_v6() local
431 rc = setsockopt(sd, SOL_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one)); in set_recvpktinfo_v6()
432 if (rc < 0 && rc != -ENOTSUP) in set_recvpktinfo_v6()
435 return rc; in set_recvpktinfo_v6()
441 int rc; in set_recverr_v4() local
443 rc = setsockopt(sd, SOL_IP, IP_RECVERR, &one, sizeof(one)); in set_recverr_v4()
444 if (rc < 0 && rc != -ENOTSUP) in set_recverr_v4()
447 return rc; in set_recverr_v4()
453 int rc; in set_recverr_v6() local
455 rc = setsockopt(sd, SOL_IPV6, IPV6_RECVERR, &one, sizeof(one)); in set_recverr_v6()
456 if (rc < 0 && rc != -ENOTSUP) in set_recverr_v6()
459 return rc; in set_recverr_v6()
466 int rc; in set_unicast_if() local
474 rc = setsockopt(sd, level, opt, &ifindex, sizeof(ifindex)); in set_unicast_if()
475 if (rc < 0) in set_unicast_if()
478 return rc; in set_unicast_if()
484 int rc; in set_multicast_if() local
486 rc = setsockopt(sd, SOL_IP, IP_MULTICAST_IF, &mreq, sizeof(mreq)); in set_multicast_if()
487 if (rc < 0) in set_multicast_if()
490 return rc; in set_multicast_if()
497 int rc; in set_membership() local
508 rc = setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); in set_membership()
509 if (rc < 0) { in set_membership()
520 int rc = 0; in set_broadcast() local
524 rc = -1; in set_broadcast()
527 return rc; in set_broadcast()
533 int rc = 0; in set_reuseport() local
537 rc = -1; in set_reuseport()
540 return rc; in set_reuseport()
546 int rc = 0; in set_reuseaddr() local
550 rc = -1; in set_reuseaddr()
553 return rc; in set_reuseaddr()
607 int rc = 0; in expected_addr_match() local
618 rc = 1; in expected_addr_match()
629 rc = 1; in expected_addr_match()
634 rc = 1; in expected_addr_match()
637 if (!rc) in expected_addr_match()
640 return rc; in expected_addr_match()
649 int rc = 0; in show_sockstat() local
657 rc = expected_addr_match(sa, &args->expected_laddr, in show_sockstat()
670 rc |= expected_addr_match(sa, &args->expected_raddr, in show_sockstat()
677 return rc; in show_sockstat()
699 int rc = 0; in convert_addr() local
761 rc = -1; in convert_addr()
780 rc = -1; in convert_addr()
791 rc = -1; in convert_addr()
803 return rc; in convert_addr()
1178 int rc; in msg_loop() local
1205 rc = select(nfds, &rfds, NULL, NULL, ptval); in msg_loop()
1206 if (rc < 0) { in msg_loop()
1210 rc = 1; in msg_loop()
1213 } else if (rc == 0) { in msg_loop()
1215 rc = 2; in msg_loop()
1220 rc = socket_read(sd, args); in msg_loop()
1221 if (rc < 0) { in msg_loop()
1222 rc = 1; in msg_loop()
1225 if (rc == 0) in msg_loop()
1229 rc = 0; in msg_loop()
1250 rc = 1; in msg_loop()
1256 return rc; in msg_loop()
1474 int rc; in do_server() local
1509 rc = msg_loop(0, lsd, (void *) addr, alen, args); in do_server()
1511 return rc; in do_server()
1525 rc = select(lsd+1, &rfds, NULL, NULL, ptval); in do_server()
1526 if (rc == 0) { in do_server()
1527 rc = 2; in do_server()
1531 if (rc < 0) { in do_server()
1547 rc = show_sockstat(csd, args); in do_server()
1548 if (rc) in do_server()
1551 rc = check_device(csd, args); in do_server()
1552 if (rc) in do_server()
1556 rc = msg_loop(0, csd, (void *) addr, alen, args); in do_server()
1565 return rc; in do_server()
1576 int rc; in wait_for_connect() local
1584 rc = select(FD_SETSIZE, NULL, &wfd, NULL, tv); in wait_for_connect()
1585 if (rc == 0) { in wait_for_connect()
1588 } else if (rc < 0) { in wait_for_connect()
1608 int sd, rc = -1; in connectsock() local
1647 rc = -1; in connectsock()
1650 rc = wait_for_connect(sd); in connectsock()
1651 if (rc < 0) in connectsock()
1659 return rc; in connectsock()
1672 int rc = 0; in do_client() local
1733 rc = show_sockstat(sd, args); in do_client()
1734 if (rc != 0) in do_client()
1738 rc = msg_loop(1, sd, addr, alen, args); in do_client()
1743 return rc; in do_client()
1772 int rc = 1; in ipc_child() local
1792 rc = do_server(args, fd); in ipc_child()
1798 return rc; in ipc_child()
1908 int rc = 0; in main() local
1914 while ((rc = getopt_long(argc, argv, GETOPT_STR, long_opts, NULL)) != -1) { in main()
1915 switch (rc) { in main()
2111 rc = do_server(&args, -1); in main()
2114 return rc; in main()