Class: OSPFv2::NeighborState::State

Inherits:
Object
  • Object
show all
Defined in:
lib/neighbor_sm/neighbor_state.rb

Direct Known Subclasses

Attempt, Down, ExStart, Exchange, Full, Init, Loading

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



69
70
71
72
73
74
75
# File 'lib/neighbor_sm/neighbor_state.rb', line 69

def method_missing(method, *args, &block)
  if method.to_s =~ /^recv_(.+)$/
    args[0].__send__ debug,  "*** ignoring packet #{$1} : received  while in #{self} ***"
  else
    raise
  end
end

Instance Method Details

#adj_ok?Boolean

Returns:

  • (Boolean)


58
59
# File 'lib/neighbor_sm/neighbor_state.rb', line 58

def adj_ok?
end

#bad_ls_req(neighbor) ⇒ Object



62
63
# File 'lib/neighbor_sm/neighbor_state.rb', line 62

def bad_ls_req(neighbor)
end

#change_state(neighbor, *args) ⇒ Object Also known as: new_state



28
29
30
# File 'lib/neighbor_sm/neighbor_state.rb', line 28

def change_state(neighbor, *args)
  neighbor.change_state(*args)
end

#inactivity_timer(neighbor) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
# File 'lib/neighbor_sm/neighbor_state.rb', line 38

def inactivity_timer(neighbor)
  
  neighbor.instance_eval {
    @ls_db.reset if @ls_db
    @ls_req_list={}
    @periodic_refresh.cancel
    @periodic_rxmt.cancel
  }
  
  new_state neighbor, Down.new, 'Inactivity Timer'
end

#kill_nbr(neighbor) ⇒ Object Also known as: ll_down



33
34
35
# File 'lib/neighbor_sm/neighbor_state.rb', line 33

def kill_nbr(neighbor)
  new_state neighbor, Down.new, 'll_down or kill_nbr'
end

#one_way_received(neighbor) ⇒ Object



64
65
# File 'lib/neighbor_sm/neighbor_state.rb', line 64

def one_way_received(neighbor)
end

#recv_hello(neighbor, rcv_hello, *args) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/neighbor_sm/neighbor_state.rb', line 50

def recv_hello(neighbor, rcv_hello, *args)
  neighbor.instance_eval {
    hello.add_router_id rcv_hello
    hello.designated_router_id = rcv_hello.designated_router_id.to_ip
    inactivity_timer.start { new_state Down.new, 'Inactivity Timer' }
  }
end

#seq_number_mismatch(neighbor) ⇒ Object



60
61
# File 'lib/neighbor_sm/neighbor_state.rb', line 60

def seq_number_mismatch(neighbor)
end

#two_way_received(neighbor) ⇒ Object



66
67
# File 'lib/neighbor_sm/neighbor_state.rb', line 66

def two_way_received(neighbor)
end