Sha256: 07c4706dda486b9bd100e5733e58b76bed0997e94bbb601fa6f5532bebc69f47

Contents?: true

Size: 1.29 KB

Versions: 20

Compression:

Stored size: 1.29 KB

Contents

/*
 * Copyright (C) 2008-2013 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 "trema.h"
#include "ruby.h"


void
handle_list_switches_reply( const list_element *switches, void *controller ) {
  if ( rb_respond_to( ( VALUE ) controller, rb_intern( "list_switches_reply" ) ) == Qfalse ) {
   return;
  }
  VALUE dpids = rb_ary_new();

  const list_element *element = NULL;
  for ( element = switches; element != NULL; element = element->next ) {
    rb_ary_push( dpids, ULL2NUM( *( uint64_t * ) element->data ) );
  }

  rb_funcall( ( VALUE ) controller, rb_intern( "list_switches_reply" ), 1, dpids );
}


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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
trema-0.4.7 ruby/trema/list-switches-reply.c
trema-0.4.6 ruby/trema/list-switches-reply.c
trema-0.4.5 ruby/trema/list-switches-reply.c
trema-0.4.4 ruby/trema/list-switches-reply.c
trema-0.4.3 ruby/trema/list-switches-reply.c
trema-0.4.2 ruby/trema/list-switches-reply.c
trema-0.4.1 ruby/trema/list-switches-reply.c
trema-0.4.0 ruby/trema/list-switches-reply.c
trema-0.3.21 ruby/trema/list-switches-reply.c
trema-0.3.20 ruby/trema/list-switches-reply.c
trema-0.3.19 ruby/trema/list-switches-reply.c
trema-0.3.18 ruby/trema/list-switches-reply.c
trema-0.3.17 ruby/trema/list-switches-reply.c
trema-0.3.16 ruby/trema/list-switches-reply.c
trema-0.3.15 ruby/trema/list-switches-reply.c
trema-0.3.14 ruby/trema/list-switches-reply.c
trema-0.3.13 ruby/trema/list-switches-reply.c
trema-0.3.12 ruby/trema/list-switches-reply.c
trema-0.3.11 ruby/trema/list-switches-reply.c
trema-0.3.10 ruby/trema/list-switches-reply.c