1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 11:59:03 +00:00

Merge r30175-176 from nmap-npingchanges: Add support for Node Information queries in print(). Also, add the ability to pass u64 to setNonce()

This commit is contained in:
luis
2013-03-29 18:19:09 +00:00
parent d8017b1a95
commit 49e06da86f
3 changed files with 49 additions and 7 deletions

View File

@@ -270,6 +270,14 @@
/* Node Information flag bitmaks */
#define ICMPv6_NI_FLAG_T 0x01
#define ICMPv6_NI_FLAG_A 0x02
#define ICMPv6_NI_FLAG_C 0x04
#define ICMPv6_NI_FLAG_L 0x08
#define ICMPv6_NI_FLAG_G 0x10
#define ICMPv6_NI_FLAG_S 0x20
class ICMPv6Header : public ICMPHeader {
/**********************************************************************/
@@ -524,7 +532,7 @@ class ICMPv6Header : public ICMPHeader {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Code | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Qtype | Flags |
| Qtype | unused |G|S|L|C|A|T|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Nonce +
@@ -537,7 +545,7 @@ class ICMPv6Header : public ICMPHeader {
struct nodeinfo_msg{
u16 qtype;
u16 flags;
u8 nonce[NI_NONCE_LEN];
u64 nonce;
//u8 data[?];
}__attribute__((__packed__));
typedef struct nodeinfo_msg nodeinfo_msg_t;
@@ -676,8 +684,9 @@ class ICMPv6Header : public ICMPHeader {
bool getA() const;
int setT(bool flag_value=true);
bool getT() const;
int setNonce(u64 nonce_value);
int setNonce(const u8 *nonce);
u8 *getNonce() const;
u64 getNonce() const;
/* Multicast Listener Discovery */
int setMulticastAddress(struct in6_addr addr);