software/drivers/sd8887/src/wlan/mapp/mlanevent/mlanevent.c
/**
 *  @brief Parse and print RSN connect event data
 *
 *  @param buffer   Pointer to received buffer
 *  @param size     Length of the received event data
 *  @return         N/A
 */
@brief Parse and print RSN connect event data
@param buffer   Pointer to received buffer
@param size     Length of the received event data
@return         N/A
@brief Parse and print RSN connect event data @param buffer Pointer to received buffer @param size Length of the received event data @return N / A
void
print_event_rsn_connect(t_u8 *buffer, t_u16 size)
{
	int tlv_buf_left = size;
	t_u16 tlv_type, tlv_len;
	tlvbuf_header *tlv = NULL;
	eventbuf_rsn_connect *event_body = NULL;
	if (size < sizeof(eventbuf_rsn_connect)) {
		printf("ERR:Event buffer too small!\n");
		return;
	}
	event_body = (eventbuf_rsn_connect *)buffer;
	printf("EVENT: RSN_CONNECT\n");
	printf("Station MAC: ");
	print_mac(event_body->sta_mac_address);
	printf("\n");
	tlv_buf_left = size - sizeof(eventbuf_rsn_connect);
	if (tlv_buf_left < (int)sizeof(tlvbuf_header))
		return;
	tlv = (tlvbuf_header *)(buffer + sizeof(eventbuf_rsn_connect));
	while (tlv_buf_left >= (int)sizeof(tlvbuf_header)) {
		tlv_type = uap_le16_to_cpu(tlv->type);
		tlv_len = uap_le16_to_cpu(tlv->len);
		if ((sizeof(tlvbuf_header) + tlv_len) >
		    (unsigned int)tlv_buf_left) {
			printf("wrong tlv: tlvLen=%d, tlvBufLeft=%d\n", tlv_len,
			       tlv_buf_left);
			break;
		}
		switch (tlv_type) {
		case IEEE_WPA_IE:
			printf("WPA IE:\n");
			hexdump((t_u8 *)tlv + sizeof(tlvbuf_header), tlv_len,
				' ');
			break;
		case IEEE_RSN_IE:
			printf("RSN IE:\n");
			hexdump((t_u8 *)tlv + sizeof(tlvbuf_header), tlv_len,
				' ');
			break;
		default:
			printf("unknown tlv: %d\n", tlv_type);
			break;
		}
		tlv_buf_left -= (sizeof(tlvbuf_header) + tlv_len);
		tlv = (tlvbuf_header *)((t_u8 *)tlv + tlv_len +
					sizeof(tlvbuf_header));
	}
	return;
}
void print_event_rsn_connect ( t_u8 * buffer , t_u16 size ) { int tlv_buf_left = size ; t_u16 tlv_type , tlv_len ; tlvbuf_header * tlv = NULL ; eventbuf_rsn_connect * event_body = NULL ; if ( size < sizeof ( eventbuf_rsn_connect ) ) { printf ( " \n " ) ; return ; } event_body = ( eventbuf_rsn_connect * ) buffer ; printf ( " \n " ) ; printf ( " " ) ; print_mac ( event_body -> sta_mac_address ) ; printf ( " \n " ) ; tlv_buf_left = size - sizeof ( eventbuf_rsn_connect ) ; if ( tlv_buf_left < ( int ) sizeof ( tlvbuf_header ) ) return ; tlv = ( tlvbuf_header * ) ( buffer + sizeof ( eventbuf_rsn_connect ) ) ; while ( tlv_buf_left >= ( int ) sizeof ( tlvbuf_header ) ) { tlv_type = uap_le16_to_cpu ( tlv -> type ) ; tlv_len = uap_le16_to_cpu ( tlv -> len ) ; if ( ( sizeof ( tlvbuf_header ) + tlv_len ) > ( unsigned int ) tlv_buf_left ) { printf ( " \n " , tlv_len , tlv_buf_left ) ; break ; } switch ( tlv_type ) { case IEEE_WPA_IE : printf ( " \n " ) ; hexdump ( ( t_u8 * ) tlv + sizeof ( tlvbuf_header ) , tlv_len , ' ' ) ; break ; case IEEE_RSN_IE : printf ( " \n " ) ; hexdump ( ( t_u8 * ) tlv + sizeof ( tlvbuf_header ) , tlv_len , ' ' ) ; break ; default : printf ( " \n " , tlv_type ) ; break ; } tlv_buf_left -= ( sizeof ( tlvbuf_header ) + tlv_len ) ; tlv = ( tlvbuf_header * ) ( ( t_u8 * ) tlv + tlv_len + sizeof ( tlvbuf_header ) ) ; } return ; }
@brief Parse and print RSN connect event data
  @param buffer   Pointer to received buffer
  @param size     Length of the received event data
  @return         N/A
@brief Parse and print RSN connect event data @param buffer Pointer to received buffer @param size Length of the received event data @return N / A