Class: Capp::Packet::TCPHeader

Inherits:
Struct
  • Object
show all
Defined in:
lib/capp/packet.rb

Overview

TCP header. See RFC 793

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ack_numberObject

Returns the value of attribute ack_number

Returns:

  • (Object)

    the current value of ack_number



62
63
64
# File 'lib/capp/packet.rb', line 62

def ack_number
  @ack_number
end

#checksumObject

Returns the value of attribute checksum

Returns:

  • (Object)

    the current value of checksum



62
63
64
# File 'lib/capp/packet.rb', line 62

def checksum
  @checksum
end

#destination_portObject Also known as: destination

Returns the value of attribute destination_port

Returns:

  • (Object)

    the current value of destination_port



62
63
64
# File 'lib/capp/packet.rb', line 62

def destination_port
  @destination_port
end

#flagsObject

Returns the value of attribute flags

Returns:

  • (Object)

    the current value of flags



62
63
64
# File 'lib/capp/packet.rb', line 62

def flags
  @flags
end

#offsetObject

Returns the value of attribute offset

Returns:

  • (Object)

    the current value of offset



62
63
64
# File 'lib/capp/packet.rb', line 62

def offset
  @offset
end

#seq_numberObject

Returns the value of attribute seq_number

Returns:

  • (Object)

    the current value of seq_number



62
63
64
# File 'lib/capp/packet.rb', line 62

def seq_number
  @seq_number
end

#source_portObject Also known as: source

Returns the value of attribute source_port

Returns:

  • (Object)

    the current value of source_port



62
63
64
# File 'lib/capp/packet.rb', line 62

def source_port
  @source_port
end

#urgentObject

Returns the value of attribute urgent

Returns:

  • (Object)

    the current value of urgent



62
63
64
# File 'lib/capp/packet.rb', line 62

def urgent
  @urgent
end

#windowObject

Returns the value of attribute window

Returns:

  • (Object)

    the current value of window



62
63
64
# File 'lib/capp/packet.rb', line 62

def window
  @window
end

Instance Method Details

#ack?Boolean

Is the acknowledgment flag set?

Returns:

  • (Boolean)


72
73
74
# File 'lib/capp/packet.rb', line 72

def ack?
  Capp::TCP_ACK == flags & Capp::TCP_ACK
end

#cwr?Boolean

Is the congestion window reduced flag set?

Returns:

  • (Boolean)


79
80
81
# File 'lib/capp/packet.rb', line 79

def cwr?
  Capp::TCP_CWR == flags & Capp::TCP_CWR
end

#ece?Boolean

Is the explicit congestion notification echo flag set?

Returns:

  • (Boolean)


86
87
88
# File 'lib/capp/packet.rb', line 86

def ece?
  Capp::TCP_ECE == flags & Capp::TCP_ECE
end

#fin?Boolean

Is the no-more-data flag set?

Returns:

  • (Boolean)


93
94
95
# File 'lib/capp/packet.rb', line 93

def fin?
  Capp::TCP_FIN == flags & Capp::TCP_FIN
end

#push?Boolean

Is the push flag set?

Returns:

  • (Boolean)


100
101
102
# File 'lib/capp/packet.rb', line 100

def push?
  Capp::TCP_PUSH == flags & Capp::TCP_PUSH
end

#rst?Boolean

Is the reset flag set?

Returns:

  • (Boolean)


107
108
109
# File 'lib/capp/packet.rb', line 107

def rst?
  Capp::TCP_RST == flags & Capp::TCP_RST
end

#syn?Boolean

Is the synchronize flag set?

Returns:

  • (Boolean)


114
115
116
# File 'lib/capp/packet.rb', line 114

def syn?
  Capp::TCP_SYN == flags & Capp::TCP_SYN
end

#urg?Boolean

Is the urgent flag set?

Returns:

  • (Boolean)


121
122
123
# File 'lib/capp/packet.rb', line 121

def urg?
  Capp::TCP_URG == flags & Capp::TCP_URG
end