TCP bootloader memory issue
How much memory is on the system?

If you have enough memory it should not be a problem to store the APN code in normal memory and call it from the bootloader (this is what normal OSs do anyway). You should be careful to never overwrite it using good memory management. (I would put it on one end of the system memory.) The point is if you want use more memory when you write applications you have to start writing memory with the bootloader above the APN code.

Further, you should be able to also use this code in your applications if you are careful enough.