Lines Matching refs:sock
235 int sock;
237 sock = socket (su->sa.sa_family, SOCK_STREAM, 0);
238 if (sock < 0)
246 return sock;
251 sockunion_accept (int sock, union sockunion *su)
257 client_sock = accept (sock, (struct sockaddr *) su, &len);
394 int sock;
399 sock = socket (su->sa.sa_family, SOCK_STREAM, 0);
401 if (sock < 0)
404 return sock;
409 sockunion_bind (int sock, union sockunion *su, unsigned short port,
445 ret = bind (sock, (struct sockaddr *)su, size);
455 sockopt_reuseaddr (int sock)
460 ret = setsockopt (sock, SOL_SOCKET, SO_REUSEADDR,
465 zlog (NULL, LOG_WARNING, "can't set sockopt SO_REUSEADDR to socket %d", sock);
474 sockopt_reuseport (int sock)
479 ret = setsockopt (sock, SOL_SOCKET, SO_REUSEPORT,
484 zlog (NULL, LOG_WARNING, "can't set sockopt SO_REUSEADDR to socket %d", sock);
492 sockopt_reuseport (int sock)
500 sockopt_ttl (int family, int sock, int ttl)
507 ret = setsockopt (sock, IPPROTO_IP, IP_TTL,
512 zlog (NULL, LOG_WARNING, "can't set sockopt IP_TTL %d to socket %d", ttl, sock);
522 ret = setsockopt (sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS,
528 ttl, sock);