Skip to content

Commit

Permalink
edit message format
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Xiao <[email protected]>
  • Loading branch information
xiaopeng163 committed Oct 21, 2016
1 parent e007316 commit 1798d20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yabmp/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ def write_msg_file(self, msg_type, msg):
self.bgp_peer_dict[peer_ip]['file'].write(str(msg_list) + '\n')
self.bgp_peer_dict[peer_ip]['msg_seq'] += 1
self.bgp_peer_dict[peer_ip]['file'].flush()
self.channel.send_message(exchange='', message={'type': 2, 'peer_ip': peer_ip})
self.channel.send_message(exchange='', message={'type': 7, 'mst_type': 2, 'peer_ip': peer_ip})

elif msg_type == 3: # peer up message
msg_list = [time.time(), self.bgp_peer_dict[peer_ip]['msg_seq'], 1, msg[1]['received_open_msg'], (0, 0)]
self.bgp_peer_dict[peer_ip]['file'].write(str(msg_list) + '\n')
self.bgp_peer_dict[peer_ip]['msg_seq'] += 1
self.bgp_peer_dict[peer_ip]['file'].flush()
self.channel.send_message()
self.channel.send_message(exchange='', message={'type': 3, 'peer_ip': peer_ip})
self.channel.send_message(exchange='', message={'type': 7, 'msg_type': 3, 'peer_ip': peer_ip})

@staticmethod
def get_last_seq(file_name):
Expand Down

0 comments on commit 1798d20

Please sign in to comment.