Lines Matching refs:sock
67 NetlinkHandler *NetlinkManager::setupSocket(int *sock, int netlinkFamily, in setupSocket() argument
80 if ((*sock = socket(PF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, netlinkFamily)) < 0) { in setupSocket()
88 if (setsockopt(*sock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0 && in setupSocket()
89 setsockopt(*sock, SOL_SOCKET, SO_RCVBUF, &sz, sizeof(sz)) < 0) { in setupSocket()
91 close(*sock); in setupSocket()
95 if (setsockopt(*sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) { in setupSocket()
97 close(*sock); in setupSocket()
101 if (bind(*sock, (struct sockaddr *) &nladdr, sizeof(nladdr)) < 0) { in setupSocket()
103 close(*sock); in setupSocket()
108 if (android_nflog_send_config_cmd(*sock, 0, NFULNL_CFG_CMD_PF_UNBIND, AF_INET) < 0) { in setupSocket()
112 if (android_nflog_send_config_cmd(*sock, 0, NFULNL_CFG_CMD_PF_BIND, AF_INET) < 0) { in setupSocket()
116 if (android_nflog_send_config_cmd(*sock, 0, NFULNL_CFG_CMD_BIND, AF_UNSPEC) < 0) { in setupSocket()
122 NetlinkHandler *handler = new NetlinkHandler(this, *sock, format); in setupSocket()
125 close(*sock); in setupSocket()