Home page logo
/
Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News

Sponsors

SolarWinds makes easy-to-use enterprise IT management software to help IT pros solve problems every day and help to enable efficient and effective management of networks and IT environments.

Join our online community of over 100,000 IT professionals talking shop. Get involved. Gain insights. Share tips and tricks. Visit thwack today!


Library match

Buffered network I/O helper functions.

The functions in this module can be used for delimiting data received by the nmap.receive_buf function in the Network I/O API (which see).

Copyright© Same as Nmap--See http://nmap.org/book/man-legal.html

Source: http://nmap.org/svn/nselib/match.lua

Functions

numbytes (num)

Return a function that allows delimiting at a certain number of bytes.

regex (pattern)

Return a function that allows delimiting with a regular expression.



Functions

numbytes (num)

Return a function that allows delimiting at a certain number of bytes.

This function can be used to get a buffered version of sock:receive_bytes(n) in case a script requires more than one fixed-size chunk, as the unbuffered version may return more bytes than requested and thus would require you to do the parsing on your own.

Parameters

  • num: Number of bytes.

Usage:

sock:receive_buf(match.numbytes(80))

See also:

regex (pattern)

Return a function that allows delimiting with a regular expression.

This function is a wrapper around pcre.exec. Its purpose is to give script developers the ability to use regular expressions for delimiting instead of Lua's string patterns.

Parameters

  • pattern: The regex.

Usage:

sock:receive_buf(match.regex("myregexpattern"))

See also:

Nmap Site Navigation

Intro Reference Guide Book Install Guide
Download Changelog Zenmap GUI Docs
Bug Reports OS Detection Propaganda Related Projects
In the Movies In the News
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]