summaryrefslogtreecommitdiff
path: root/libopie2/opienet
Unidiff
Diffstat (limited to 'libopie2/opienet') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/opcap.cpp7
-rw-r--r--libopie2/opienet/opcap.h2
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
@@ -513,24 +513,31 @@ QHostAddress ODHCPPacket::yourAddress() const
513 513
514QHostAddress ODHCPPacket::serverAddress() const 514QHostAddress ODHCPPacket::serverAddress() const
515{ 515{
516 return EXTRACT_32BITS( &_dhcphdr->siaddr ); 516 return EXTRACT_32BITS( &_dhcphdr->siaddr );
517} 517}
518 518
519 519
520QHostAddress ODHCPPacket::relayAddress() const 520QHostAddress ODHCPPacket::relayAddress() const
521{ 521{
522 return EXTRACT_32BITS( &_dhcphdr->giaddr ); 522 return EXTRACT_32BITS( &_dhcphdr->giaddr );
523} 523}
524 524
525
526OMacAddress ODHCPPacket::clientMacAddress() const
527{
528 return OMacAddress( _dhcphdr->chaddr );
529}
530
531
525/*====================================================================================== 532/*======================================================================================
526 * OTCPPacket 533 * OTCPPacket
527 *======================================================================================*/ 534 *======================================================================================*/
528 535
529 536
530OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QObject* parent ) 537OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QObject* parent )
531 :QObject( parent, "TCP" ), _tcphdr( data ) 538 :QObject( parent, "TCP" ), _tcphdr( data )
532 539
533{ 540{
534 qDebug( "OTCPPacket::OTCPPacket(): decoding TCP header..." ); 541 qDebug( "OTCPPacket::OTCPPacket(): decoding TCP header..." );
535} 542}
536 543
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
@@ -500,24 +500,26 @@ class ODHCPPacket : public QObject
500{ 500{
501 Q_OBJECT 501 Q_OBJECT
502 502
503 public: 503 public:
504 ODHCPPacket( const unsigned char*, const struct dhcp_packet*, QObject* parent = 0 ); 504 ODHCPPacket( const unsigned char*, const struct dhcp_packet*, QObject* parent = 0 );
505 virtual ~ODHCPPacket(); 505 virtual ~ODHCPPacket();
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;
518 unsigned char _type; 520 unsigned char _type;
519}; 521};
520 522
521/*====================================================================================== 523/*======================================================================================
522 * OTCPPacket 524 * OTCPPacket
523 *======================================================================================*/ 525 *======================================================================================*/