<commit_before>/*
 * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
 */

#ifndef vnsw_agent_vrf_hpp
#define vnsw_agent_vrf_hpp

#include <boost/scoped_ptr.hpp>
#include <db/db_table_walker.h>
#include <sandesh/sandesh_types.h>
#include <sandesh/sandesh.h>
#include <cmn/agent_cmn.h>
#include <cmn/index_vector.h>
#include <ksync/ksync_index.h>
#include <oper/peer.h>
#include <oper/agent_types.h>

using namespace std;
class LifetimeActor;
class LifetimeManager;
class ComponentNHData;

struct VrfKey : public AgentKey {
    VrfKey(const string &name) : AgentKey(), name_(name) { };
    virtual ~VrfKey() { };

    void Init(const string &vrf_name) {name_ = vrf_name;};
    bool Compare(const VrfKey &rhs) const {
        return name_ == rhs.name_;
    }

    string name_;
};

struct VrfData : public AgentData {
    VrfData() : AgentData() { };
    virtual ~VrfData() { }
};

class VrfEntry : AgentRefCount<VrfEntry>, public AgentDBEntry {
public:
    class VrfNHMap;
    static const uint32_t kInvalidIndex = 0xFFFFFFFF;
    static const uint32_t kDeleteTimeout = 300 * 1000;
    VrfEntry(const string &name);
    virtual ~VrfEntry();

    virtual bool IsLess(const DBEntry &rhs) const;
    virtual KeyPtr GetDBRequestKey() const;
    virtual void SetKey(const DBRequestKey *key);
    virtual string ToString() const;

    const uint32_t vrf_id() const {return id_;};
    const string &GetName() const {return name_;};

    uint32_t GetRefCount() const {
        return AgentRefCount<VrfEntry>::GetRefCount();
    }

    bool DBEntrySandesh(Sandesh *sresp, std::string &name) const;
    Inet4UnicastRouteEntry *GetUcRoute(const Ip4Address &addr) const;
    Inet4UnicastRouteEntry *GetUcRoute(const Inet4UnicastRouteEntry &rt_key) const;<commit_msg>* Increase vrf delete timeout to 15 minutes<commit_after>/*
 * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
 */

#ifndef vnsw_agent_vrf_hpp
#define vnsw_agent_vrf_hpp

#include <boost/scoped_ptr.hpp>
#include <db/db_table_walker.h>
#include <sandesh/sandesh_types.h>
#include <sandesh/sandesh.h>
#include <cmn/agent_cmn.h>
#include <cmn/index_vector.h>
#include <ksync/ksync_index.h>
#include <oper/peer.h>
#include <oper/agent_types.h>

using namespace std;
class LifetimeActor;
class LifetimeManager;
class ComponentNHData;

struct VrfKey : public AgentKey {
    VrfKey(const string &name) : AgentKey(), name_(name) { };
    virtual ~VrfKey() { };

    void Init(const string &vrf_name) {name_ = vrf_name;};
    bool Compare(const VrfKey &rhs) const {
        return name_ == rhs.name_;
    }

    string name_;
};

struct VrfData : public AgentData {
    VrfData() : AgentData() { };
    virtual ~VrfData() { }
};

class VrfEntry : AgentRefCount<VrfEntry>, public AgentDBEntry {
public:
    class VrfNHMap;
    static const uint32_t kInvalidIndex = 0xFFFFFFFF;
    static const uint32_t kDeleteTimeout = 900 * 1000;
    VrfEntry(const string &name);
    virtual ~VrfEntry();

    virtual bool IsLess(const DBEntry &rhs) const;
    virtual KeyPtr GetDBRequestKey() const;
    virtual void SetKey(const DBRequestKey *key);
    virtual string ToString() const;

    const uint32_t vrf_id() const {return id_;};
    const string &GetName() const {return name_;};

    uint32_t GetRefCount() const {
        return AgentRefCount<VrfEntry>::GetRefCount();
    }

    bool DBEntrySandesh(Sandesh *sresp, std::string &name) const;
    Inet4UnicastRouteEntry *GetUcRoute(const Ip4Address &addr) const;
    Inet4UnicastRouteEntry *GetUcRoute(const Inet4UnicastRouteEntry &rt_key) const;
{'fraction_non_alphanumeric': 0.11083052749719416, 'fraction_numerical': 0.014029180695847363, 'mean_word_length': 4.352852852852853, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2328714', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1219, 'n_words': 310}