-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds the basic Header for all SMB1 packets MSP-12907
- Loading branch information
David Maloney
authored and
David Maloney
committed
Jul 29, 2015
1 parent
7800be4
commit bf6301d
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module RubySMB | ||
module Smb1 | ||
module Packet | ||
|
||
# This class represents the Header of an SMB1 Packet. | ||
# [2.2.3.1 SMB Header Extensions](https://msdn.microsoft.com/en-us/library/cc246254.aspx) | ||
class SmbHeader < BitStruct | ||
unsigned :protocol, 32 | ||
unsigned :command, 8 | ||
unsigned :nt_status, 32 | ||
unsigned :flags, 8 | ||
unsigned :flags2, 16 | ||
unsigned :pid_high, 16 | ||
unsigned :security_features, 64 | ||
unsigned :reserved, 16 | ||
unsigned :tid, 16 | ||
unsigned :pid_low, 16 | ||
unsigned :uid, 16 | ||
unsigned :mid, 16 | ||
|
||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe RubySMB::Smb1::Packet::SmbHeader do | ||
|
||
subject(:header) { described_class.new } | ||
|
||
it { is_expected.to respond_to :protocol } | ||
it { is_expected.to respond_to :command } | ||
it { is_expected.to respond_to :nt_status } | ||
it { is_expected.to respond_to :flags } | ||
it { is_expected.to respond_to :flags2 } | ||
it { is_expected.to respond_to :pid_high } | ||
it { is_expected.to respond_to :security_features } | ||
it { is_expected.to respond_to :reserved } | ||
it { is_expected.to respond_to :tid } | ||
it { is_expected.to respond_to :pid_low } | ||
it { is_expected.to respond_to :uid } | ||
it { is_expected.to respond_to :mid } | ||
end |