Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F4117978
ip_options.c
tuexen (Michael Tuexen)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
tuexen
Jan 5 2019, 12:41 PM
2019-01-05 12:41:04 (UTC+0)
Size
526 B
Referenced Files
None
Subscribers
None
ip_options.c
View Options
#include
<sys/types.h>
#include
<sys/socket.h>
#include
<netinet/in.h>
#include
<stdio.h>
#include
<unistd.h>
int
main
(
void
)
{
int
fd
;
socklen_t
len
;
char
val
[]
=
{
0x00
,
0x00
,
0x00
,
0x00
,
0xac
,
0x14
,
0x00
,
0xaa
};
len
=
(
socklen_t
)
sizeof
(
val
);
if
((
fd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
))
<
0
)
{
perror
(
"socket"
);
}
if
(
setsockopt
(
fd
,
IPPROTO_IP
,
IP_OPTIONS
,
val
,
len
)
!=
0
)
{
perror
(
"setsockopt"
);
}
if
(
getsockopt
(
fd
,
IPPROTO_IP
,
IP_OPTIONS
,
val
,
&
len
)
!=
0
)
{
perror
(
"getsockopt"
);
}
return
(
0
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1705652
Default Alt Text
ip_options.c (526 B)
Attached To
Mode
D18753: Fix getsockopt(..., IPPROTO_IP, IP_OPTIONS, ..., ...)
Attached
Detach File
Event Timeline
Log In to Comment