Forum Discussion
Original_D_2018
Nimbostratus
Aug 06, 2015iRule to create TPDU header
I have a project to grab the source IP address from a client connection and create a fixed length TPDU header to send to the backend server. I need some help to accomplish this:
These are my beginnin...
VernonWells
Employee
Aug 07, 2015The binary format method takes a template that describes how you want to pack the variables that follow the template string. These have meaning as follows:
- a* - take the first parameter (the literal "IP36") and convert all of the letters in 8-bit ASCII encoded values;
- S - take the second parameter (since it is the second item in the template) -- which is the operational code -- and convert it to a 16-bit unsigned integer using big-endian byte order (which is the same as network byte order);
- IIIIII - each of these is a 32-bit unsigned integer in big-endian byte order. In your specification, there is a byte stream 0x00000000 00000000 00000000 00000000 00000000 0000ffff (24 bytes total, or 6 x 4 bytes);
- I - again, a 32-bit unsigned integer in big-endian byte order, this is the leading 4 bytes of the address field (which, by your layout, is 8 bytes, so I assume the first 4 bytes are zeroes);
- c4 - the c is a one byte unsigned integer. c4 means "assume a list of four elements, and convert each element into an 8-bit integer". The split does exactly this: it splits the textual representation of the client IP (as dotted-quad) into a list of four elements, where each element is one byte of the IP address is descending (and big-endian) order;
- S - again, an unsigned 16-bit integer, it is passed the value of the client source port.
This might be of some value:
- Original_D_2018Aug 07, 2015
Nimbostratus
That is a awesome explanation, I will read the article. So you gave the operational code as "1". Comparing these articles: http://ntrg.cs.tcd.ie/undergrad/4ba2/transport/5.nq.10.html & http://www.banalyzer.de/ban/HTML/P_ISO/Eng/P_iso93.html. It is a 4 bit code but then it says the code for a request is: CR - connection request.......... x x x x x 1110 xxxx xxxx (bits 4 to 1): used to signal the CDT; set to 0000 in classes 0 and 1. I am lost with what they're saying?!? For a customer request should I put "0x1110" to represent CR?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects