MCPcopy Create free account
hub / github.com/F-Stack/f-stack / do_set3

Function do_set3

tools/ipfw/ipfw2.c:621–636  ·  view source on GitHub ↗

* do_set3 - pass ipfw control cmd to kernel * @optname: option name * @optval: pointer to option data * @optlen: option length * * Assumes op3 header is already embedded. * Calls setsockopt() with IP_FW3 as kernel-visible opcode. * Returns 0 on success or errno otherwise. */

Source from the content-addressed store, hash-verified

619 * Returns 0 on success or errno otherwise.
620 */
621int
622do_set3(int optname, ip_fw3_opheader *op3, size_t optlen)
623{
624
625 if (g_co.test_only)
626 return (0);
627
628 if (ipfw_socket == -1)
629 ipfw_socket = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
630 if (ipfw_socket < 0)
631 err(EX_UNAVAILABLE, "socket");
632
633 op3->opcode = optname;
634
635 return (setsockopt(ipfw_socket, IPPROTO_IP, IP_FW3, op3, optlen));
636}
637
638/*
639 * do_get3 - pass ipfw control cmd to kernel

Callers 15

nat64clat_createFunction · 0.85
nat64clat_configFunction · 0.85
nat64clat_destroyFunction · 0.85
nat64clat_reset_statsFunction · 0.85
table_do_createFunction · 0.85
table_do_modifyFunction · 0.85
table_destroyFunction · 0.85
table_flushFunction · 0.85
table_do_swapFunction · 0.85
nat64lsn_createFunction · 0.85
nat64lsn_configFunction · 0.85
nat64lsn_reset_statsFunction · 0.85

Calls 2

socketClass · 0.50
setsockoptFunction · 0.50

Tested by

no test coverage detected