Questions tagged [setsockopt]

142 questions
0
votes
2 answers

Set IP_HDRINCL to setsockopt function in win32

I'm fighting with raw sockets in Win32 and now I'm stuck, the soetsockopt function give me the 10022 error (invalid argument), but I think I pass the correct arguments... of course I'm wrong u_u' sock = socket(AF_INET,SOCK_RAW,IPPROTO_UDP); if…
Alfre2
  • 2,039
  • 3
  • 19
  • 22
0
votes
2 answers

Extracting IP address from C sockets

Ok, I'm still new to using C sockets, but I was wondering if there is a way to extract the IP address adding running setsockopt? If you'll look at my code below, I have everything in my multicast sockets ready to send except for defining the…
Josh Bradley
  • 4,630
  • 13
  • 54
  • 79
0
votes
0 answers

linux joining multicast group setsockopt returns errno 19 device not found

I have set a UDP non-blocking socket. I am creating the socket, binding it, and joining a multicast group like this: int hopLimit = 1; int bAllowMultiple = 1; in_addr localAddr; localAddr.s_addr = 0; in_addr groupAddress; groupAddress.s_addr =…
eskimo9
  • 753
  • 10
  • 24
-1
votes
1 answer

rust libc::setsockopt cast to c_void

I'm trying to call setsockopt but can't figure out the cast to c_void. IP_HDRINCL isn't in nix or socket crates, so I have to use libc. I'm following the example of How to set the socket option SO_REUSEPORT in Rust? let trueval: c_int = 1; let ret…
ruckc
  • 505
  • 1
  • 6
  • 23
-1
votes
1 answer

How can I force set the MTU with C code?

I have an issu with my device when I connect by TCP sockets, because the client send the MSS in the SYN connection and the server (my device) is setting with the same MSS, but I don't want set this MSS in my device. So how can I force setting this…
-1
votes
4 answers

FreeBSD port redirection for http requests

I've never used FreeBSD in my life but it's neccesary for me to deploy an HTTP API on FreeBSD. The API is deployed on port 3002. What do I need to do to forward requests from port 80 to port 3002? I tried adding this to my /etc/natd.conf…
parliament
  • 21,544
  • 38
  • 148
  • 238
-1
votes
1 answer

BSD sockets setsockopt option to avoid waiting for acknowledge before next send

I am trying to send some KBytes of data trough Ethernet with a proprietary simple raw TCP protocol. Standard Windows configuration requires two (2) packets received before returning an acknowledge packet, unless you modify the registry with…
Faghio
  • 57
  • 4
1 2 3
9
10