author | mickeyl <mickeyl> | 2004-01-07 20:30:21 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-07 20:30:21 (UTC) |
commit | 49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5 (patch) (unidiff) | |
tree | 78981f89d8e9d93766f9d04154ce1d485fbf975c | |
parent | f1a1b0e56e676c655e9728d97cdf68d63df7f5d5 (diff) | |
download | opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.zip opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.gz opie-49ae69c0f1d3a839492eb93e25bf83b7c7dc58a5.tar.bz2 |
OWaveLanManagementSSID::ID() now can decloak SSIDs (caution:API change)
-rw-r--r-- | libopie2/opienet/opcap.cpp | 13 | ||||
-rw-r--r-- | libopie2/opienet/opcap.h | 2 | ||||
-rw-r--r-- | libopie2/opienet/opienet.pro | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 012c0a3..4d786f5 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp | |||
@@ -639,392 +639,401 @@ OWaveLanPacket::OWaveLanPacket( const unsigned char* end, const struct ieee_802_ | |||
639 | OWaveLanPacket::~OWaveLanPacket() | 639 | OWaveLanPacket::~OWaveLanPacket() |
640 | { | 640 | { |
641 | } | 641 | } |
642 | 642 | ||
643 | 643 | ||
644 | int OWaveLanPacket::duration() const | 644 | int OWaveLanPacket::duration() const |
645 | { | 645 | { |
646 | return _wlanhdr->duration; | 646 | return _wlanhdr->duration; |
647 | } | 647 | } |
648 | 648 | ||
649 | 649 | ||
650 | OMacAddress OWaveLanPacket::macAddress1() const | 650 | OMacAddress OWaveLanPacket::macAddress1() const |
651 | { | 651 | { |
652 | return OMacAddress( _wlanhdr->mac1 ); | 652 | return OMacAddress( _wlanhdr->mac1 ); |
653 | } | 653 | } |
654 | 654 | ||
655 | 655 | ||
656 | OMacAddress OWaveLanPacket::macAddress2() const | 656 | OMacAddress OWaveLanPacket::macAddress2() const |
657 | { | 657 | { |
658 | return OMacAddress( _wlanhdr->mac2 ); | 658 | return OMacAddress( _wlanhdr->mac2 ); |
659 | } | 659 | } |
660 | 660 | ||
661 | 661 | ||
662 | OMacAddress OWaveLanPacket::macAddress3() const | 662 | OMacAddress OWaveLanPacket::macAddress3() const |
663 | { | 663 | { |
664 | return OMacAddress( _wlanhdr->mac3 ); | 664 | return OMacAddress( _wlanhdr->mac3 ); |
665 | } | 665 | } |
666 | 666 | ||
667 | 667 | ||
668 | OMacAddress OWaveLanPacket::macAddress4() const | 668 | OMacAddress OWaveLanPacket::macAddress4() const |
669 | { | 669 | { |
670 | return OMacAddress( _wlanhdr->mac4 ); | 670 | return OMacAddress( _wlanhdr->mac4 ); |
671 | } | 671 | } |
672 | 672 | ||
673 | 673 | ||
674 | int OWaveLanPacket::subType() const | 674 | int OWaveLanPacket::subType() const |
675 | { | 675 | { |
676 | return FC_SUBTYPE( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 676 | return FC_SUBTYPE( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
677 | } | 677 | } |
678 | 678 | ||
679 | 679 | ||
680 | int OWaveLanPacket::type() const | 680 | int OWaveLanPacket::type() const |
681 | { | 681 | { |
682 | return FC_TYPE( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 682 | return FC_TYPE( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
683 | } | 683 | } |
684 | 684 | ||
685 | 685 | ||
686 | int OWaveLanPacket::version() const | 686 | int OWaveLanPacket::version() const |
687 | { | 687 | { |
688 | return FC_VERSION( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 688 | return FC_VERSION( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
689 | } | 689 | } |
690 | 690 | ||
691 | 691 | ||
692 | bool OWaveLanPacket::fromDS() const | 692 | bool OWaveLanPacket::fromDS() const |
693 | { | 693 | { |
694 | return FC_FROM_DS( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 694 | return FC_FROM_DS( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
695 | } | 695 | } |
696 | 696 | ||
697 | 697 | ||
698 | bool OWaveLanPacket::toDS() const | 698 | bool OWaveLanPacket::toDS() const |
699 | { | 699 | { |
700 | return FC_TO_DS( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 700 | return FC_TO_DS( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
701 | } | 701 | } |
702 | 702 | ||
703 | 703 | ||
704 | bool OWaveLanPacket::usesPowerManagement() const | 704 | bool OWaveLanPacket::usesPowerManagement() const |
705 | { | 705 | { |
706 | return FC_POWER_MGMT( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 706 | return FC_POWER_MGMT( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
707 | } | 707 | } |
708 | 708 | ||
709 | 709 | ||
710 | bool OWaveLanPacket::usesWep() const | 710 | bool OWaveLanPacket::usesWep() const |
711 | { | 711 | { |
712 | return FC_WEP( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); | 712 | return FC_WEP( EXTRACT_LE_16BITS( &_wlanhdr->frame_control ) ); |
713 | } | 713 | } |
714 | 714 | ||
715 | 715 | ||
716 | /*====================================================================================== | 716 | /*====================================================================================== |
717 | * OWaveLanManagementPacket | 717 | * OWaveLanManagementPacket |
718 | *======================================================================================*/ | 718 | *======================================================================================*/ |
719 | 719 | ||
720 | OWaveLanManagementPacket::OWaveLanManagementPacket( const unsigned char* end, const struct ieee_802_11_mgmt_header* data, OWaveLanPacket* parent ) | 720 | OWaveLanManagementPacket::OWaveLanManagementPacket( const unsigned char* end, const struct ieee_802_11_mgmt_header* data, OWaveLanPacket* parent ) |
721 | :QObject( parent, "802.11 Management" ), _header( data ), | 721 | :QObject( parent, "802.11 Management" ), _header( data ), |
722 | _body( (const struct ieee_802_11_mgmt_body*) (data+1) ) | 722 | _body( (const struct ieee_802_11_mgmt_body*) (data+1) ) |
723 | { | 723 | { |
724 | odebug << "OWaveLanManagementPacket::OWaveLanManagementPacket(): decoding frame..." << oendl; | 724 | odebug << "OWaveLanManagementPacket::OWaveLanManagementPacket(): decoding frame..." << oendl; |
725 | odebug << "Detected subtype is " << managementType() << oendl; | 725 | odebug << "Detected subtype is " << managementType() << oendl; |
726 | 726 | ||
727 | // grab tagged values | 727 | // grab tagged values |
728 | const unsigned char* ptr = (const unsigned char*) (_body+1); | 728 | const unsigned char* ptr = (const unsigned char*) (_body+1); |
729 | while (ptr < end) | 729 | while (ptr < end) |
730 | { | 730 | { |
731 | switch ( *ptr ) | 731 | switch ( *ptr ) |
732 | { | 732 | { |
733 | case E_SSID: new OWaveLanManagementSSID( end, (struct ssid_t*) ptr, this ); break; | 733 | case E_SSID: new OWaveLanManagementSSID( end, (struct ssid_t*) ptr, this ); break; |
734 | case E_FH: new OWaveLanManagementFH( end, (struct fh_t*) ptr, this ); break; | 734 | case E_FH: new OWaveLanManagementFH( end, (struct fh_t*) ptr, this ); break; |
735 | case E_DS: new OWaveLanManagementDS( end, (struct ds_t*) ptr, this ); break; | 735 | case E_DS: new OWaveLanManagementDS( end, (struct ds_t*) ptr, this ); break; |
736 | case E_RATES: new OWaveLanManagementRates( end, (struct rates_t*) ptr, this ); break; | 736 | case E_RATES: new OWaveLanManagementRates( end, (struct rates_t*) ptr, this ); break; |
737 | case E_CF: new OWaveLanManagementCF( end, (struct cf_t*) ptr, this ); break; | 737 | case E_CF: new OWaveLanManagementCF( end, (struct cf_t*) ptr, this ); break; |
738 | case E_TIM: new OWaveLanManagementTim( end, (struct tim_t*) ptr, this ); break; | 738 | case E_TIM: new OWaveLanManagementTim( end, (struct tim_t*) ptr, this ); break; |
739 | case E_IBSS: new OWaveLanManagementIBSS( end, (struct ibss_t*) ptr, this ); break; | 739 | case E_IBSS: new OWaveLanManagementIBSS( end, (struct ibss_t*) ptr, this ); break; |
740 | case E_CHALLENGE: new OWaveLanManagementChallenge( end, (struct challenge_t*) ptr, this ); break; | 740 | case E_CHALLENGE: new OWaveLanManagementChallenge( end, (struct challenge_t*) ptr, this ); break; |
741 | } | 741 | } |
742 | ptr+= ( ( struct ssid_t* ) ptr )->length; // skip length of tagged value | 742 | ptr+= ( ( struct ssid_t* ) ptr )->length; // skip length of tagged value |
743 | ptr+= 2; // skip tag ID and length | 743 | ptr+= 2; // skip tag ID and length |
744 | } | 744 | } |
745 | } | 745 | } |
746 | 746 | ||
747 | 747 | ||
748 | OWaveLanManagementPacket::~OWaveLanManagementPacket() | 748 | OWaveLanManagementPacket::~OWaveLanManagementPacket() |
749 | { | 749 | { |
750 | } | 750 | } |
751 | 751 | ||
752 | 752 | ||
753 | QString OWaveLanManagementPacket::managementType() const | 753 | QString OWaveLanManagementPacket::managementType() const |
754 | { | 754 | { |
755 | switch ( FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) ) | 755 | switch ( FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) ) |
756 | { | 756 | { |
757 | case ST_ASSOC_REQUEST: return "AssociationRequest"; break; | 757 | case ST_ASSOC_REQUEST: return "AssociationRequest"; break; |
758 | case ST_ASSOC_RESPONSE: return "AssociationResponse"; break; | 758 | case ST_ASSOC_RESPONSE: return "AssociationResponse"; break; |
759 | case ST_REASSOC_REQUEST: return "ReassociationRequest"; break; | 759 | case ST_REASSOC_REQUEST: return "ReassociationRequest"; break; |
760 | case ST_REASSOC_RESPONSE: return "ReassociationResponse"; break; | 760 | case ST_REASSOC_RESPONSE: return "ReassociationResponse"; break; |
761 | case ST_PROBE_REQUEST: return "ProbeRequest"; break; | 761 | case ST_PROBE_REQUEST: return "ProbeRequest"; break; |
762 | case ST_PROBE_RESPONSE: return "ProbeResponse"; break; | 762 | case ST_PROBE_RESPONSE: return "ProbeResponse"; break; |
763 | case ST_BEACON: return "Beacon"; break; | 763 | case ST_BEACON: return "Beacon"; break; |
764 | case ST_ATIM: return "Atim"; break; | 764 | case ST_ATIM: return "Atim"; break; |
765 | case ST_DISASSOC: return "Disassociation"; break; | 765 | case ST_DISASSOC: return "Disassociation"; break; |
766 | case ST_AUTH: return "Authentication"; break; | 766 | case ST_AUTH: return "Authentication"; break; |
767 | case ST_DEAUTH: return "Deathentication"; break; | 767 | case ST_DEAUTH: return "Deathentication"; break; |
768 | default: owarn << "OWaveLanManagementPacket::managementType(): unhandled subtype " << FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) << oendl; return "Unknown"; | 768 | default: owarn << "OWaveLanManagementPacket::managementType(): unhandled subtype " << FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) << oendl; return "Unknown"; |
769 | } | 769 | } |
770 | } | 770 | } |
771 | 771 | ||
772 | 772 | ||
773 | int OWaveLanManagementPacket::beaconInterval() const | 773 | int OWaveLanManagementPacket::beaconInterval() const |
774 | { | 774 | { |
775 | return EXTRACT_LE_16BITS( &_body->beacon_interval ); | 775 | return EXTRACT_LE_16BITS( &_body->beacon_interval ); |
776 | } | 776 | } |
777 | 777 | ||
778 | 778 | ||
779 | int OWaveLanManagementPacket::capabilities() const | 779 | int OWaveLanManagementPacket::capabilities() const |
780 | { | 780 | { |
781 | return EXTRACT_LE_16BITS( &_body->capability_info ); | 781 | return EXTRACT_LE_16BITS( &_body->capability_info ); |
782 | } | 782 | } |
783 | 783 | ||
784 | 784 | ||
785 | bool OWaveLanManagementPacket::canESS() const | 785 | bool OWaveLanManagementPacket::canESS() const |
786 | { | 786 | { |
787 | return CAPABILITY_ESS( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 787 | return CAPABILITY_ESS( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
788 | } | 788 | } |
789 | 789 | ||
790 | 790 | ||
791 | bool OWaveLanManagementPacket::canIBSS() const | 791 | bool OWaveLanManagementPacket::canIBSS() const |
792 | { | 792 | { |
793 | return CAPABILITY_IBSS( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 793 | return CAPABILITY_IBSS( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
794 | } | 794 | } |
795 | 795 | ||
796 | 796 | ||
797 | bool OWaveLanManagementPacket::canCFP() const | 797 | bool OWaveLanManagementPacket::canCFP() const |
798 | { | 798 | { |
799 | return CAPABILITY_CFP( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 799 | return CAPABILITY_CFP( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
800 | } | 800 | } |
801 | 801 | ||
802 | 802 | ||
803 | bool OWaveLanManagementPacket::canCFP_REQ() const | 803 | bool OWaveLanManagementPacket::canCFP_REQ() const |
804 | { | 804 | { |
805 | return CAPABILITY_CFP_REQ( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 805 | return CAPABILITY_CFP_REQ( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
806 | } | 806 | } |
807 | 807 | ||
808 | 808 | ||
809 | bool OWaveLanManagementPacket::canPrivacy() const | 809 | bool OWaveLanManagementPacket::canPrivacy() const |
810 | { | 810 | { |
811 | return CAPABILITY_PRIVACY( EXTRACT_LE_16BITS( &_body->capability_info ) ); | 811 | return CAPABILITY_PRIVACY( EXTRACT_LE_16BITS( &_body->capability_info ) ); |
812 | } | 812 | } |
813 | 813 | ||
814 | 814 | ||
815 | /*====================================================================================== | 815 | /*====================================================================================== |
816 | * OWaveLanManagementSSID | 816 | * OWaveLanManagementSSID |
817 | *======================================================================================*/ | 817 | *======================================================================================*/ |
818 | 818 | ||
819 | OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const struct ssid_t* data, QObject* parent ) | 819 | OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const struct ssid_t* data, QObject* parent ) |
820 | :QObject( parent, "802.11 SSID" ), _data( data ) | 820 | :QObject( parent, "802.11 SSID" ), _data( data ) |
821 | { | 821 | { |
822 | odebug << "OWaveLanManagementSSID()" << oendl; | 822 | odebug << "OWaveLanManagementSSID()" << oendl; |
823 | } | 823 | } |
824 | 824 | ||
825 | 825 | ||
826 | OWaveLanManagementSSID::~OWaveLanManagementSSID() | 826 | OWaveLanManagementSSID::~OWaveLanManagementSSID() |
827 | { | 827 | { |
828 | } | 828 | } |
829 | 829 | ||
830 | 830 | ||
831 | QString OWaveLanManagementSSID::ID() const | 831 | QString OWaveLanManagementSSID::ID( bool decloak ) const |
832 | { | 832 | { |
833 | int length = _data->length; | 833 | int length = _data->length; |
834 | if ( length > 32 ) length = 32; | 834 | if ( length > 32 ) length = 32; |
835 | char essid[length+1]; | 835 | char essid[length+1]; |
836 | memcpy( &essid, &_data->ssid, length ); | 836 | memcpy( &essid, &_data->ssid, length ); |
837 | essid[length] = 0x0; | 837 | essid[length] = 0x0; |
838 | return essid; | 838 | if ( !decloak || length < 2 || essid[0] != '\0' ) return essid; |
839 | odebug << "OWaveLanManagementSSID:ID(): SSID is cloaked - decloaking..." << oendl; | ||
840 | |||
841 | QString decloakedID; | ||
842 | for ( int i = 1; i < length; ++i ) | ||
843 | { | ||
844 | if ( essid[i] >= 32 && essid[i] <= 126 ) decloakedID.append( essid[i] ); | ||
845 | else decloakedID.append( '.' ); | ||
846 | } | ||
847 | return decloakedID; | ||
839 | } | 848 | } |
840 | 849 | ||
841 | 850 | ||
842 | /*====================================================================================== | 851 | /*====================================================================================== |
843 | * OWaveLanManagementRates | 852 | * OWaveLanManagementRates |
844 | *======================================================================================*/ | 853 | *======================================================================================*/ |
845 | 854 | ||
846 | OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, const struct rates_t* data, QObject* parent ) | 855 | OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, const struct rates_t* data, QObject* parent ) |
847 | :QObject( parent, "802.11 Rates" ), _data( data ) | 856 | :QObject( parent, "802.11 Rates" ), _data( data ) |
848 | { | 857 | { |
849 | odebug << "OWaveLanManagementRates()" << oendl; | 858 | odebug << "OWaveLanManagementRates()" << oendl; |
850 | } | 859 | } |
851 | 860 | ||
852 | 861 | ||
853 | OWaveLanManagementRates::~OWaveLanManagementRates() | 862 | OWaveLanManagementRates::~OWaveLanManagementRates() |
854 | { | 863 | { |
855 | } | 864 | } |
856 | 865 | ||
857 | /*====================================================================================== | 866 | /*====================================================================================== |
858 | * OWaveLanManagementCF | 867 | * OWaveLanManagementCF |
859 | *======================================================================================*/ | 868 | *======================================================================================*/ |
860 | 869 | ||
861 | OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const struct cf_t* data, QObject* parent ) | 870 | OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const struct cf_t* data, QObject* parent ) |
862 | :QObject( parent, "802.11 CF" ), _data( data ) | 871 | :QObject( parent, "802.11 CF" ), _data( data ) |
863 | { | 872 | { |
864 | odebug << "OWaveLanManagementCF()" << oendl; | 873 | odebug << "OWaveLanManagementCF()" << oendl; |
865 | } | 874 | } |
866 | 875 | ||
867 | 876 | ||
868 | OWaveLanManagementCF::~OWaveLanManagementCF() | 877 | OWaveLanManagementCF::~OWaveLanManagementCF() |
869 | { | 878 | { |
870 | } | 879 | } |
871 | 880 | ||
872 | /*====================================================================================== | 881 | /*====================================================================================== |
873 | * OWaveLanManagementFH | 882 | * OWaveLanManagementFH |
874 | *======================================================================================*/ | 883 | *======================================================================================*/ |
875 | 884 | ||
876 | OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const struct fh_t* data, QObject* parent ) | 885 | OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const struct fh_t* data, QObject* parent ) |
877 | :QObject( parent, "802.11 FH" ), _data( data ) | 886 | :QObject( parent, "802.11 FH" ), _data( data ) |
878 | { | 887 | { |
879 | odebug << "OWaveLanManagementFH()" << oendl; | 888 | odebug << "OWaveLanManagementFH()" << oendl; |
880 | } | 889 | } |
881 | 890 | ||
882 | 891 | ||
883 | OWaveLanManagementFH::~OWaveLanManagementFH() | 892 | OWaveLanManagementFH::~OWaveLanManagementFH() |
884 | { | 893 | { |
885 | } | 894 | } |
886 | 895 | ||
887 | /*====================================================================================== | 896 | /*====================================================================================== |
888 | * OWaveLanManagementDS | 897 | * OWaveLanManagementDS |
889 | *======================================================================================*/ | 898 | *======================================================================================*/ |
890 | 899 | ||
891 | OWaveLanManagementDS::OWaveLanManagementDS( const unsigned char* end, const struct ds_t* data, QObject* parent ) | 900 | OWaveLanManagementDS::OWaveLanManagementDS( const unsigned char* end, const struct ds_t* data, QObject* parent ) |
892 | :QObject( parent, "802.11 DS" ), _data( data ) | 901 | :QObject( parent, "802.11 DS" ), _data( data ) |
893 | { | 902 | { |
894 | odebug << "OWaveLanManagementDS()" << oendl; | 903 | odebug << "OWaveLanManagementDS()" << oendl; |
895 | } | 904 | } |
896 | 905 | ||
897 | 906 | ||
898 | OWaveLanManagementDS::~OWaveLanManagementDS() | 907 | OWaveLanManagementDS::~OWaveLanManagementDS() |
899 | { | 908 | { |
900 | } | 909 | } |
901 | 910 | ||
902 | 911 | ||
903 | int OWaveLanManagementDS::channel() const | 912 | int OWaveLanManagementDS::channel() const |
904 | { | 913 | { |
905 | return _data->channel; | 914 | return _data->channel; |
906 | } | 915 | } |
907 | 916 | ||
908 | /*====================================================================================== | 917 | /*====================================================================================== |
909 | * OWaveLanManagementTim | 918 | * OWaveLanManagementTim |
910 | *======================================================================================*/ | 919 | *======================================================================================*/ |
911 | 920 | ||
912 | OWaveLanManagementTim::OWaveLanManagementTim( const unsigned char* end, const struct tim_t* data, QObject* parent ) | 921 | OWaveLanManagementTim::OWaveLanManagementTim( const unsigned char* end, const struct tim_t* data, QObject* parent ) |
913 | :QObject( parent, "802.11 Tim" ), _data( data ) | 922 | :QObject( parent, "802.11 Tim" ), _data( data ) |
914 | { | 923 | { |
915 | odebug << "OWaveLanManagementTim()" << oendl; | 924 | odebug << "OWaveLanManagementTim()" << oendl; |
916 | } | 925 | } |
917 | 926 | ||
918 | 927 | ||
919 | OWaveLanManagementTim::~OWaveLanManagementTim() | 928 | OWaveLanManagementTim::~OWaveLanManagementTim() |
920 | { | 929 | { |
921 | } | 930 | } |
922 | 931 | ||
923 | /*====================================================================================== | 932 | /*====================================================================================== |
924 | * OWaveLanManagementIBSS | 933 | * OWaveLanManagementIBSS |
925 | *======================================================================================*/ | 934 | *======================================================================================*/ |
926 | 935 | ||
927 | OWaveLanManagementIBSS::OWaveLanManagementIBSS( const unsigned char* end, const struct ibss_t* data, QObject* parent ) | 936 | OWaveLanManagementIBSS::OWaveLanManagementIBSS( const unsigned char* end, const struct ibss_t* data, QObject* parent ) |
928 | :QObject( parent, "802.11 IBSS" ), _data( data ) | 937 | :QObject( parent, "802.11 IBSS" ), _data( data ) |
929 | { | 938 | { |
930 | odebug << "OWaveLanManagementIBSS()" << oendl; | 939 | odebug << "OWaveLanManagementIBSS()" << oendl; |
931 | } | 940 | } |
932 | 941 | ||
933 | 942 | ||
934 | OWaveLanManagementIBSS::~OWaveLanManagementIBSS() | 943 | OWaveLanManagementIBSS::~OWaveLanManagementIBSS() |
935 | { | 944 | { |
936 | } | 945 | } |
937 | 946 | ||
938 | /*====================================================================================== | 947 | /*====================================================================================== |
939 | * OWaveLanManagementChallenge | 948 | * OWaveLanManagementChallenge |
940 | *======================================================================================*/ | 949 | *======================================================================================*/ |
941 | 950 | ||
942 | OWaveLanManagementChallenge::OWaveLanManagementChallenge( const unsigned char* end, const struct challenge_t* data, QObject* parent ) | 951 | OWaveLanManagementChallenge::OWaveLanManagementChallenge( const unsigned char* end, const struct challenge_t* data, QObject* parent ) |
943 | :QObject( parent, "802.11 Challenge" ), _data( data ) | 952 | :QObject( parent, "802.11 Challenge" ), _data( data ) |
944 | { | 953 | { |
945 | odebug << "OWaveLanManagementChallenge()" << oendl; | 954 | odebug << "OWaveLanManagementChallenge()" << oendl; |
946 | } | 955 | } |
947 | 956 | ||
948 | 957 | ||
949 | OWaveLanManagementChallenge::~OWaveLanManagementChallenge() | 958 | OWaveLanManagementChallenge::~OWaveLanManagementChallenge() |
950 | { | 959 | { |
951 | } | 960 | } |
952 | 961 | ||
953 | /*====================================================================================== | 962 | /*====================================================================================== |
954 | * OWaveLanDataPacket | 963 | * OWaveLanDataPacket |
955 | *======================================================================================*/ | 964 | *======================================================================================*/ |
956 | 965 | ||
957 | OWaveLanDataPacket::OWaveLanDataPacket( const unsigned char* end, const struct ieee_802_11_data_header* data, OWaveLanPacket* parent ) | 966 | OWaveLanDataPacket::OWaveLanDataPacket( const unsigned char* end, const struct ieee_802_11_data_header* data, OWaveLanPacket* parent ) |
958 | :QObject( parent, "802.11 Data" ), _header( data ) | 967 | :QObject( parent, "802.11 Data" ), _header( data ) |
959 | { | 968 | { |
960 | odebug << "OWaveLanDataPacket::OWaveLanDataPacket(): decoding frame..." << oendl; | 969 | odebug << "OWaveLanDataPacket::OWaveLanDataPacket(): decoding frame..." << oendl; |
961 | 970 | ||
962 | const unsigned char* payload = (const unsigned char*) data + sizeof( struct ieee_802_11_data_header ); | 971 | const unsigned char* payload = (const unsigned char*) data + sizeof( struct ieee_802_11_data_header ); |
963 | 972 | ||
964 | #warning The next line works for most cases, but can not be correct generally! | 973 | #warning The next line works for most cases, but can not be correct generally! |
965 | if (!( ( (OWaveLanPacket*) this->parent())->duration() )) payload -= 6; // compensation for missing last address | 974 | if (!( ( (OWaveLanPacket*) this->parent())->duration() )) payload -= 6; // compensation for missing last address |
966 | 975 | ||
967 | new OLLCPacket( end, (const struct ieee_802_11_802_2_header*) payload, this ); | 976 | new OLLCPacket( end, (const struct ieee_802_11_802_2_header*) payload, this ); |
968 | } | 977 | } |
969 | 978 | ||
970 | 979 | ||
971 | OWaveLanDataPacket::~OWaveLanDataPacket() | 980 | OWaveLanDataPacket::~OWaveLanDataPacket() |
972 | { | 981 | { |
973 | } | 982 | } |
974 | 983 | ||
975 | 984 | ||
976 | /*====================================================================================== | 985 | /*====================================================================================== |
977 | * OLLCPacket | 986 | * OLLCPacket |
978 | *======================================================================================*/ | 987 | *======================================================================================*/ |
979 | 988 | ||
980 | OLLCPacket::OLLCPacket( const unsigned char* end, const struct ieee_802_11_802_2_header* data, QObject* parent ) | 989 | OLLCPacket::OLLCPacket( const unsigned char* end, const struct ieee_802_11_802_2_header* data, QObject* parent ) |
981 | :QObject( parent, "802.11 LLC" ), _header( data ) | 990 | :QObject( parent, "802.11 LLC" ), _header( data ) |
982 | { | 991 | { |
983 | odebug << "OLLCPacket::OLLCPacket(): decoding frame..." << oendl; | 992 | odebug << "OLLCPacket::OLLCPacket(): decoding frame..." << oendl; |
984 | 993 | ||
985 | if ( !(_header->oui[0] || _header->oui[1] || _header->oui[2]) ) | 994 | if ( !(_header->oui[0] || _header->oui[1] || _header->oui[2]) ) |
986 | { | 995 | { |
987 | owarn << "OLLCPacket::OLLCPacket(): contains an encapsulated Ethernet frame (type = " << EXTRACT_16BITS( &_header->type ) << ")" << oendl; | 996 | owarn << "OLLCPacket::OLLCPacket(): contains an encapsulated Ethernet frame (type = " << EXTRACT_16BITS( &_header->type ) << ")" << oendl; |
988 | 997 | ||
989 | switch ( EXTRACT_16BITS( &_header->type ) ) // defined in linux/if_ether.h | 998 | switch ( EXTRACT_16BITS( &_header->type ) ) // defined in linux/if_ether.h |
990 | { | 999 | { |
991 | case ETH_P_IP: new OIPPacket( end, (const struct iphdr*) (data+1), this ); break; | 1000 | case ETH_P_IP: new OIPPacket( end, (const struct iphdr*) (data+1), this ); break; |
992 | case ETH_P_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break; | 1001 | case ETH_P_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break; |
993 | default: owarn << "OLLCPacket::OLLCPacket(): Unknown Encapsulation type = " << EXTRACT_16BITS( &_header->type ) << oendl; | 1002 | default: owarn << "OLLCPacket::OLLCPacket(): Unknown Encapsulation type = " << EXTRACT_16BITS( &_header->type ) << oendl; |
994 | } | 1003 | } |
995 | } | 1004 | } |
996 | } | 1005 | } |
997 | 1006 | ||
998 | 1007 | ||
999 | OLLCPacket::~OLLCPacket() | 1008 | OLLCPacket::~OLLCPacket() |
1000 | { | 1009 | { |
1001 | } | 1010 | } |
1002 | 1011 | ||
1003 | 1012 | ||
1004 | /*====================================================================================== | 1013 | /*====================================================================================== |
1005 | * OWaveLanControlPacket | 1014 | * OWaveLanControlPacket |
1006 | *======================================================================================*/ | 1015 | *======================================================================================*/ |
1007 | 1016 | ||
1008 | OWaveLanControlPacket::OWaveLanControlPacket( const unsigned char* end, const struct ieee_802_11_control_header* data, OWaveLanPacket* parent ) | 1017 | OWaveLanControlPacket::OWaveLanControlPacket( const unsigned char* end, const struct ieee_802_11_control_header* data, OWaveLanPacket* parent ) |
1009 | :QObject( parent, "802.11 Control" ), _header( data ) | 1018 | :QObject( parent, "802.11 Control" ), _header( data ) |
1010 | { | 1019 | { |
1011 | odebug << "OWaveLanControlPacket::OWaveLanDataControl(): decoding frame..." << oendl; | 1020 | odebug << "OWaveLanControlPacket::OWaveLanDataControl(): decoding frame..." << oendl; |
1012 | odebug << "Detected subtype is " << controlType() << oendl; | 1021 | odebug << "Detected subtype is " << controlType() << oendl; |
1013 | } | 1022 | } |
1014 | 1023 | ||
1015 | 1024 | ||
1016 | OWaveLanControlPacket::~OWaveLanControlPacket() | 1025 | OWaveLanControlPacket::~OWaveLanControlPacket() |
1017 | { | 1026 | { |
1018 | } | 1027 | } |
1019 | 1028 | ||
1020 | 1029 | ||
1021 | QString OWaveLanControlPacket::controlType() const | 1030 | QString OWaveLanControlPacket::controlType() const |
1022 | { | 1031 | { |
1023 | switch ( FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) ) | 1032 | switch ( FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) ) |
1024 | { | 1033 | { |
1025 | case CTRL_PS_POLL: return "PowerSavePoll"; break; | 1034 | case CTRL_PS_POLL: return "PowerSavePoll"; break; |
1026 | case CTRL_RTS: return "RequestToSend"; break; | 1035 | case CTRL_RTS: return "RequestToSend"; break; |
1027 | case CTRL_CTS: return "ClearToSend"; break; | 1036 | case CTRL_CTS: return "ClearToSend"; break; |
1028 | case CTRL_ACK: return "Acknowledge"; break; | 1037 | case CTRL_ACK: return "Acknowledge"; break; |
1029 | case CTRL_CF_END: return "ContentionFreeEnd"; break; | 1038 | case CTRL_CF_END: return "ContentionFreeEnd"; break; |
1030 | case CTRL_END_ACK: return "AcknowledgeEnd"; break; | 1039 | case CTRL_END_ACK: return "AcknowledgeEnd"; break; |
diff --git a/libopie2/opienet/opcap.h b/libopie2/opienet/opcap.h index b373c56..f5dc5c0 100644 --- a/libopie2/opienet/opcap.h +++ b/libopie2/opienet/opcap.h | |||
@@ -60,385 +60,385 @@ extern "C" // work around a bpf/pcap conflict in recent headers | |||
60 | /* TYPEDEFS */ | 60 | /* TYPEDEFS */ |
61 | typedef struct timeval timevalstruct; | 61 | typedef struct timeval timevalstruct; |
62 | typedef struct pcap_pkthdr packetheaderstruct; | 62 | typedef struct pcap_pkthdr packetheaderstruct; |
63 | 63 | ||
64 | /* FORWARDS */ | 64 | /* FORWARDS */ |
65 | class OPacketCapturer; | 65 | class OPacketCapturer; |
66 | class QSocketNotifier; | 66 | class QSocketNotifier; |
67 | 67 | ||
68 | /*====================================================================================== | 68 | /*====================================================================================== |
69 | * OPacket - A frame on the wire | 69 | * OPacket - A frame on the wire |
70 | *======================================================================================*/ | 70 | *======================================================================================*/ |
71 | 71 | ||
72 | /** @brief A class representing a data frame on the wire. | 72 | /** @brief A class representing a data frame on the wire. |
73 | * | 73 | * |
74 | * The whole family of the packet classes are used when capturing frames from a network. | 74 | * The whole family of the packet classes are used when capturing frames from a network. |
75 | * Most standard network protocols in use share a common architecture, which mostly is | 75 | * Most standard network protocols in use share a common architecture, which mostly is |
76 | * a packet header and then the packet payload. In layered architectures, each lower layer | 76 | * a packet header and then the packet payload. In layered architectures, each lower layer |
77 | * encapsulates data from its upper layer - that is it | 77 | * encapsulates data from its upper layer - that is it |
78 | * treats the data from its upper layer as payload and prepends an own header to the packet, | 78 | * treats the data from its upper layer as payload and prepends an own header to the packet, |
79 | * which - again - is treated as the payload for the layer below. The figure below is an | 79 | * which - again - is treated as the payload for the layer below. The figure below is an |
80 | * example for how such a data frame is composed out of packets, e.g. when sending a mail. | 80 | * example for how such a data frame is composed out of packets, e.g. when sending a mail. |
81 | * | 81 | * |
82 | * <pre> | 82 | * <pre> |
83 | * | User Data | == Mail Data | 83 | * | User Data | == Mail Data |
84 | * | SMTP Header | User Data | == SMTP | 84 | * | SMTP Header | User Data | == SMTP |
85 | * | TCP Header | SMTP Header | User Data | == TCP | 85 | * | TCP Header | SMTP Header | User Data | == TCP |
86 | * | IP Header | TCP Header | SMTP Header | User Data | == IP | 86 | * | IP Header | TCP Header | SMTP Header | User Data | == IP |
87 | * | MAC Header | IP Header | TCP Header | SMTP Header | User Data | == MAC | 87 | * | MAC Header | IP Header | TCP Header | SMTP Header | User Data | == MAC |
88 | * | 88 | * |
89 | * </pre> | 89 | * </pre> |
90 | * | 90 | * |
91 | * The example is trimmed for simplicity, because the MAC (Medium Access Control) layer | 91 | * The example is trimmed for simplicity, because the MAC (Medium Access Control) layer |
92 | * also contains a few more levels of encapsulation. | 92 | * also contains a few more levels of encapsulation. |
93 | * Since the type of the payload is more or less independent from the encapsulating protocol, | 93 | * Since the type of the payload is more or less independent from the encapsulating protocol, |
94 | * the header must be inspected before attempting to decode the payload. Hence, the | 94 | * the header must be inspected before attempting to decode the payload. Hence, the |
95 | * encapsulation level varies and can't be deduced without actually looking into the packets. | 95 | * encapsulation level varies and can't be deduced without actually looking into the packets. |
96 | * | 96 | * |
97 | * For actually working with captured frames, it's useful to identify the packets via names and | 97 | * For actually working with captured frames, it's useful to identify the packets via names and |
98 | * insert them into a parent/child - relationship based on the encapsulation. This is why | 98 | * insert them into a parent/child - relationship based on the encapsulation. This is why |
99 | * all packet classes derive from QObject. The amount of overhead caused by the QObject is | 99 | * all packet classes derive from QObject. The amount of overhead caused by the QObject is |
100 | * not a problem in this case, because we're talking about a theoratical maximum of about | 100 | * not a problem in this case, because we're talking about a theoratical maximum of about |
101 | * 10 packets per captured frame. We need to stuff them into a searchable list anyway and the | 101 | * 10 packets per captured frame. We need to stuff them into a searchable list anyway and the |
102 | * QObject also cares about destroying the sub-, (child-) packets. | 102 | * QObject also cares about destroying the sub-, (child-) packets. |
103 | * | 103 | * |
104 | * This enables us to perform a simple look for packets of a certain type: | 104 | * This enables us to perform a simple look for packets of a certain type: |
105 | * @code | 105 | * @code |
106 | * OPacketCapturer* pcap = new OPacketCapturer(); | 106 | * OPacketCapturer* pcap = new OPacketCapturer(); |
107 | * pcap->open( "eth0" ); | 107 | * pcap->open( "eth0" ); |
108 | * OPacket* p = pcap->next(); | 108 | * OPacket* p = pcap->next(); |
109 | * OIPPacket* ip = (OIPPacket*) p->child( "IP" ); // returns 0, if no such child exists | 109 | * OIPPacket* ip = (OIPPacket*) p->child( "IP" ); // returns 0, if no such child exists |
110 | * odebug << "got ip packet from " << ip->fromIPAddress().toString() << " to " << ip->toIPAddress().toString() << oendl; | 110 | * odebug << "got ip packet from " << ip->fromIPAddress().toString() << " to " << ip->toIPAddress().toString() << oendl; |
111 | * | 111 | * |
112 | */ | 112 | */ |
113 | 113 | ||
114 | class OPacket : public QObject | 114 | class OPacket : public QObject |
115 | { | 115 | { |
116 | Q_OBJECT | 116 | Q_OBJECT |
117 | 117 | ||
118 | friend class OPacketCapturer; | 118 | friend class OPacketCapturer; |
119 | 119 | ||
120 | public: | 120 | public: |
121 | OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); | 121 | OPacket( int datalink, packetheaderstruct, const unsigned char*, QObject* parent ); |
122 | virtual ~OPacket(); | 122 | virtual ~OPacket(); |
123 | 123 | ||
124 | timevalstruct timeval() const; | 124 | timevalstruct timeval() const; |
125 | 125 | ||
126 | int caplen() const; | 126 | int caplen() const; |
127 | int len() const; | 127 | int len() const; |
128 | QString dump( int = 32 ) const; | 128 | QString dump( int = 32 ) const; |
129 | 129 | ||
130 | void updateStats( QMap<QString,int>&, QObjectList* ); | 130 | void updateStats( QMap<QString,int>&, QObjectList* ); |
131 | 131 | ||
132 | private: | 132 | private: |
133 | 133 | ||
134 | void dumpStructure( QObjectList* ); | 134 | void dumpStructure( QObjectList* ); |
135 | QString _dumpStructure( QObjectList* ); | 135 | QString _dumpStructure( QObjectList* ); |
136 | 136 | ||
137 | private: | 137 | private: |
138 | const packetheaderstruct _hdr; // pcap packet header | 138 | const packetheaderstruct _hdr; // pcap packet header |
139 | const unsigned char* _data; // pcap packet data | 139 | const unsigned char* _data; // pcap packet data |
140 | const unsigned char* _end; // end of pcap packet data | 140 | const unsigned char* _end; // end of pcap packet data |
141 | }; | 141 | }; |
142 | 142 | ||
143 | /*====================================================================================== | 143 | /*====================================================================================== |
144 | * OEthernetPacket - DLT_EN10MB frame | 144 | * OEthernetPacket - DLT_EN10MB frame |
145 | *======================================================================================*/ | 145 | *======================================================================================*/ |
146 | 146 | ||
147 | class OEthernetPacket : public QObject | 147 | class OEthernetPacket : public QObject |
148 | { | 148 | { |
149 | Q_OBJECT | 149 | Q_OBJECT |
150 | 150 | ||
151 | public: | 151 | public: |
152 | OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); | 152 | OEthernetPacket( const unsigned char*, const struct ether_header*, QObject* parent = 0 ); |
153 | virtual ~OEthernetPacket(); | 153 | virtual ~OEthernetPacket(); |
154 | 154 | ||
155 | OMacAddress sourceAddress() const; | 155 | OMacAddress sourceAddress() const; |
156 | OMacAddress destinationAddress() const; | 156 | OMacAddress destinationAddress() const; |
157 | int type() const; | 157 | int type() const; |
158 | 158 | ||
159 | private: | 159 | private: |
160 | const struct ether_header* _ether; | 160 | const struct ether_header* _ether; |
161 | }; | 161 | }; |
162 | 162 | ||
163 | /*====================================================================================== | 163 | /*====================================================================================== |
164 | * OPrismHeaderPacket - DLT_PRISM_HEADER frame | 164 | * OPrismHeaderPacket - DLT_PRISM_HEADER frame |
165 | *======================================================================================*/ | 165 | *======================================================================================*/ |
166 | 166 | ||
167 | class OPrismHeaderPacket : public QObject | 167 | class OPrismHeaderPacket : public QObject |
168 | { | 168 | { |
169 | Q_OBJECT | 169 | Q_OBJECT |
170 | 170 | ||
171 | public: | 171 | public: |
172 | OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 ); | 172 | OPrismHeaderPacket( const unsigned char*, const struct prism_hdr*, QObject* parent = 0 ); |
173 | virtual ~OPrismHeaderPacket(); | 173 | virtual ~OPrismHeaderPacket(); |
174 | 174 | ||
175 | unsigned int signalStrength() const; | 175 | unsigned int signalStrength() const; |
176 | 176 | ||
177 | private: | 177 | private: |
178 | const struct prism_hdr* _header; | 178 | const struct prism_hdr* _header; |
179 | }; | 179 | }; |
180 | 180 | ||
181 | /*====================================================================================== | 181 | /*====================================================================================== |
182 | * OWaveLanPacket - DLT_IEEE802_11 frame | 182 | * OWaveLanPacket - DLT_IEEE802_11 frame |
183 | *======================================================================================*/ | 183 | *======================================================================================*/ |
184 | 184 | ||
185 | class OWaveLanPacket : public QObject | 185 | class OWaveLanPacket : public QObject |
186 | { | 186 | { |
187 | Q_OBJECT | 187 | Q_OBJECT |
188 | 188 | ||
189 | public: | 189 | public: |
190 | OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 ); | 190 | OWaveLanPacket( const unsigned char*, const struct ieee_802_11_header*, QObject* parent = 0 ); |
191 | virtual ~OWaveLanPacket(); | 191 | virtual ~OWaveLanPacket(); |
192 | 192 | ||
193 | int duration() const; | 193 | int duration() const; |
194 | bool fromDS() const; | 194 | bool fromDS() const; |
195 | bool toDS() const; | 195 | bool toDS() const; |
196 | virtual OMacAddress macAddress1() const; | 196 | virtual OMacAddress macAddress1() const; |
197 | virtual OMacAddress macAddress2() const; | 197 | virtual OMacAddress macAddress2() const; |
198 | virtual OMacAddress macAddress3() const; | 198 | virtual OMacAddress macAddress3() const; |
199 | virtual OMacAddress macAddress4() const; | 199 | virtual OMacAddress macAddress4() const; |
200 | bool usesPowerManagement() const; | 200 | bool usesPowerManagement() const; |
201 | int type() const; | 201 | int type() const; |
202 | int subType() const; | 202 | int subType() const; |
203 | int version() const; | 203 | int version() const; |
204 | bool usesWep() const; | 204 | bool usesWep() const; |
205 | 205 | ||
206 | private: | 206 | private: |
207 | const struct ieee_802_11_header* _wlanhdr; | 207 | const struct ieee_802_11_header* _wlanhdr; |
208 | }; | 208 | }; |
209 | 209 | ||
210 | 210 | ||
211 | /*====================================================================================== | 211 | /*====================================================================================== |
212 | * OWaveLanManagementPacket - type: management (T_MGMT) | 212 | * OWaveLanManagementPacket - type: management (T_MGMT) |
213 | *======================================================================================*/ | 213 | *======================================================================================*/ |
214 | 214 | ||
215 | class OWaveLanManagementPacket : public QObject | 215 | class OWaveLanManagementPacket : public QObject |
216 | { | 216 | { |
217 | Q_OBJECT | 217 | Q_OBJECT |
218 | 218 | ||
219 | public: | 219 | public: |
220 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); | 220 | OWaveLanManagementPacket( const unsigned char*, const struct ieee_802_11_mgmt_header*, OWaveLanPacket* parent = 0 ); |
221 | virtual ~OWaveLanManagementPacket(); | 221 | virtual ~OWaveLanManagementPacket(); |
222 | 222 | ||
223 | QString managementType() const; | 223 | QString managementType() const; |
224 | 224 | ||
225 | int beaconInterval() const; | 225 | int beaconInterval() const; |
226 | int capabilities() const; // generic | 226 | int capabilities() const; // generic |
227 | 227 | ||
228 | bool canESS() const; | 228 | bool canESS() const; |
229 | bool canIBSS() const; | 229 | bool canIBSS() const; |
230 | bool canCFP() const; | 230 | bool canCFP() const; |
231 | bool canCFP_REQ() const; | 231 | bool canCFP_REQ() const; |
232 | bool canPrivacy() const; | 232 | bool canPrivacy() const; |
233 | 233 | ||
234 | private: | 234 | private: |
235 | const struct ieee_802_11_mgmt_header* _header; | 235 | const struct ieee_802_11_mgmt_header* _header; |
236 | const struct ieee_802_11_mgmt_body* _body; | 236 | const struct ieee_802_11_mgmt_body* _body; |
237 | }; | 237 | }; |
238 | 238 | ||
239 | 239 | ||
240 | /*====================================================================================== | 240 | /*====================================================================================== |
241 | * OWaveLanManagementSSID | 241 | * OWaveLanManagementSSID |
242 | *======================================================================================*/ | 242 | *======================================================================================*/ |
243 | 243 | ||
244 | class OWaveLanManagementSSID : public QObject | 244 | class OWaveLanManagementSSID : public QObject |
245 | { | 245 | { |
246 | Q_OBJECT | 246 | Q_OBJECT |
247 | 247 | ||
248 | public: | 248 | public: |
249 | OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 ); | 249 | OWaveLanManagementSSID( const unsigned char*, const struct ssid_t*, QObject* parent = 0 ); |
250 | virtual ~OWaveLanManagementSSID(); | 250 | virtual ~OWaveLanManagementSSID(); |
251 | 251 | ||
252 | QString ID() const; | 252 | QString ID( bool decloak = false ) const; |
253 | 253 | ||
254 | private: | 254 | private: |
255 | const struct ssid_t* _data; | 255 | const struct ssid_t* _data; |
256 | }; | 256 | }; |
257 | 257 | ||
258 | /*====================================================================================== | 258 | /*====================================================================================== |
259 | * OWaveLanManagementRates | 259 | * OWaveLanManagementRates |
260 | *======================================================================================*/ | 260 | *======================================================================================*/ |
261 | 261 | ||
262 | class OWaveLanManagementRates : public QObject | 262 | class OWaveLanManagementRates : public QObject |
263 | { | 263 | { |
264 | Q_OBJECT | 264 | Q_OBJECT |
265 | 265 | ||
266 | public: | 266 | public: |
267 | OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 ); | 267 | OWaveLanManagementRates( const unsigned char*, const struct rates_t*, QObject* parent = 0 ); |
268 | virtual ~OWaveLanManagementRates(); | 268 | virtual ~OWaveLanManagementRates(); |
269 | 269 | ||
270 | private: | 270 | private: |
271 | const struct rates_t* _data; | 271 | const struct rates_t* _data; |
272 | }; | 272 | }; |
273 | 273 | ||
274 | /*====================================================================================== | 274 | /*====================================================================================== |
275 | * OWaveLanManagementCF | 275 | * OWaveLanManagementCF |
276 | *======================================================================================*/ | 276 | *======================================================================================*/ |
277 | 277 | ||
278 | class OWaveLanManagementCF : public QObject | 278 | class OWaveLanManagementCF : public QObject |
279 | { | 279 | { |
280 | Q_OBJECT | 280 | Q_OBJECT |
281 | 281 | ||
282 | public: | 282 | public: |
283 | OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 ); | 283 | OWaveLanManagementCF( const unsigned char*, const struct cf_t*, QObject* parent = 0 ); |
284 | virtual ~OWaveLanManagementCF(); | 284 | virtual ~OWaveLanManagementCF(); |
285 | 285 | ||
286 | private: | 286 | private: |
287 | const struct cf_t* _data; | 287 | const struct cf_t* _data; |
288 | }; | 288 | }; |
289 | 289 | ||
290 | /*====================================================================================== | 290 | /*====================================================================================== |
291 | * OWaveLanManagementFH | 291 | * OWaveLanManagementFH |
292 | *======================================================================================*/ | 292 | *======================================================================================*/ |
293 | 293 | ||
294 | class OWaveLanManagementFH : public QObject | 294 | class OWaveLanManagementFH : public QObject |
295 | { | 295 | { |
296 | Q_OBJECT | 296 | Q_OBJECT |
297 | 297 | ||
298 | public: | 298 | public: |
299 | OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 ); | 299 | OWaveLanManagementFH( const unsigned char*, const struct fh_t*, QObject* parent = 0 ); |
300 | virtual ~OWaveLanManagementFH(); | 300 | virtual ~OWaveLanManagementFH(); |
301 | 301 | ||
302 | private: | 302 | private: |
303 | const struct fh_t* _data; | 303 | const struct fh_t* _data; |
304 | }; | 304 | }; |
305 | 305 | ||
306 | /*====================================================================================== | 306 | /*====================================================================================== |
307 | * OWaveLanManagementDS | 307 | * OWaveLanManagementDS |
308 | *======================================================================================*/ | 308 | *======================================================================================*/ |
309 | 309 | ||
310 | class OWaveLanManagementDS : public QObject | 310 | class OWaveLanManagementDS : public QObject |
311 | { | 311 | { |
312 | Q_OBJECT | 312 | Q_OBJECT |
313 | 313 | ||
314 | public: | 314 | public: |
315 | OWaveLanManagementDS( const unsigned char*, const struct ds_t*, QObject* parent = 0 ); | 315 | OWaveLanManagementDS( const unsigned char*, const struct ds_t*, QObject* parent = 0 ); |
316 | virtual ~OWaveLanManagementDS(); | 316 | virtual ~OWaveLanManagementDS(); |
317 | 317 | ||
318 | int channel() const; | 318 | int channel() const; |
319 | 319 | ||
320 | private: | 320 | private: |
321 | const struct ds_t* _data; | 321 | const struct ds_t* _data; |
322 | }; | 322 | }; |
323 | 323 | ||
324 | /*====================================================================================== | 324 | /*====================================================================================== |
325 | * OWaveLanManagementTim | 325 | * OWaveLanManagementTim |
326 | *======================================================================================*/ | 326 | *======================================================================================*/ |
327 | 327 | ||
328 | class OWaveLanManagementTim : public QObject | 328 | class OWaveLanManagementTim : public QObject |
329 | { | 329 | { |
330 | Q_OBJECT | 330 | Q_OBJECT |
331 | 331 | ||
332 | public: | 332 | public: |
333 | OWaveLanManagementTim( const unsigned char*, const struct tim_t*, QObject* parent = 0 ); | 333 | OWaveLanManagementTim( const unsigned char*, const struct tim_t*, QObject* parent = 0 ); |
334 | virtual ~OWaveLanManagementTim(); | 334 | virtual ~OWaveLanManagementTim(); |
335 | 335 | ||
336 | private: | 336 | private: |
337 | const struct tim_t* _data; | 337 | const struct tim_t* _data; |
338 | }; | 338 | }; |
339 | 339 | ||
340 | /*====================================================================================== | 340 | /*====================================================================================== |
341 | * OWaveLanManagementIBSS | 341 | * OWaveLanManagementIBSS |
342 | *======================================================================================*/ | 342 | *======================================================================================*/ |
343 | 343 | ||
344 | class OWaveLanManagementIBSS : public QObject | 344 | class OWaveLanManagementIBSS : public QObject |
345 | { | 345 | { |
346 | Q_OBJECT | 346 | Q_OBJECT |
347 | 347 | ||
348 | public: | 348 | public: |
349 | OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 ); | 349 | OWaveLanManagementIBSS( const unsigned char*, const struct ibss_t*, QObject* parent = 0 ); |
350 | virtual ~OWaveLanManagementIBSS(); | 350 | virtual ~OWaveLanManagementIBSS(); |
351 | 351 | ||
352 | private: | 352 | private: |
353 | const struct ibss_t* _data; | 353 | const struct ibss_t* _data; |
354 | }; | 354 | }; |
355 | 355 | ||
356 | /*====================================================================================== | 356 | /*====================================================================================== |
357 | * OWaveLanManagementChallenge | 357 | * OWaveLanManagementChallenge |
358 | *======================================================================================*/ | 358 | *======================================================================================*/ |
359 | 359 | ||
360 | class OWaveLanManagementChallenge : public QObject | 360 | class OWaveLanManagementChallenge : public QObject |
361 | { | 361 | { |
362 | Q_OBJECT | 362 | Q_OBJECT |
363 | 363 | ||
364 | public: | 364 | public: |
365 | OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 ); | 365 | OWaveLanManagementChallenge( const unsigned char*, const struct challenge_t*, QObject* parent = 0 ); |
366 | virtual ~OWaveLanManagementChallenge(); | 366 | virtual ~OWaveLanManagementChallenge(); |
367 | 367 | ||
368 | private: | 368 | private: |
369 | const struct challenge_t* _data; | 369 | const struct challenge_t* _data; |
370 | }; | 370 | }; |
371 | 371 | ||
372 | /*====================================================================================== | 372 | /*====================================================================================== |
373 | * OWaveLanDataPacket - type: data (T_DATA) | 373 | * OWaveLanDataPacket - type: data (T_DATA) |
374 | *======================================================================================*/ | 374 | *======================================================================================*/ |
375 | 375 | ||
376 | class OWaveLanDataPacket : public QObject | 376 | class OWaveLanDataPacket : public QObject |
377 | { | 377 | { |
378 | Q_OBJECT | 378 | Q_OBJECT |
379 | 379 | ||
380 | public: | 380 | public: |
381 | OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 ); | 381 | OWaveLanDataPacket( const unsigned char*, const struct ieee_802_11_data_header*, OWaveLanPacket* parent = 0 ); |
382 | virtual ~OWaveLanDataPacket(); | 382 | virtual ~OWaveLanDataPacket(); |
383 | 383 | ||
384 | private: | 384 | private: |
385 | const struct ieee_802_11_data_header* _header; | 385 | const struct ieee_802_11_data_header* _header; |
386 | }; | 386 | }; |
387 | 387 | ||
388 | /*====================================================================================== | 388 | /*====================================================================================== |
389 | * OWaveLanControlPacket - type: control (T_CTRL) | 389 | * OWaveLanControlPacket - type: control (T_CTRL) |
390 | *======================================================================================*/ | 390 | *======================================================================================*/ |
391 | 391 | ||
392 | class OWaveLanControlPacket : public QObject | 392 | class OWaveLanControlPacket : public QObject |
393 | { | 393 | { |
394 | Q_OBJECT | 394 | Q_OBJECT |
395 | 395 | ||
396 | public: | 396 | public: |
397 | OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 ); | 397 | OWaveLanControlPacket( const unsigned char*, const struct ieee_802_11_control_header*, OWaveLanPacket* parent = 0 ); |
398 | virtual ~OWaveLanControlPacket(); | 398 | virtual ~OWaveLanControlPacket(); |
399 | 399 | ||
400 | QString controlType() const; | 400 | QString controlType() const; |
401 | 401 | ||
402 | private: | 402 | private: |
403 | const struct ieee_802_11_control_header* _header; | 403 | const struct ieee_802_11_control_header* _header; |
404 | }; | 404 | }; |
405 | 405 | ||
406 | /*====================================================================================== | 406 | /*====================================================================================== |
407 | * OLLCPacket - IEEE 802.2 Link Level Control | 407 | * OLLCPacket - IEEE 802.2 Link Level Control |
408 | *======================================================================================*/ | 408 | *======================================================================================*/ |
409 | 409 | ||
410 | class OLLCPacket : public QObject | 410 | class OLLCPacket : public QObject |
411 | { | 411 | { |
412 | Q_OBJECT | 412 | Q_OBJECT |
413 | 413 | ||
414 | public: | 414 | public: |
415 | OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 ); | 415 | OLLCPacket( const unsigned char*, const struct ieee_802_11_802_2_header* data, QObject* parent = 0 ); |
416 | virtual ~OLLCPacket(); | 416 | virtual ~OLLCPacket(); |
417 | 417 | ||
418 | private: | 418 | private: |
419 | const struct ieee_802_11_802_2_header* _header; | 419 | const struct ieee_802_11_802_2_header* _header; |
420 | }; | 420 | }; |
421 | 421 | ||
422 | /*====================================================================================== | 422 | /*====================================================================================== |
423 | * OIPPacket | 423 | * OIPPacket |
424 | *======================================================================================*/ | 424 | *======================================================================================*/ |
425 | 425 | ||
426 | class OIPPacket : public QObject | 426 | class OIPPacket : public QObject |
427 | { | 427 | { |
428 | Q_OBJECT | 428 | Q_OBJECT |
429 | 429 | ||
430 | public: | 430 | public: |
431 | OIPPacket( const unsigned char*, const struct iphdr*, QObject* parent = 0 ); | 431 | OIPPacket( const unsigned char*, const struct iphdr*, QObject* parent = 0 ); |
432 | virtual ~OIPPacket(); | 432 | virtual ~OIPPacket(); |
433 | 433 | ||
434 | QHostAddress fromIPAddress() const; | 434 | QHostAddress fromIPAddress() const; |
435 | QHostAddress toIPAddress() const; | 435 | QHostAddress toIPAddress() const; |
436 | 436 | ||
437 | int tos() const; | 437 | int tos() const; |
438 | int len() const; | 438 | int len() const; |
439 | int id() const; | 439 | int id() const; |
440 | int offset() const; | 440 | int offset() const; |
441 | int ttl() const; | 441 | int ttl() const; |
442 | int protocol() const; | 442 | int protocol() const; |
443 | int checksum() const; | 443 | int checksum() const; |
444 | 444 | ||
diff --git a/libopie2/opienet/opienet.pro b/libopie2/opienet/opienet.pro index 2027481..cab6da6 100644 --- a/libopie2/opienet/opienet.pro +++ b/libopie2/opienet/opienet.pro | |||
@@ -1,34 +1,34 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on debug | 2 | CONFIG += qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | HEADERS = 802_11_user.h \ | 4 | HEADERS = 802_11_user.h \ |
5 | dhcp.h \ | 5 | dhcp.h \ |
6 | udp_ports.h \ | 6 | udp_ports.h \ |
7 | wireless.h \ | 7 | wireless.h \ |
8 | odebugmapper.h \ | 8 | odebugmapper.h \ |
9 | omanufacturerdb.h \ | 9 | omanufacturerdb.h \ |
10 | onetutils.h \ | 10 | onetutils.h \ |
11 | onetwork.h \ | 11 | onetwork.h \ |
12 | opcap.h \ | 12 | opcap.h \ |
13 | ostation.h | 13 | ostation.h |
14 | SOURCES = odebugmapper.cpp \ | 14 | SOURCES = odebugmapper.cpp \ |
15 | omanufacturerdb.cpp \ | 15 | omanufacturerdb.cpp \ |
16 | onetutils.cpp \ | 16 | onetutils.cpp \ |
17 | onetwork.cpp \ | 17 | onetwork.cpp \ |
18 | opcap.cpp \ | 18 | opcap.cpp \ |
19 | ostation.cpp | 19 | ostation.cpp |
20 | INTERFACES = | 20 | INTERFACES = |
21 | TARGET = opienet2 | 21 | TARGET = opienet2 |
22 | VERSION = 1.8.2 | 22 | VERSION = 1.8.3 |
23 | INCLUDEPATH += $(OPIEDIR)/include | 23 | INCLUDEPATH += $(OPIEDIR)/include |
24 | DEPENDPATH += $(OPIEDIR)/include | 24 | DEPENDPATH += $(OPIEDIR)/include |
25 | LIBS += -lpcap | 25 | LIBS += -lpcap |
26 | 26 | ||
27 | 27 | ||
28 | !contains( platform, x11 ) { | 28 | !contains( platform, x11 ) { |
29 | include ( $(OPIEDIR)/include.pro ) | 29 | include ( $(OPIEDIR)/include.pro ) |
30 | } | 30 | } |
31 | 31 | ||
32 | contains( platform, x11 ) { | 32 | contains( platform, x11 ) { |
33 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 33 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
34 | } | 34 | } |