# HG changeset patch # User Elliott Sales de Andrade # Date 1304997500 0 # Node ID f5fbcdd07d48b35050b2d3048d2aa71e41281d85 # Parent 1e657ff2eacb2b9709799c101fdcac335dbf630c Rename this enums a little better. And I don't think we need these length enums, really. diff -r 1e657ff2eacb -r f5fbcdd07d48 libpurple/protocols/msn/p2p.c --- a/libpurple/protocols/msn/p2p.c Tue May 10 03:09:47 2011 +0000 +++ b/libpurple/protocols/msn/p2p.c Tue May 10 03:18:20 2011 +0000 @@ -392,7 +392,7 @@ break; case MSN_P2P_VERSION_TWO: - final = msn_tlv_gettlv(info->header.v2.data_tlv, 0x01, 1) == NULL; + final = msn_tlv_gettlv(info->header.v2.data_tlv, P2P_DATA_TLV_REMAINING, 1) == NULL; break; default: @@ -422,16 +422,16 @@ MsnP2Pv2Header *old = &old_info->header.v2; MsnP2Pv2Header *new = &new_info->header.v2; - msn_tlvlist_add_32(&new->header_tlv, P2P_TLV_TYPE_ACK, old->base_id + old->message_len); + msn_tlvlist_add_32(&new->header_tlv, P2P_HEADER_TLV_TYPE_ACK, old->base_id + old->message_len); new->opcode = P2P_OPCODE_NONE; if (old->message_len > 0) { - if (!msn_tlv_gettlv(old->header_tlv, P2P_TLV_TYPE_ACK, 1)) { + if (!msn_tlv_gettlv(old->header_tlv, P2P_HEADER_TLV_TYPE_ACK, 1)) { if (old->opcode & P2P_OPCODE_SYN) { msn_tlv_t *ack_tlv; new->opcode |= P2P_OPCODE_RAK; - ack_tlv = msn_tlv_gettlv(old->header_tlv, P2P_TLV_TYPE_PEER_INFO, 1); + ack_tlv = msn_tlv_gettlv(old->header_tlv, P2P_HEADER_TLV_TYPE_PEER_INFO, 1); if (ack_tlv) { msn_tlvlist_add_tlv(&new->header_tlv, ack_tlv); new->opcode |= P2P_OPCODE_SYN; @@ -484,7 +484,7 @@ } case MSN_P2P_VERSION_TWO: - ret = msn_tlv_gettlv(info->header.v2.header_tlv, P2P_TLV_TYPE_ACK, 1) != NULL; + ret = msn_tlv_gettlv(info->header.v2.header_tlv, P2P_HEADER_TLV_TYPE_ACK, 1) != NULL; break; default: diff -r 1e657ff2eacb -r f5fbcdd07d48 libpurple/protocols/msn/p2p.h --- a/libpurple/protocols/msn/p2p.h Tue May 10 03:09:47 2011 +0000 +++ b/libpurple/protocols/msn/p2p.h Tue May 10 03:18:20 2011 +0000 @@ -76,17 +76,15 @@ typedef enum { - P2P_TLV_TYPE_PEER_INFO = 0x01, /**< Client peer info */ - P2P_TLV_TYPE_ACK = 0x02, /**< ACK */ - P2P_TLV_TYPE_NAK = 0x03 /**< NAK */ -} P2PTLVType; + P2P_HEADER_TLV_TYPE_PEER_INFO = 0x01, /**< Client peer info */ + P2P_HEADER_TLV_TYPE_ACK = 0x02, /**< ACK */ + P2P_HEADER_TLV_TYPE_NAK = 0x03 /**< NAK */ +} P2PHeaderTLVType; typedef enum { - P2P_TLV_LEN_PEER_INFO = 12, - P2P_TLV_LEN_ACK = 4, - P2P_TLV_LEN_NAK = 4 -} P2PTLVLength; + P2P_DATA_TLV_REMAINING = 0x01, /**< Indicates the remaining data to transfer.*/ +} P2PDataTLVType; typedef enum { @@ -97,9 +95,6 @@ P2P_PI_CAPS = 0x0000010f } P2PPeerInfoVal; -#define DLP_REMAINING 0x01; /**< Indicates the remaining data to transfer.*/ -#define DLP_REMAINING_LEN 8 - typedef struct { guint32 value;