Пример #1
0
static int
_group_add_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
    void * const userdata)
{
    if (userdata != NULL) {
        GroupData *data = userdata;
        handle_group_add(data->name, data->group);
        free(data->name);
        free(data->group);
        free(userdata);
    }
    return 0;
}
Пример #2
0
static void
_handle_group_mod( const uint32_t transaction_id,
        const uint16_t command,
        const uint8_t type,
        const uint32_t group_id,
        const list_element *buckets,
        void *user_data ) {
  UNUSED( user_data );
  switch( command ) {
    case OFPGC_ADD:
      handle_group_add( transaction_id, type, group_id, buckets );
    break;
    case OFPGC_MODIFY:
      handle_group_mod_mod( transaction_id, type, group_id, buckets );
    break;
    case OFPGC_DELETE:
      handle_group_mod_delete( transaction_id, group_id );
    break;
    default:
      send_error_message( transaction_id, OFPET_GROUP_MOD_FAILED, OFPGMFC_BAD_COMMAND );
    break;
  }
}