MCPcopy Index your code
hub / github.com/F-Stack/f-stack / handle_ipfw_msg

Function handle_ipfw_msg

lib/ff_dpdk_if.c:1809–1844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1807
1808#ifdef FF_IPFW
1809static inline void
1810handle_ipfw_msg(struct ff_msg *msg)
1811{
1812 int fd, ret;
1813 fd = ff_socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
1814 if (fd < 0) {
1815 ret = -1;
1816 goto done;
1817 }
1818
1819 switch (msg->ipfw.cmd) {
1820 case FF_IPFW_GET:
1821 ret = ff_getsockopt_freebsd(fd, msg->ipfw.level,
1822 msg->ipfw.optname, msg->ipfw.optval,
1823 msg->ipfw.optlen);
1824 break;
1825 case FF_IPFW_SET:
1826 ret = ff_setsockopt_freebsd(fd, msg->ipfw.level,
1827 msg->ipfw.optname, msg->ipfw.optval,
1828 *(msg->ipfw.optlen));
1829 break;
1830 default:
1831 ret = -1;
1832 errno = ENOTSUP;
1833 break;
1834 }
1835
1836 ff_close(fd);
1837
1838done:
1839 if (ret < 0) {
1840 msg->result = errno;
1841 } else {
1842 msg->result = 0;
1843 }
1844}
1845#endif
1846
1847static inline void

Callers 1

handle_msgFunction · 0.85

Calls 4

ff_getsockopt_freebsdFunction · 0.85
ff_setsockopt_freebsdFunction · 0.85
ff_closeFunction · 0.85
ff_socketFunction · 0.70

Tested by

no test coverage detected