Skip to content

Commit

Permalink
CoAP - constrained application protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdavidgraham committed May 1, 2019
1 parent f6a9d12 commit 3020e24
Show file tree
Hide file tree
Showing 9 changed files with 1,660 additions and 862 deletions.
2 changes: 2 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "templ-payloads.h" /* UDP packet payloads */
#include "proto-snmp.h" /* parse SNMP responses */
#include "proto-ntp.h" /* parse NTP responses */
#include "proto-coap.h" /* CoAP selftest */
#include "templ-port.h"
#include "in-binary.h" /* covert binary output to XML/JSON */
#include "main-globals.h" /* all the global variables in the program */
Expand Down Expand Up @@ -1663,6 +1664,7 @@ int main(int argc, char *argv[])
*/
{
int x = 0;
x += proto_coap_selftest();
x += smack_selftest();
x += sctp_selftest();
x += base64_selftest();
Expand Down
2 changes: 2 additions & 0 deletions src/masscan-app.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ masscan_app_to_string(enum ApplicationProtocol proto)
case PROTO_MEMCACHED: return "memcached";
case PROTO_SCRIPTING: return "scripting";
case PROTO_VERSIONING: return "versioning";
case PROTO_COAP: return "coap";

default:
sprintf_s(tmp, sizeof(tmp), "(%u)", proto);
Expand Down Expand Up @@ -80,6 +81,7 @@ masscan_string_to_app(const char *str)
{"memcached", PROTO_MEMCACHED},
{"scripting", PROTO_SCRIPTING},
{"versioning", PROTO_VERSIONING},
{"coap", PROTO_COAP},
{0,0}
};
size_t i;
Expand Down
2 changes: 1 addition & 1 deletion src/masscan-app.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum ApplicationProtocol {
PROTO_MEMCACHED,
PROTO_SCRIPTING,
PROTO_VERSIONING,

PROTO_COAP, /* constrained app proto, udp/5683, RFC7252 */

PROTO_end_of_list /* must be last one */
};
Expand Down
5 changes: 5 additions & 0 deletions src/proto-banout.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,17 @@ banout_append_unicode(struct BannerOutput *banout, unsigned proto, unsigned c);

/**
* Select a specific string (of the specified protocol).
* The "banner output" can have multiple protocol objects associated
* with it, such as an SSL protocol objec and an X.509 certificate.
* Thus, instead of just grabbing the string, we need to grab the
* specific protocol instead.
*/
const unsigned char *
banout_string(const struct BannerOutput *banout, unsigned proto);

/**
* Get the length of a specific string of the specified protocol.
* This is the matching function to banout_string.
*/
unsigned
banout_string_length(const struct BannerOutput *banout, unsigned proto);
Expand Down
Loading

0 comments on commit 3020e24

Please sign in to comment.