объясни что здесь происходит
private class BgpConfigMapper(context: YmmContext)
  extends IcpBaseMapper(context) {

  // Other indexes.
  private[this] val BgpNmListenIpv4Index = 1
  private[this] val BgpNmListenIpv6Index = 2
  private[this] val BgpRmIpv4FlapConfigIndex = 1
  private[this] val BgpRmIpv6FlapConfigIndex = 2
  private[this] val BgpRmL2vpnFlapConfigIndex = 3
  private[this] val BgpRmVpnv4FlapConfigIndex = 4
  private[this] val BgpRmVpnv6FlapConfigIndex = 5
  private[this] val BgpRmMvpnv4FlapConfigIndex = 6
private[this] val BgpRmMvpnv6FlapConfigIndex = 7

  object reflectorClientType extends Enumeration {
    type reflectorClientType          = Value
    val reflectorClientClient         = Value
    val reflectorClientNonClient      = Value
    val reflectorClientMeshedClient   = Value
  }
...
  // List for converting Peer high level fields to bgpPeerConfigUsage(2|3)
  // information.
 private[this] val bgpPeerCfgUsageList =
    immutable.List(
      (None, "advertisement-interval",      0x00000020L, "CU1"),   // AMB_BGP_PEER_CU_MIN_RTE_ADV_INT
      (None, "withdraw-interval",           0x00000040L, "CU1"),   // AMB_BGP_PEER_CU_MIN_RTE_WTH_INT
      (Some("ebgp-multihop"), "ttl",        0x00000010L, "CU1"),   // AMB_BGP_PEER_CU_TTL
...
  // List for converting Peer Afi-Safi high level fields to bgpPeerConfigUsage(2|3)
  // information.
 private[this] val bgpPeerASCfgUsageList =
    immutable.List(
      (None, "allowas-in",                      0x00008000L, "CU1"),   // AMB_BGP_PEER_CU_ALLOW_LOCAL_AS
      (None, "next-hop-self",                   0x00200000L, "CU1"),   // AMB_BGP_PEER_CU_NXT_HOP_SLF
      (Some("soft-reconfiguration"), "inbound", 0x00004000L, "CU1"),   // AMB_BGP_PEER_CU_SOFT_RESET
...
 /**
    * Case class to wrap the configuration information that is used repeatedly
    * when mapping BGP configuration.
    */
  private case class BgpHlConfigInfoHolder(
      routeMapRoot: DataNodeSeq,
      commListRoot: DataNodeSeq,
      extCommListRoot: DataNodeSeq,
      asPathListRoot: DataNodeSeq,
...
  /**
    * Case class to wrap AFI/SAFI information.
    */
  private case class BgpHlAfiSafiInfo(
      afi: String,
      safi: String,
      afiSafiConfig: DataNodeSeq,
      dampening: Option[DataObject])
...
/**
    * Returns the set of interfaces for which BGP configuration requires
    * interface index values.
    *
    * @param bgpConfig             BGP high level configuration root for a VRF
    *                              or the global VRF (option).
    * @return                      The set of interfaces for which interface
    *                              index values are required.
    * @throws DataException
    */
 protected[model] def reqInterfaces(bgpConfig: Option[DataObject]):
      ReqIfInfoSet = {
    bgpConfig match {
      case Some(bgpConfigObject) =>
        val bgpNeighbors = (bgpConfigObject \ "neighbor-interface").toObjectSeq
        (for {
          bgpNeighbor <- bgpNeighbors
          bgpNeighborInterface = bgpNeighbor.getString("interface")
        } yield IfName(bgpNeighborInterface, "")).toSet

      case None => EmptyReqIfInfoSet
    }
  }
 /**
    * Maps high level BGP configuration to low level BGP configuration.
    *
    * @param bgpRoot               BGP high level configuration root (option).
    * @param routeMapRoot          Route map high level configuration root
    *                              sequence.
    * @param commListRoot          Community List high level configuration root
    *                              sequence.
    * @param extCommListRoot       Extended Community List high level
    *                              
...
   * @return                      The low level configuration.
    * @throws DataException
    * @throws MapperException
    */
  protected[model] def mapConfig(bgpRoot: Option[DataObject],
                              routeMapRoot: DataNodeSeq,
                              commListRoot: DataNodeSeq,
                              extCommListRoot: DataNodeSeq,
                              asPathListRoot: DataNodeSeq,
...
  bgpRoot match {

      case Some(bgpRootObject: DataObject) =>

        val bgpLocalAs = bgpRootObject.getString("as-num").toLong
        val bgpConfedId = bgpRootObject.getOptString("confederation-identifier").getOrElse("0").toLong
        val bgpGlobalConfig = (bgpRootObject \ "global").toOptObject
        val bgpExtraConfigInfo =
          BgpHlConfigInfoHolder(
            routeMapRoot,
            commListRoot,
...
  HlSavedCfg.bgpProcessMapOld = HlSavedCfg.bgpProcessMap
        HlSavedCfg.bgpProcessMap    = Map()
        HlSavedCfg.bgpMapRM = mutable.Map()
  val bgpRmEntEntries = mutable.Buffer.empty[DataObject]
        val bgpNmEntEntries = mutable.Buffer.empty[DataObject]
...
/**
    * Returns the RM entity configuration for a single instance of BGP.
    *
    * @param bgpConfigObject           The high level BGP configuration.
    * @param bgpConfigInfo             Additional BGP information to use.
    * @param vrfName                   The VRF name.
    * @param bgpGlobalObject           The high level global BGP configuration.
    * @return                          The low-level configuration data
    *                                  object.
    * @throws DataException
 * @throws MapperException
    */
  private[this] def bgpRmLlConfig(bgpConfigObject: DataObject,
                                  bgpConfigInfo: BgpHlConfigInfoHolder,
                                  vrfName: String,
                                  bgpGlobalObject: DataObject,
                                  l3vpnVrfs: immutable.Seq[DataObject]): DataObject =
  {
    // Useful local variables
    val globalInstance = (vrfName == GlobalVrfName)
    val entityIndex =llControllerEntityIndex(bgpConfigInfo.bgpEntityIndexAllocator, vrfName)

    // bgp:rib-manager local variables
    val bgpBgp = bgpConfigObject \ "bgp"
    val bgpBgpOpt = bgpBgp.toOptObject

    // bgp:rib-afi-safi local variables
    val bgpAddrFam = bgpConfigObject \ "address-family"
    val supportedAfiSafis =
...
 /**
    * Returns all RM AFI/SAFI configuration for a single BGP instance.
    * @param bgpConfigObject        The high level BGP configuration.
    * @param bgpRmEntityIndex       Entity index of BGP RM.
    * @param bgpConfigInfo          Additional BGP information to use.
    * @param vrfName                The VRF name.
    * @return                       The low-level configuration object.
    */
  private[this] def bgpRmAfmJoins(bgpConfigObject: DataObject,
                                  bgpRmEnti
...
 /**
    * Returns the RM product entity configuration for a single BGP instance.
    *
    * @param bgpConfigObject       The high level BGP configuration.
    * @param bgpEntityRoot         BGP entity high level configuration root
    *                              sequence.
    * @param bgpConfigInfo         Additional BGP information to use.
    * @param vrfName               The VRF name.
    * @return                      The low-level configuration object.
    */
  private[this] def bgpRmLlEntConfig(
...
 DataObject(
      "index" -> entityIndex,
      "i3-entity-index" -> I3EntityIndex,
      "route-flap-reuse-max" -> 255 * 60,
      "orf-supported" -> DataBoolean.True,
      "cisco-prefix-supported" -> DataBoolean.True,
      "as-size" -> "four-octet",
      "local-identifier" -> useRouterId,