Пример #1
0
static void s_do_authenticated_port_scan (
    char *s_opt_host, char *s_opt_vhost, char *s_opt_user, char *s_opt_pass)
{
    int
        port;
    icl_longstr_t
        *auth_data;                     //  Authorisation data
    amq_client_connection_t
        *connection;
    icl_shortstr_t
        host;
    int
        brokers_found = 0;

    icl_console_out ("Scanning for all accessible brokers on %s (ports 5000-9999)", s_opt_host);
    auth_data = amq_client_connection_auth_plain (s_opt_user, s_opt_pass);
    for (port = 5000; port < 10000; port++) {
        icl_shortstr_fmt (host, "%s:%d", s_opt_host, port);
        connection = amq_client_connection_new (host, s_opt_vhost, auth_data, "amq_shell", 0, 1000);
        if (connection) {
            icl_console_out ("Found %s/%s on %s",
                connection->server_product, connection->server_version, host);
            brokers_found++;
            amq_client_connection_destroy (&connection);
        }
    }
    icl_longstr_destroy (&auth_data);
    if (!brokers_found)
        icl_console_out ("No accessible AMQP brokers found");
    exit (EXIT_SUCCESS);
}
Пример #2
0
void free_amq_connection_cls( amq_connection_cls *obj) {
  if (obj && obj->connection) {
    amq_client_connection_destroy(&(obj->connection));
    obj->connection=0;
  }
  if (obj)
    free(obj);
}
Пример #3
0
/////////////////////////////////////////////////////////////////////////////
//
// Functions for RWire::Connection
//
/////////////////////////////////////////////////////////////////////////////
static VALUE rwire_connection_destroy(VALUE self)
{
	CONNECTION_GET;
	if (c) {
		amq_client_connection_destroy((amq_client_connection_t**)&(DATA_PTR(self)));
	}
	return self;
}
Пример #4
0
/*
 * AMQ_Connection#destroy -> nil
 *
 */
VALUE con_client_connection_destroy(VALUE self)
{ 
  amq_connection_cls *const connection_obj=get_amq_connection_cls(self,0);
  if (connection_obj && connection_obj->connection) {
    amq_client_connection_destroy(&(connection_obj->connection));
    connection_obj->connection=0;
  }
  return Qnil;
}
Пример #5
0
        inline ~openamq_t ()
        {
            //  Close the channel.
            amq_client_session_destroy (&session);

            //  Close the connection.
            amq_client_connection_destroy (&connection);

            //  Uninitialise system.
            icl_system_terminate ();
        }
Пример #6
0
static void rwire_connection_free(void * p)
{
	amq_client_connection_t * c = (amq_client_connection_t *)p;
	if (c) {
		fprintf(stderr, "AMQ connection not destroyed yet, calling destroy\n");
		amq_client_connection_destroy(&c);
	}
	else {
		fprintf(stderr, "AMQ connection's already destroyed\n");
	}
	free(c);
}