Nmap Development mailing list archives

Re: [PATCH] Make new UDP-payload code reusable.


From: David Fifield <david () bamsoftware com>
Date: Tue, 7 Jul 2009 11:58:59 -0600

On Tue, Jul 07, 2009 at 07:09:12PM +0200, Luis M. wrote:
David Fifield wrote:
If you're going to do that, I would prefer another layer of abstraction
in order to keep the calling code simple. In other words, I want a
function like get_udp_payload that does both 1) check if
o.extra_payload_length is set, and 2) looks up a payload if it is not.
So I would prefer, rather than moving part of the function into the
caller, rather to factor the port-specific payload lookup into its own
function, which get_udp_payload would call.

The function that checks o.extra_payload_length would be Nmap-specific,
and the sub-function could be shared between Nmap and Nping.

Yes, that makes sense. I enclose another patch. It uses function
udp_port2payload(), that can be reused, while keeping the original
behavior in get_udp_payload(). Let me know what you think.

That looks good. You can apply it.

David Fifield

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: