How to modify ip address and tcp port number in callout driver?

Hi all,

I am designing a TCP redirector base on Windows Filtering Platform (Vista). So I need to modify the ip address and port number when a tcp connection comes. I have added a filter on the FWPM_LAYER_ALE_AUTH_CONNECT_V4 layer and written a corresponding callout driver.

I feel very puzzle about how to modify the ip address and port number in the function

VOID NTAPI

TcpOutboundClassifyFn(

IN const FWPS_INCOMING_VALUES0 *inFixedValues,

IN const FWPS_INCOMING_METADATA_VALUES0 *inMetaValues,

IN OUT VOID *layerData,

IN const FWPS_FILTER0 *filter,

IN UINT64 flowContext,

OUT FWPS_CLASSIFY_OUT0* classifyOut

)

The layerData is a NET_BUFFER_LIST structure.

Thanks for your advisement!