Good evening everyone.
I'm having trouble creating a TFTP client for an assignment in C++ that uses #include
I'm sending the char buffer:
buffer={'0','2','f','i','l','e','n','a','m','e','0','o','c','t','e','t','0'};
Using the code:
sendto(sock,buffer,strlen(buffer), 0, (sockaddr *) &serverAddr, sizeof(sockaddr));
But when I look at this transfer in the WireShark it says "Opcode: Unknown (12338)" when I look at the Opcode portion of the packet. Even though it has selected the opcode from the string
I'm absolutely stuck, any help would be appreciated. I'm pretty sure if I can send and receive a message I can handle the rest pretty easily.
Just throwing down here what I did but the marked answer was basically it Used the BYTE from winsock2 (don't know if I need to but better safe than sorry)
buffer={(BYTE)0,(BYTE)2,'f','i','l','e','n','a','m','e',(BYTE)0,'o','c','t','e','t',(BYTE)0};
and
sendto(sock,buffer,sizeof(buffer), 0, (sockaddr *) &serverAddr, sizeof(sockaddr));