Trying to get my FTP server working in passive mode.
I am putting a stack in to a new development using an PIC24FJ256GB410 adabting the MDFS example to work with FatFS tragetting SDCARD over SPI and ENC28J60. And, boy I have not found it very easy. However I can see the finish post coming into view but an stumbeling at the final hurdel. I have fired up filexilla which I got to work connecting to a well known comercial HMS module which worked. I was thinking that if I got a working example I could reverse engineer it into the microcode stack. The zillarohms.GIF has the WireShark dump I saw with fillezilla and the HMS module. The other show what I managed to achieve with my board.
First thing I noticed was that because the initial implimentation of the microchip ftp did not include a PASV command it tried to work in an active mode which did not work. So I have implimented PASV to return
227 Pasv. mode (192,168,1,3,191,124) assigning my data port to 49020. I tried the defaul of 20 but filezilla seemed to not like that and refused to send a LIST command.
It now sends the list with the start of a hand shake, just like the HMS example. However I am ( TCP socket ) is not responding correctly as it should.
It is sending
60 1024 -> 49020 [SYN].....
when it should return
60 49020 -> 51160 [SYN]... which should then prompt Filezilla to complete the hand shake and allow the LIST to complete.
The question is, where and how do I intercept the 66 51160 -> 49020 and then what do I do to set up the correct response?
Do I have to create another Socket?
I know this will not be an easy thing to answer and I am not expecting anyone to debug my code, put any suggestions or pointers will be welcome. For referend I have included my working TCP and FTP c files. You may see a reference to DARIOG in it where I tried his veersion of the FTP switch, but unfortunatly it made no difference to my problem so it is ifdefed out with a bit of merging from his into mine.
[ will not let me add code to this so look at my REPLIES for it , looks like it does not like the TCP.c so I have attached it a txt file]...
PS is there a way of switching of the TCP ACKs that do not appeaar in the HMS transactions?
post edited by markQ - 2019/07/22 00:44:29