/*
 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "1.0.0";

 /** \brief cop: enable/disable junk filtration features on an interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_inded - desired interface
    @param enable_disable - 1 => enable, 0 => disable
*/

autoreply define cop_interface_enable_disable
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 enable_disable;
};

/** \brief cop: enable/disable whitelist filtration features on an interface
    Note: the supplied fib_id must match in order to remove the feature!
    
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface handle, physical interfaces only
    @param fib_id - fib identifier for the whitelist / blacklist fib
    @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
    @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
    @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
*/

autoreply define cop_whitelist_enable_disable
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u32 fib_id;
  u8 ip4;
  u8 ip6;
  u8 default_cop;
};

/** \brief get_node_graph - get a copy of the vpp node graph
    including the current set of graph arcs.

    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/

 /*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
 
