Sha256: c95494ab43e7bada4ef983585ebef6e13e76d0e352fe1fbbb6f9ecf72b56ea80

Contents?: true

Size: 1.65 KB

Versions: 23

Compression:

Stored size: 1.65 KB

Contents

/*
 * Author: Yasunobu Chiba
 *
 * Copyright (C) 2008-2012 NEC Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */


#include <stdio.h>
#include <string.h>
#include "trema.h"
#include "utils.h"


static void
delete_filter( void ) {
  struct ofp_match match;
  memset( &match, 0, sizeof( struct ofp_match ) );
  match.wildcards = OFPFW_ALL;

  static handler_data data;
  data.match = match;
  snprintf( data.service_name, sizeof( data.service_name ), "dumper" );
  data.service_name[ sizeof( data.service_name ) - 1 ] = '\0';
  data.strict = false;

  bool ret = delete_packetin_filter( data.match, UINT16_MAX, data.service_name, data.strict,
                                     delete_filter_completed, &data );
  if ( ret == false ) {
    error( "Failed to delete a packetin filter ( ret = %d ).", ret );
  }
  else {
    add_periodic_event_callback( 5, timeout, &data );
  }
}


int
main( int argc, char *argv[] ) {
  init_trema( &argc, &argv );

  delete_filter();

  start_trema();
}


/*
 * Local variables:
 * c-basic-offset: 2
 * indent-tabs-mode: nil
 * End:
 */

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trema-0.3.9 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.8 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.7 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.6 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.5 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.4 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.3 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.2 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.1 src/examples/packetin_filter_config/delete_filter.c
trema-0.3.0 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.8 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.7 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.6 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.5 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.4 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.3 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.2.1 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.2 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.1 src/examples/packetin_filter_config/delete_filter.c
trema-0.2.0 src/examples/packetin_filter_config/delete_filter.c