As i understand you should have some kind of proxy that modifies tcp packet headers before passing it through.
there are some suggestions here:
How to write custom data to the TCP packet header options field with Java?
how to modify packet header(IP header, TCP Header) before the host send them into the network
you can also check this guide, it have section how to add extra headers info into packets:
http://grinder.sourceforge.net/g3/tcpproxy.html
is this applicable to your case?