#!/usr/bin/env python3
# Copyright (c) 2013 Arista Networks, Inc.  All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.

# This module gathers the ribd dump from Rib agent over stream sockets 
# and is run within the context of a VRF namespace by connecting
# to the Rib agent in that network namespace over port 9997

from __future__ import absolute_import, division, print_function
from AgentShowTech import doShowAgentDump
import RibAgent
import sys

if __name__ == '__main__':
   # Invoked as /usr/bin/RibdShowTech [debug] [ribout] [verbose]
   if len( sys.argv ) > 1:
      verbose = False
      debug = False
      ribout = False
      for arg in sys.argv[ 1 : ]:
         if arg == 'debug':
            debug = True
         elif arg == 'ribout':
            ribout = True
         elif arg == 'verbose':
            verbose = True
      doShowAgentDump( RibAgent.name(), debug=debug, ribout=ribout, verbose=verbose )
   else:
      doShowAgentDump( RibAgent.name() )
