view plugins/crazychat/cc_network.h @ 13664:4132d997ccec

[gaim-migrate @ 16066] Fix Coverity CID 45: Check to make sure a channel 2 ICBM actually contains an IP address TLV before attempting to use it. This avoids a crash when the server sends us an abnormal channel 2 ICBM. I'm not sure if that ever happens. Fix Coverity CID 204: Don't attempt to send data over a FLAP BOS connection that doesn't exist. This should never happen because the account should get disconnected first. Fix Coverity CID 205: Don't check that a variable 'od' which we know is valid is not equal to NULL in aim_search_address() in family_userlookup.c Fix Coverity CID 206: Don't check that the variable 'od' which we know is valid is not equal to NULL in aim_chat_join() in family_oservice.c Fix Coverity CID 207: I neglected to remove a "return;" line from aim_admin_setnick() in family_admin.c which caused setting your AIM screen name formatting to not work. Fix Coverity CID 208: Remove a duplicate call to gaim_connection_get_account() in peer_connection_propose() in peer.c. Fix Coverity CID 209: Remove the unused variable "username" from incomingim_chan2() in oscar.c. Fix Coverity CID 210: Remove the unused variable "account" from peer_connection_listen_cb() in peer.c. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 20 Apr 2006 04:45:06 +0000
parents 8bcd4d4ccef6
children
line wrap: on
line source

#ifndef __CC_NETWORK_H__
#define __CC_NETWORK_H__

#include "account.h"
#include "conversation.h"
#include "crazychat.h"

/* --- begin constant definition --- */

#define DEFAULT_CC_PORT		6543

#define CRAZYCHAT_INVITE_CODE	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \
				"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \
				"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \
				"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \
				"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" \
				"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
#define CRAZYCHAT_ACCEPT_CODE	"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" \
				"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" \
				"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" \
				"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" \
				"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" \
				"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
#define CRAZYCHAT_READY_CODE	"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" \
				"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" \
				"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" \
				"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" \
				"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" \
				"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"

/* --- begin function declarations --- */

/**
 * Creates a new CrazyChat session if one doesn't exist and sends the invite.
 * @param cc		global crazychat data structure
 * @param name		the peer name
 * @param account	the gaim account
 */
void cc_net_send_invite(struct crazychat *cc, char *name, GaimAccount *account);

/**
 * Pops up the CrazyChat invitation accept window if a CrazyChat session does
 * not exist yet for this peer.
 * @param account	gaim account
 * @param cc		global crazychat data structure
 * @param name		the peer name
 * @param peer_ip	the peer's ip address
 * @param peer_port	the peer's tcp port
 */
void cc_net_recv_invite(GaimAccount *account, struct crazychat *cc, char *name,
		const char *peer_ip, const char *peer_port);

/**
 * Accepts the CrazyChat invitation and sends the response.
 * @param session	the CrazyChat session
 */
void cc_net_send_accept(struct cc_session *session);

/**
 * Receives a CrazyChat accept message, and if appropriate, creates a server
 * socket and sends the ready message.
 * @param account	the gaim account which received the message
 * @param cc		global crazychat data structure
 * @param name		the peer name
 * @param peer_ip	the peer's ip address
 */
void cc_net_recv_accept(GaimAccount *account, struct crazychat *cc, char *name,
		const char *peer_ip);

/**
 * Receives a CrazyChat ready message, and if appropriate, connects to peer
 * @param account	the gaim account which received the message
 * @param cc		global crazychat data structure
 * @param name		the peer name
 */
void cc_net_recv_ready(GaimAccount *account, struct crazychat *cc, char *name);

#endif