Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 41 lines (34 sloc) 0.909 kb
7257579b »
2012-06-13 Git repository created from hping3-clockskew-0.tar.gz
1 /*
2 * $smu-mark$
3 * $name: sockopt.c$
4 * $author: Salvatore Sanfilippo <antirez@invece.org>$
5 * $copyright: Copyright (C) 1999 by Salvatore Sanfilippo$
6 * $license: This software is under GPL version 2 of license$
7 * $date: Fri Nov 5 11:55:49 MET 1999$
8 * $rev: 8$
9 */
10
11 /* $Id: sockopt.c,v 1.3 2003/09/07 11:21:18 antirez Exp $ */
12
13 #include <sys/types.h>
14 #include <sys/socket.h>
15 #include <netinet/in.h> /* IP_PROTOIP */
16 #include <stdio.h>
17
18 void socket_broadcast(int sd)
19 {
20 const int one = 1;
21
22 if (setsockopt(sd, SOL_SOCKET, SO_BROADCAST,
23 (char *)&one, sizeof(one)) == -1)
24 {
25 printf("[socket_broadcast] can't set SO_BROADCAST option\n");
26 /* non fatal error */
27 }
28 }
29
30 void socket_iphdrincl(int sd)
31 {
32 const int one = 1;
33
34 if (setsockopt(sd, IPPROTO_IP, IP_HDRINCL,
35 (char *)&one, sizeof(one)) == -1)
36 {
37 printf("[socket_iphdrincl] can't set IP_HDRINCL option\n");
38 /* non fatal error */
39 }
40 }
Something went wrong with that request. Please try again.