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