It works off of checking the SYN packet [0], which happens at the transport layer [1]. Once it gets to the application layer the information is not available unless the transport layer stores the information and provides a method to query a given connection.
[0] http://www.openbsd.org/faq/pf/filter.html#osfp
[1] http://en.wikipedia.org/wiki/OSI_model