[P4-dev] parsing variable-length fields in HTTP

Aldo Febro af12abw at gmail.com
Fri Jul 14 16:23:08 EDT 2017

Hi All,

I wonder if P4 is capable of parsing HTTP protocol with its variable-length

Host: www.p4.org\r\n
User-Agent: Mozilla/5.0\r\n
Accept: text/html,image/apng\r\n

etc. where each variable-length field is terminated with "\r\n" character

As far as I know, P4 can accommodate only one variable-length field by
using "*", which value will be derived by calculating length and
max_length. But with HTTP, most fields are of variable length.

What I'd like to be able to do is to parse each field individually i.e.
doing a match based on "Hosts:, "User-Agent:", etc. Is this doable yet?

Many thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20170714/e2564bdb/attachment-0002.html>

More information about the P4-dev mailing list