[syslinux] Sending UDP packets from comboot
Stefan Thomanek
stefan at thomanek.eu
Sun May 24 00:56:55 PDT 2009
Hi everyone.
I've read through the archives and found a few posts about using the PXE
stack, but none of these really helped me.
What i want to do is: Prompt the user for 2 values, desired hostname and
a "pin" (just a number) and send this information
over UDP to my server
The problem is not the user input but the UDP part.
I've tried to change the code from the post of jesse barker (6.1.2007):
// code start
s_PXENV_UDP_WRITE args;
memset(&args, 0, sizeof(args));
args.ip = inet_addr("255.255.255.255"); // inet_addr working here?
args.gw = inet_addr("0.0.0.0");
args.src_port = 4711;
args.dst_port = 4799;
args.buffer_size = <some sizeof() code>
args.buffer = <some stuff to put my data in>
memcpy(__com32.cs_bounce, &args, sizeof(args);
inputRegs.es = SEG(__com32.cs_bounce);
inputRegs.edi.w[0] = OFFS(__com32.cs_bounce);
inputRegs.eax.w[0] = 0x0009; /* call PXE stack */
inputRegs.ebx.w[0] = 0x0033; /* PXENV_UDP_WRITE opcode */
__intcall(0x22, &inputRegs, NULL);
// code end
Could anyone give me a hand on that?
Or is there any example already where a UDP write is used?
Thanks in advance,
-Stefan
More information about the Syslinux
mailing list