Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCPRewriter: add perform_mapping handler #92

Merged
merged 1 commit into from
Jul 15, 2013
Merged

Conversation

pallas
Copy link
Contributor

@pallas pallas commented Jul 13, 2013

This handler takes in a flow as a space-separated

saddr sport daddr dport

and looks for a forward mapping for that flow. If found, it returns the rewritten flow in the same format. I went with this format for ease of parsing in userland.

This is useful when using a TCPRewriter to divert traffic to a proxy in userland. It allows the proxy to figure out the original destination for the flow, similar to SO_ORIGINAL_DST for Netfilter or SIOCGNATL for IP-Filter.

@kohler
Copy link
Owner

kohler commented Jul 14, 2013

I like it a lot. However, can we rename the handler? The routing table elements provide lookup handlers. For this, I'd prefer lookup as well. In fact I am going to rename the mappings handlers to table (preserving the old names for backwards compatibility).

@pallas
Copy link
Contributor Author

pallas commented Jul 14, 2013

Easy sell. Updated.

@pallas
Copy link
Contributor Author

pallas commented Jul 14, 2013

And actually, I updated a test to poke this handler.

This handler takes in a flow as a space-separated

	saddr sport daddr dport

and looks for a forward mapping for that flow.  If found, it returns the
rewritten flow in the same format.  This is useful when using a TCPRewriter
to divert traffic to a proxy in userland.  It allows the proxy to figure out
the original destination for the flow, similar to SO_ORIGINAL_DST for
Netfilter or SIOCGNATL for IP-Filter.
kohler added a commit that referenced this pull request Jul 15, 2013
TCPRewriter: add perform_mapping handler
@kohler kohler merged commit 47ea661 into kohler:master Jul 15, 2013
@kohler
Copy link
Owner

kohler commented Jul 15, 2013

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants