author | mickeyl <mickeyl> | 2003-10-06 17:38:19 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-06 17:38:19 (UTC) |
commit | 42aefe8bc6a8089b771d6f109fed22a770295cc8 (patch) (unidiff) | |
tree | 3233ee1af3d857cd2fddca3b27623cee8d2aa45b | |
parent | e0acd0d9400bb489415d21ec715c5f6704c22b95 (diff) | |
download | opie-42aefe8bc6a8089b771d6f109fed22a770295cc8.zip opie-42aefe8bc6a8089b771d6f109fed22a770295cc8.tar.gz opie-42aefe8bc6a8089b771d6f109fed22a770295cc8.tar.bz2 |
add client mac address decoding to DHCP
-rw-r--r-- | libopie2/opienet/opcap.cpp | 7 | ||||
-rw-r--r-- | libopie2/opienet/opcap.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 313f5bb..9ed2b83 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp | |||
@@ -519,12 +519,19 @@ QHostAddress ODHCPPacket::serverAddress() const | |||
519 | 519 | ||
520 | QHostAddress ODHCPPacket::relayAddress() const | 520 | QHostAddress ODHCPPacket::relayAddress() const |
521 | { | 521 | { |
522 | return EXTRACT_32BITS( &_dhcphdr->giaddr ); | 522 | return EXTRACT_32BITS( &_dhcphdr->giaddr ); |
523 | } | 523 | } |
524 | 524 | ||
525 | |||
526 | OMacAddress ODHCPPacket::clientMacAddress() const | ||
527 | { | ||
528 | return OMacAddress( _dhcphdr->chaddr ); | ||
529 | } | ||
530 | |||
531 | |||
525 | /*====================================================================================== | 532 | /*====================================================================================== |
526 | * OTCPPacket | 533 | * OTCPPacket |
527 | *======================================================================================*/ | 534 | *======================================================================================*/ |
528 | 535 | ||
529 | 536 | ||
530 | OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QObject* parent ) | 537 | OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QObject* parent ) |
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index f0d1d81..51f067a 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h | |||
@@ -506,12 +506,14 @@ class ODHCPPacket : public QObject | |||
506 | 506 | ||
507 | QHostAddress clientAddress() const; | 507 | QHostAddress clientAddress() const; |
508 | QHostAddress yourAddress() const; | 508 | QHostAddress yourAddress() const; |
509 | QHostAddress serverAddress() const; | 509 | QHostAddress serverAddress() const; |
510 | QHostAddress relayAddress() const; | 510 | QHostAddress relayAddress() const; |
511 | 511 | ||
512 | OMacAddress clientMacAddress() const; | ||
513 | |||
512 | bool isRequest() const; | 514 | bool isRequest() const; |
513 | bool isReply() const; | 515 | bool isReply() const; |
514 | QString type() const; | 516 | QString type() const; |
515 | 517 | ||
516 | private: | 518 | private: |
517 | const struct dhcp_packet* _dhcphdr; | 519 | const struct dhcp_packet* _dhcphdr; |