Browse Source

protobug generation optional

Philippe G 3 years ago
parent
commit
d81e95c94a

+ 18 - 10
components/spotify/cspot/CMakeLists.txt

@@ -24,17 +24,25 @@ if(UNIX AND NOT APPLE)
     list(APPEND EXTRA_LIBS dns_sd)
     # TODO: migrate from this to native linux mDNS
 endif()
-set(NANOPB_OPTIONS "-I${CMAKE_CURRENT_SOURCE_DIR}")
-set(PROTOS protobuf/authentication.proto protobuf/mercury.proto protobuf/keyexchange.proto protobuf/spirc.proto protobuf/metadata.proto)
-message(${PROTOS})
-message("building protobuf")
-message(${CMAKE_CURRENT_SOURCE_DIR})
-nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH ${CMAKE_CURRENT_SOURCE_DIR} ${PROTOS})
-add_custom_target(generate_proto_sources DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
-set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS}
-    PROPERTIES GENERATED TRUE)
+
+if (GENERATE_PROTOS)
+	file(GLOB SOURCES "src/*.cpp" "src/*.c")
+	set(NANOPB_OPTIONS "-I${CMAKE_CURRENT_SOURCE_DIR}")
+	set(PROTOS protobuf/authentication.proto protobuf/mercury.proto protobuf/keyexchange.proto protobuf/spirc.proto protobuf/metadata.proto)
+	message(${PROTOS})
+	message("building protobuf")
+	message(${CMAKE_CURRENT_SOURCE_DIR})
+	nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH ${CMAKE_CURRENT_SOURCE_DIR} ${PROTOS})
+	add_custom_target(generate_proto_sources DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
+	set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE)
+	set(GENERATED_INCLUDES ${CMAKE_CURRENT_BINARY_DIR})
+else()
+	file(GLOB SOURCES "src/*.cpp" "src/*.c" "protobuf/*.c")
+	message("BEWARE => NOT GENERATING PROTOBUF")
+	set(GENERATED_INCLUDES ".")
+endif()
 
 add_library(cspot STATIC ${SOURCES} ${PROTO_SRCS})
 # PUBLIC to propagate includes from bell to cspot dependents
 target_link_libraries(cspot PUBLIC ${EXTRA_LIBS})
-target_include_directories(cspot PUBLIC "include" ${CMAKE_CURRENT_BINARY_DIR} ${NANOPB_INCLUDE_DIRS})
+target_include_directories(cspot PUBLIC "include" ${GENERATED_INCLUDES} ${NANOPB_INCLUDE_DIRS})

+ 21 - 0
components/spotify/cspot/protobuf/authentication.pb.c

@@ -0,0 +1,21 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.4.6-dev */
+
+#include "protobuf/authentication.pb.h"
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+PB_BIND(SystemInfo, SystemInfo, 2)
+
+
+PB_BIND(LoginCredentials, LoginCredentials, AUTO)
+
+
+PB_BIND(ClientResponseEncrypted, ClientResponseEncrypted, 2)
+
+
+
+
+
+

+ 162 - 0
components/spotify/cspot/protobuf/authentication.pb.h

@@ -0,0 +1,162 @@
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.4.6-dev */
+
+#ifndef PB_PROTOBUF_AUTHENTICATION_PB_H_INCLUDED
+#define PB_PROTOBUF_AUTHENTICATION_PB_H_INCLUDED
+#include <pb.h>
+
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+/* Enum definitions */
+typedef enum _CpuFamily { 
+    CpuFamily_CPU_UNKNOWN = 0, 
+    CpuFamily_CPU_X86 = 1, 
+    CpuFamily_CPU_X86_64 = 2, 
+    CpuFamily_CPU_PPC = 3, 
+    CpuFamily_CPU_PPC_64 = 4, 
+    CpuFamily_CPU_ARM = 5, 
+    CpuFamily_CPU_IA64 = 6, 
+    CpuFamily_CPU_SH = 7, 
+    CpuFamily_CPU_MIPS = 8, 
+    CpuFamily_CPU_BLACKFIN = 9 
+} CpuFamily;
+
+typedef enum _Os { 
+    Os_OS_UNKNOWN = 0, 
+    Os_OS_WINDOWS = 1, 
+    Os_OS_OSX = 2, 
+    Os_OS_IPHONE = 3, 
+    Os_OS_S60 = 4, 
+    Os_OS_LINUX = 5, 
+    Os_OS_WINDOWS_CE = 6, 
+    Os_OS_ANDROID = 7, 
+    Os_OS_PALM = 8, 
+    Os_OS_FREEBSD = 9, 
+    Os_OS_BLACKBERRY = 10, 
+    Os_OS_SONOS = 11, 
+    Os_OS_LOGITECH = 12, 
+    Os_OS_WP7 = 13, 
+    Os_OS_ONKYO = 14, 
+    Os_OS_PHILIPS = 15, 
+    Os_OS_WD = 16, 
+    Os_OS_VOLVO = 17, 
+    Os_OS_TIVO = 18, 
+    Os_OS_AWOX = 19, 
+    Os_OS_MEEGO = 20, 
+    Os_OS_QNXNTO = 21, 
+    Os_OS_BCO = 22 
+} Os;
+
+typedef enum _AuthenticationType { 
+    AuthenticationType_AUTHENTICATION_USER_PASS = 0, 
+    AuthenticationType_AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS = 1, 
+    AuthenticationType_AUTHENTICATION_STORED_FACEBOOK_CREDENTIALS = 2, 
+    AuthenticationType_AUTHENTICATION_SPOTIFY_TOKEN = 3, 
+    AuthenticationType_AUTHENTICATION_FACEBOOK_TOKEN = 4 
+} AuthenticationType;
+
+/* Struct definitions */
+typedef struct _LoginCredentials { 
+    char *username; 
+    AuthenticationType typ; 
+    pb_bytes_array_t *auth_data; 
+} LoginCredentials;
+
+typedef struct _SystemInfo { 
+    CpuFamily cpu_family; 
+    Os os; 
+    char *system_information_string; 
+    char *device_id; 
+} SystemInfo;
+
+typedef struct _ClientResponseEncrypted { 
+    LoginCredentials login_credentials; 
+    SystemInfo system_info; 
+    char *version_string; 
+} ClientResponseEncrypted;
+
+
+/* Helper constants for enums */
+#define _CpuFamily_MIN CpuFamily_CPU_UNKNOWN
+#define _CpuFamily_MAX CpuFamily_CPU_BLACKFIN
+#define _CpuFamily_ARRAYSIZE ((CpuFamily)(CpuFamily_CPU_BLACKFIN+1))
+
+#define _Os_MIN Os_OS_UNKNOWN
+#define _Os_MAX Os_OS_BCO
+#define _Os_ARRAYSIZE ((Os)(Os_OS_BCO+1))
+
+#define _AuthenticationType_MIN AuthenticationType_AUTHENTICATION_USER_PASS
+#define _AuthenticationType_MAX AuthenticationType_AUTHENTICATION_FACEBOOK_TOKEN
+#define _AuthenticationType_ARRAYSIZE ((AuthenticationType)(AuthenticationType_AUTHENTICATION_FACEBOOK_TOKEN+1))
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Initializer values for message structs */
+#define SystemInfo_init_default                  {_CpuFamily_MIN, _Os_MIN, NULL, NULL}
+#define LoginCredentials_init_default            {NULL, _AuthenticationType_MIN, NULL}
+#define ClientResponseEncrypted_init_default     {LoginCredentials_init_default, SystemInfo_init_default, NULL}
+#define SystemInfo_init_zero                     {_CpuFamily_MIN, _Os_MIN, NULL, NULL}
+#define LoginCredentials_init_zero               {NULL, _AuthenticationType_MIN, NULL}
+#define ClientResponseEncrypted_init_zero        {LoginCredentials_init_zero, SystemInfo_init_zero, NULL}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define LoginCredentials_username_tag            10
+#define LoginCredentials_typ_tag                 20
+#define LoginCredentials_auth_data_tag           30
+#define SystemInfo_cpu_family_tag                10
+#define SystemInfo_os_tag                        60
+#define SystemInfo_system_information_string_tag 90
+#define SystemInfo_device_id_tag                 100
+#define ClientResponseEncrypted_login_credentials_tag 10
+#define ClientResponseEncrypted_system_info_tag  50
+#define ClientResponseEncrypted_version_string_tag 70
+
+/* Struct field encoding specification for nanopb */
+#define SystemInfo_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, UENUM,    cpu_family,       10) \
+X(a, STATIC,   REQUIRED, UENUM,    os,               60) \
+X(a, POINTER,  OPTIONAL, STRING,   system_information_string,  90) \
+X(a, POINTER,  OPTIONAL, STRING,   device_id,       100)
+#define SystemInfo_CALLBACK NULL
+#define SystemInfo_DEFAULT NULL
+
+#define LoginCredentials_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, STRING,   username,         10) \
+X(a, STATIC,   REQUIRED, UENUM,    typ,              20) \
+X(a, POINTER,  OPTIONAL, BYTES,    auth_data,        30)
+#define LoginCredentials_CALLBACK NULL
+#define LoginCredentials_DEFAULT NULL
+
+#define ClientResponseEncrypted_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, MESSAGE,  login_credentials,  10) \
+X(a, STATIC,   REQUIRED, MESSAGE,  system_info,      50) \
+X(a, POINTER,  OPTIONAL, STRING,   version_string,   70)
+#define ClientResponseEncrypted_CALLBACK NULL
+#define ClientResponseEncrypted_DEFAULT NULL
+#define ClientResponseEncrypted_login_credentials_MSGTYPE LoginCredentials
+#define ClientResponseEncrypted_system_info_MSGTYPE SystemInfo
+
+extern const pb_msgdesc_t SystemInfo_msg;
+extern const pb_msgdesc_t LoginCredentials_msg;
+extern const pb_msgdesc_t ClientResponseEncrypted_msg;
+
+/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
+#define SystemInfo_fields &SystemInfo_msg
+#define LoginCredentials_fields &LoginCredentials_msg
+#define ClientResponseEncrypted_fields &ClientResponseEncrypted_msg
+
+/* Maximum encoded size of messages (where known) */
+/* SystemInfo_size depends on runtime parameters */
+/* LoginCredentials_size depends on runtime parameters */
+/* ClientResponseEncrypted_size depends on runtime parameters */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 54 - 0
components/spotify/cspot/protobuf/keyexchange.pb.c

@@ -0,0 +1,54 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.4.6-dev */
+
+#include "protobuf/keyexchange.pb.h"
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+PB_BIND(LoginCryptoDiffieHellmanChallenge, LoginCryptoDiffieHellmanChallenge, AUTO)
+
+
+PB_BIND(LoginCryptoChallengeUnion, LoginCryptoChallengeUnion, AUTO)
+
+
+PB_BIND(LoginCryptoDiffieHellmanHello, LoginCryptoDiffieHellmanHello, AUTO)
+
+
+PB_BIND(LoginCryptoHelloUnion, LoginCryptoHelloUnion, AUTO)
+
+
+PB_BIND(BuildInfo, BuildInfo, AUTO)
+
+
+PB_BIND(FeatureSet, FeatureSet, AUTO)
+
+
+PB_BIND(APChallenge, APChallenge, AUTO)
+
+
+PB_BIND(APResponseMessage, APResponseMessage, AUTO)
+
+
+PB_BIND(LoginCryptoDiffieHellmanResponse, LoginCryptoDiffieHellmanResponse, AUTO)
+
+
+PB_BIND(LoginCryptoResponseUnion, LoginCryptoResponseUnion, AUTO)
+
+
+PB_BIND(CryptoResponseUnion, CryptoResponseUnion, AUTO)
+
+
+PB_BIND(PoWResponseUnion, PoWResponseUnion, AUTO)
+
+
+PB_BIND(ClientResponsePlaintext, ClientResponsePlaintext, AUTO)
+
+
+PB_BIND(ClientHello, ClientHello, 2)
+
+
+
+
+
+

+ 343 - 0
components/spotify/cspot/protobuf/keyexchange.pb.h

@@ -0,0 +1,343 @@
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.4.6-dev */
+
+#ifndef PB_PROTOBUF_KEYEXCHANGE_PB_H_INCLUDED
+#define PB_PROTOBUF_KEYEXCHANGE_PB_H_INCLUDED
+#include <pb.h>
+
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+/* Enum definitions */
+typedef enum _Product { 
+    Product_PRODUCT_CLIENT = 0, 
+    Product_PRODUCT_LIBSPOTIFY = 1, 
+    Product_PRODUCT_MOBILE = 2, 
+    Product_PRODUCT_PARTNER = 3, 
+    Product_PRODUCT_LIBSPOTIFY_EMBEDDED = 5 
+} Product;
+
+typedef enum _Platform2 { 
+    Platform2_PLATFORM_WIN32_X86 = 0, 
+    Platform2_PLATFORM_OSX_X86 = 1, 
+    Platform2_PLATFORM_LINUX_X86 = 2, 
+    Platform2_PLATFORM_IPHONE_ARM = 3, 
+    Platform2_PLATFORM_S60_ARM = 4, 
+    Platform2_PLATFORM_OSX_PPC = 5, 
+    Platform2_PLATFORM_ANDROID_ARM = 6, 
+    Platform2_PLATFORM_WINDOWS_CE_ARM = 7, 
+    Platform2_PLATFORM_LINUX_X86_64 = 8, 
+    Platform2_PLATFORM_OSX_X86_64 = 9, 
+    Platform2_PLATFORM_PALM_ARM = 10, 
+    Platform2_PLATFORM_LINUX_SH = 11, 
+    Platform2_PLATFORM_FREEBSD_X86 = 12, 
+    Platform2_PLATFORM_FREEBSD_X86_64 = 13, 
+    Platform2_PLATFORM_BLACKBERRY_ARM = 14, 
+    Platform2_PLATFORM_SONOS = 15, 
+    Platform2_PLATFORM_LINUX_MIPS = 16, 
+    Platform2_PLATFORM_LINUX_ARM = 17, 
+    Platform2_PLATFORM_LOGITECH_ARM = 18, 
+    Platform2_PLATFORM_LINUX_BLACKFIN = 19, 
+    Platform2_PLATFORM_WP7_ARM = 20, 
+    Platform2_PLATFORM_ONKYO_ARM = 21, 
+    Platform2_PLATFORM_QNXNTO_ARM = 22, 
+    Platform2_PLATFORM_BCO_ARM = 23 
+} Platform2;
+
+typedef enum _Cryptosuite { 
+    Cryptosuite_CRYPTO_SUITE_SHANNON = 0, 
+    Cryptosuite_CRYPTO_SUITE_RC4_SHA1_HMAC = 1 
+} Cryptosuite;
+
+/* Struct definitions */
+typedef struct _CryptoResponseUnion { 
+    char dummy_field;
+} CryptoResponseUnion;
+
+typedef struct _PoWResponseUnion { 
+    char dummy_field;
+} PoWResponseUnion;
+
+typedef struct _BuildInfo { 
+    Product product; 
+    Platform2 platform; 
+    uint64_t version; 
+} BuildInfo;
+
+typedef struct _FeatureSet { 
+    bool has_autoupdate2;
+    bool autoupdate2; 
+} FeatureSet;
+
+typedef struct _LoginCryptoDiffieHellmanChallenge { 
+    pb_byte_t gs[96]; 
+} LoginCryptoDiffieHellmanChallenge;
+
+typedef struct _LoginCryptoDiffieHellmanHello { 
+    pb_byte_t gc[96]; 
+    uint32_t server_keys_known; 
+} LoginCryptoDiffieHellmanHello;
+
+typedef struct _LoginCryptoDiffieHellmanResponse { 
+    pb_byte_t hmac[20]; 
+} LoginCryptoDiffieHellmanResponse;
+
+typedef struct _LoginCryptoChallengeUnion { 
+    bool has_diffie_hellman;
+    LoginCryptoDiffieHellmanChallenge diffie_hellman; 
+} LoginCryptoChallengeUnion;
+
+typedef struct _LoginCryptoHelloUnion { 
+    bool has_diffie_hellman;
+    LoginCryptoDiffieHellmanHello diffie_hellman; 
+} LoginCryptoHelloUnion;
+
+typedef struct _LoginCryptoResponseUnion { 
+    bool has_diffie_hellman;
+    LoginCryptoDiffieHellmanResponse diffie_hellman; 
+} LoginCryptoResponseUnion;
+
+typedef struct _APChallenge { 
+    LoginCryptoChallengeUnion login_crypto_challenge; 
+} APChallenge;
+
+typedef struct _ClientHello { 
+    BuildInfo build_info; 
+    Cryptosuite cryptosuites_supported[1]; 
+    LoginCryptoHelloUnion login_crypto_hello; 
+    pb_byte_t client_nonce[16]; 
+    bool has_padding;
+    pb_byte_t padding[1]; 
+    bool has_feature_set;
+    FeatureSet feature_set; 
+} ClientHello;
+
+typedef struct _ClientResponsePlaintext { 
+    LoginCryptoResponseUnion login_crypto_response; 
+    PoWResponseUnion pow_response; 
+    CryptoResponseUnion crypto_response; 
+} ClientResponsePlaintext;
+
+typedef struct _APResponseMessage { 
+    bool has_challenge;
+    APChallenge challenge; 
+} APResponseMessage;
+
+
+/* Helper constants for enums */
+#define _Product_MIN Product_PRODUCT_CLIENT
+#define _Product_MAX Product_PRODUCT_LIBSPOTIFY_EMBEDDED
+#define _Product_ARRAYSIZE ((Product)(Product_PRODUCT_LIBSPOTIFY_EMBEDDED+1))
+
+#define _Platform2_MIN Platform2_PLATFORM_WIN32_X86
+#define _Platform2_MAX Platform2_PLATFORM_BCO_ARM
+#define _Platform2_ARRAYSIZE ((Platform2)(Platform2_PLATFORM_BCO_ARM+1))
+
+#define _Cryptosuite_MIN Cryptosuite_CRYPTO_SUITE_SHANNON
+#define _Cryptosuite_MAX Cryptosuite_CRYPTO_SUITE_RC4_SHA1_HMAC
+#define _Cryptosuite_ARRAYSIZE ((Cryptosuite)(Cryptosuite_CRYPTO_SUITE_RC4_SHA1_HMAC+1))
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Initializer values for message structs */
+#define LoginCryptoDiffieHellmanChallenge_init_default {{0}}
+#define LoginCryptoChallengeUnion_init_default   {false, LoginCryptoDiffieHellmanChallenge_init_default}
+#define LoginCryptoDiffieHellmanHello_init_default {{0}, 0}
+#define LoginCryptoHelloUnion_init_default       {false, LoginCryptoDiffieHellmanHello_init_default}
+#define BuildInfo_init_default                   {_Product_MIN, _Platform2_MIN, 0}
+#define FeatureSet_init_default                  {false, 0}
+#define APChallenge_init_default                 {LoginCryptoChallengeUnion_init_default}
+#define APResponseMessage_init_default           {false, APChallenge_init_default}
+#define LoginCryptoDiffieHellmanResponse_init_default {{0}}
+#define LoginCryptoResponseUnion_init_default    {false, LoginCryptoDiffieHellmanResponse_init_default}
+#define CryptoResponseUnion_init_default         {0}
+#define PoWResponseUnion_init_default            {0}
+#define ClientResponsePlaintext_init_default     {LoginCryptoResponseUnion_init_default, PoWResponseUnion_init_default, CryptoResponseUnion_init_default}
+#define ClientHello_init_default                 {BuildInfo_init_default, {_Cryptosuite_MIN}, LoginCryptoHelloUnion_init_default, {0}, false, {0}, false, FeatureSet_init_default}
+#define LoginCryptoDiffieHellmanChallenge_init_zero {{0}}
+#define LoginCryptoChallengeUnion_init_zero      {false, LoginCryptoDiffieHellmanChallenge_init_zero}
+#define LoginCryptoDiffieHellmanHello_init_zero  {{0}, 0}
+#define LoginCryptoHelloUnion_init_zero          {false, LoginCryptoDiffieHellmanHello_init_zero}
+#define BuildInfo_init_zero                      {_Product_MIN, _Platform2_MIN, 0}
+#define FeatureSet_init_zero                     {false, 0}
+#define APChallenge_init_zero                    {LoginCryptoChallengeUnion_init_zero}
+#define APResponseMessage_init_zero              {false, APChallenge_init_zero}
+#define LoginCryptoDiffieHellmanResponse_init_zero {{0}}
+#define LoginCryptoResponseUnion_init_zero       {false, LoginCryptoDiffieHellmanResponse_init_zero}
+#define CryptoResponseUnion_init_zero            {0}
+#define PoWResponseUnion_init_zero               {0}
+#define ClientResponsePlaintext_init_zero        {LoginCryptoResponseUnion_init_zero, PoWResponseUnion_init_zero, CryptoResponseUnion_init_zero}
+#define ClientHello_init_zero                    {BuildInfo_init_zero, {_Cryptosuite_MIN}, LoginCryptoHelloUnion_init_zero, {0}, false, {0}, false, FeatureSet_init_zero}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define BuildInfo_product_tag                    10
+#define BuildInfo_platform_tag                   30
+#define BuildInfo_version_tag                    40
+#define FeatureSet_autoupdate2_tag               1
+#define LoginCryptoDiffieHellmanChallenge_gs_tag 10
+#define LoginCryptoDiffieHellmanHello_gc_tag     10
+#define LoginCryptoDiffieHellmanHello_server_keys_known_tag 20
+#define LoginCryptoDiffieHellmanResponse_hmac_tag 10
+#define LoginCryptoChallengeUnion_diffie_hellman_tag 10
+#define LoginCryptoHelloUnion_diffie_hellman_tag 10
+#define LoginCryptoResponseUnion_diffie_hellman_tag 10
+#define APChallenge_login_crypto_challenge_tag   10
+#define ClientHello_build_info_tag               10
+#define ClientHello_cryptosuites_supported_tag   30
+#define ClientHello_login_crypto_hello_tag       50
+#define ClientHello_client_nonce_tag             60
+#define ClientHello_padding_tag                  70
+#define ClientHello_feature_set_tag              80
+#define ClientResponsePlaintext_login_crypto_response_tag 10
+#define ClientResponsePlaintext_pow_response_tag 20
+#define ClientResponsePlaintext_crypto_response_tag 30
+#define APResponseMessage_challenge_tag          10
+
+/* Struct field encoding specification for nanopb */
+#define LoginCryptoDiffieHellmanChallenge_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, FIXED_LENGTH_BYTES, gs,               10)
+#define LoginCryptoDiffieHellmanChallenge_CALLBACK NULL
+#define LoginCryptoDiffieHellmanChallenge_DEFAULT NULL
+
+#define LoginCryptoChallengeUnion_FIELDLIST(X, a) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  diffie_hellman,   10)
+#define LoginCryptoChallengeUnion_CALLBACK NULL
+#define LoginCryptoChallengeUnion_DEFAULT NULL
+#define LoginCryptoChallengeUnion_diffie_hellman_MSGTYPE LoginCryptoDiffieHellmanChallenge
+
+#define LoginCryptoDiffieHellmanHello_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, FIXED_LENGTH_BYTES, gc,               10) \
+X(a, STATIC,   REQUIRED, UINT32,   server_keys_known,  20)
+#define LoginCryptoDiffieHellmanHello_CALLBACK NULL
+#define LoginCryptoDiffieHellmanHello_DEFAULT NULL
+
+#define LoginCryptoHelloUnion_FIELDLIST(X, a) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  diffie_hellman,   10)
+#define LoginCryptoHelloUnion_CALLBACK NULL
+#define LoginCryptoHelloUnion_DEFAULT NULL
+#define LoginCryptoHelloUnion_diffie_hellman_MSGTYPE LoginCryptoDiffieHellmanHello
+
+#define BuildInfo_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, UENUM,    product,          10) \
+X(a, STATIC,   REQUIRED, UENUM,    platform,         30) \
+X(a, STATIC,   REQUIRED, UINT64,   version,          40)
+#define BuildInfo_CALLBACK NULL
+#define BuildInfo_DEFAULT NULL
+
+#define FeatureSet_FIELDLIST(X, a) \
+X(a, STATIC,   OPTIONAL, BOOL,     autoupdate2,       1)
+#define FeatureSet_CALLBACK NULL
+#define FeatureSet_DEFAULT NULL
+
+#define APChallenge_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, MESSAGE,  login_crypto_challenge,  10)
+#define APChallenge_CALLBACK NULL
+#define APChallenge_DEFAULT NULL
+#define APChallenge_login_crypto_challenge_MSGTYPE LoginCryptoChallengeUnion
+
+#define APResponseMessage_FIELDLIST(X, a) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  challenge,        10)
+#define APResponseMessage_CALLBACK NULL
+#define APResponseMessage_DEFAULT NULL
+#define APResponseMessage_challenge_MSGTYPE APChallenge
+
+#define LoginCryptoDiffieHellmanResponse_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, FIXED_LENGTH_BYTES, hmac,             10)
+#define LoginCryptoDiffieHellmanResponse_CALLBACK NULL
+#define LoginCryptoDiffieHellmanResponse_DEFAULT NULL
+
+#define LoginCryptoResponseUnion_FIELDLIST(X, a) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  diffie_hellman,   10)
+#define LoginCryptoResponseUnion_CALLBACK NULL
+#define LoginCryptoResponseUnion_DEFAULT NULL
+#define LoginCryptoResponseUnion_diffie_hellman_MSGTYPE LoginCryptoDiffieHellmanResponse
+
+#define CryptoResponseUnion_FIELDLIST(X, a) \
+
+#define CryptoResponseUnion_CALLBACK NULL
+#define CryptoResponseUnion_DEFAULT NULL
+
+#define PoWResponseUnion_FIELDLIST(X, a) \
+
+#define PoWResponseUnion_CALLBACK NULL
+#define PoWResponseUnion_DEFAULT NULL
+
+#define ClientResponsePlaintext_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, MESSAGE,  login_crypto_response,  10) \
+X(a, STATIC,   REQUIRED, MESSAGE,  pow_response,     20) \
+X(a, STATIC,   REQUIRED, MESSAGE,  crypto_response,  30)
+#define ClientResponsePlaintext_CALLBACK NULL
+#define ClientResponsePlaintext_DEFAULT NULL
+#define ClientResponsePlaintext_login_crypto_response_MSGTYPE LoginCryptoResponseUnion
+#define ClientResponsePlaintext_pow_response_MSGTYPE PoWResponseUnion
+#define ClientResponsePlaintext_crypto_response_MSGTYPE CryptoResponseUnion
+
+#define ClientHello_FIELDLIST(X, a) \
+X(a, STATIC,   REQUIRED, MESSAGE,  build_info,       10) \
+X(a, STATIC,   FIXARRAY, UENUM,    cryptosuites_supported,  30) \
+X(a, STATIC,   REQUIRED, MESSAGE,  login_crypto_hello,  50) \
+X(a, STATIC,   REQUIRED, FIXED_LENGTH_BYTES, client_nonce,     60) \
+X(a, STATIC,   OPTIONAL, FIXED_LENGTH_BYTES, padding,          70) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  feature_set,      80)
+#define ClientHello_CALLBACK NULL
+#define ClientHello_DEFAULT NULL
+#define ClientHello_build_info_MSGTYPE BuildInfo
+#define ClientHello_login_crypto_hello_MSGTYPE LoginCryptoHelloUnion
+#define ClientHello_feature_set_MSGTYPE FeatureSet
+
+extern const pb_msgdesc_t LoginCryptoDiffieHellmanChallenge_msg;
+extern const pb_msgdesc_t LoginCryptoChallengeUnion_msg;
+extern const pb_msgdesc_t LoginCryptoDiffieHellmanHello_msg;
+extern const pb_msgdesc_t LoginCryptoHelloUnion_msg;
+extern const pb_msgdesc_t BuildInfo_msg;
+extern const pb_msgdesc_t FeatureSet_msg;
+extern const pb_msgdesc_t APChallenge_msg;
+extern const pb_msgdesc_t APResponseMessage_msg;
+extern const pb_msgdesc_t LoginCryptoDiffieHellmanResponse_msg;
+extern const pb_msgdesc_t LoginCryptoResponseUnion_msg;
+extern const pb_msgdesc_t CryptoResponseUnion_msg;
+extern const pb_msgdesc_t PoWResponseUnion_msg;
+extern const pb_msgdesc_t ClientResponsePlaintext_msg;
+extern const pb_msgdesc_t ClientHello_msg;
+
+/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
+#define LoginCryptoDiffieHellmanChallenge_fields &LoginCryptoDiffieHellmanChallenge_msg
+#define LoginCryptoChallengeUnion_fields &LoginCryptoChallengeUnion_msg
+#define LoginCryptoDiffieHellmanHello_fields &LoginCryptoDiffieHellmanHello_msg
+#define LoginCryptoHelloUnion_fields &LoginCryptoHelloUnion_msg
+#define BuildInfo_fields &BuildInfo_msg
+#define FeatureSet_fields &FeatureSet_msg
+#define APChallenge_fields &APChallenge_msg
+#define APResponseMessage_fields &APResponseMessage_msg
+#define LoginCryptoDiffieHellmanResponse_fields &LoginCryptoDiffieHellmanResponse_msg
+#define LoginCryptoResponseUnion_fields &LoginCryptoResponseUnion_msg
+#define CryptoResponseUnion_fields &CryptoResponseUnion_msg
+#define PoWResponseUnion_fields &PoWResponseUnion_msg
+#define ClientResponsePlaintext_fields &ClientResponsePlaintext_msg
+#define ClientHello_fields &ClientHello_msg
+
+/* Maximum encoded size of messages (where known) */
+#define APChallenge_size                         102
+#define APResponseMessage_size                   104
+#define BuildInfo_size                           17
+#define ClientHello_size                         161
+#define ClientResponsePlaintext_size             32
+#define CryptoResponseUnion_size                 0
+#define FeatureSet_size                          2
+#define LoginCryptoChallengeUnion_size           100
+#define LoginCryptoDiffieHellmanChallenge_size   98
+#define LoginCryptoDiffieHellmanHello_size       105
+#define LoginCryptoDiffieHellmanResponse_size    22
+#define LoginCryptoHelloUnion_size               107
+#define LoginCryptoResponseUnion_size            24
+#define PoWResponseUnion_size                    0
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 12 - 0
components/spotify/cspot/protobuf/mercury.pb.c

@@ -0,0 +1,12 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.4.6-dev */
+
+#include "protobuf/mercury.pb.h"
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+PB_BIND(Header, Header, AUTO)
+
+
+

+ 50 - 0
components/spotify/cspot/protobuf/mercury.pb.h

@@ -0,0 +1,50 @@
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.4.6-dev */
+
+#ifndef PB_PROTOBUF_MERCURY_PB_H_INCLUDED
+#define PB_PROTOBUF_MERCURY_PB_H_INCLUDED
+#include <pb.h>
+
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+/* Struct definitions */
+typedef struct _Header { 
+    char *uri; 
+    char *method; 
+} Header;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Initializer values for message structs */
+#define Header_init_default                      {NULL, NULL}
+#define Header_init_zero                         {NULL, NULL}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define Header_uri_tag                           1
+#define Header_method_tag                        3
+
+/* Struct field encoding specification for nanopb */
+#define Header_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, STRING,   uri,               1) \
+X(a, POINTER,  OPTIONAL, STRING,   method,            3)
+#define Header_CALLBACK NULL
+#define Header_DEFAULT NULL
+
+extern const pb_msgdesc_t Header_msg;
+
+/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
+#define Header_fields &Header_msg
+
+/* Maximum encoded size of messages (where known) */
+/* Header_size depends on runtime parameters */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 34 - 0
components/spotify/cspot/protobuf/metadata.pb.c

@@ -0,0 +1,34 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.4.6-dev */
+
+#include "protobuf/metadata.pb.h"
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+PB_BIND(AudioFile, AudioFile, AUTO)
+
+
+PB_BIND(Restriction, Restriction, AUTO)
+
+
+PB_BIND(Image, Image, AUTO)
+
+
+PB_BIND(ImageGroup, ImageGroup, AUTO)
+
+
+PB_BIND(Album, Album, AUTO)
+
+
+PB_BIND(Artist, Artist, AUTO)
+
+
+PB_BIND(Track, Track, AUTO)
+
+
+PB_BIND(Episode, Episode, 2)
+
+
+
+

+ 240 - 0
components/spotify/cspot/protobuf/metadata.pb.h

@@ -0,0 +1,240 @@
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.4.6-dev */
+
+#ifndef PB_PROTOBUF_METADATA_PB_H_INCLUDED
+#define PB_PROTOBUF_METADATA_PB_H_INCLUDED
+#include <pb.h>
+
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+/* Enum definitions */
+typedef enum _AudioFormat { 
+    AudioFormat_OGG_VORBIS_96 = 0, 
+    AudioFormat_OGG_VORBIS_160 = 1, 
+    AudioFormat_OGG_VORBIS_320 = 2, 
+    AudioFormat_MP3_256 = 3, 
+    AudioFormat_MP3_320 = 4, 
+    AudioFormat_MP3_160 = 5, 
+    AudioFormat_MP3_96 = 6, 
+    AudioFormat_MP3_160_ENC = 7, 
+    AudioFormat_AAC_24 = 8, 
+    AudioFormat_AAC_48 = 9 
+} AudioFormat;
+
+/* Struct definitions */
+typedef struct _Artist { 
+    pb_bytes_array_t *gid; 
+    char *name; 
+} Artist;
+
+typedef struct _Image { 
+    pb_bytes_array_t *file_id; 
+} Image;
+
+typedef struct _ImageGroup { 
+    pb_size_t image_count;
+    struct _Image *image; 
+} ImageGroup;
+
+typedef struct _Restriction { 
+    char *countries_allowed; 
+    char *countries_forbidden; 
+} Restriction;
+
+typedef struct _Album { 
+    pb_callback_t gid; 
+    char *name; 
+    bool has_cover_group;
+    ImageGroup cover_group; 
+} Album;
+
+typedef struct _AudioFile { 
+    pb_bytes_array_t *file_id; 
+    bool has_format;
+    AudioFormat format; 
+} AudioFile;
+
+typedef struct _Episode { 
+    pb_bytes_array_t *gid; 
+    char *name; 
+    bool has_duration;
+    int32_t duration; 
+    pb_size_t audio_count;
+    struct _AudioFile *audio; 
+    struct _ImageGroup *covers; 
+} Episode;
+
+typedef struct _Track { 
+    pb_bytes_array_t *gid; 
+    char *name; 
+    bool has_album;
+    Album album; 
+    pb_size_t artist_count;
+    struct _Artist *artist; 
+    bool has_duration;
+    int32_t duration; 
+    pb_size_t restriction_count;
+    struct _Restriction *restriction; 
+    pb_size_t file_count;
+    struct _AudioFile *file; 
+    pb_size_t alternative_count;
+    struct _Track *alternative; 
+} Track;
+
+
+/* Helper constants for enums */
+#define _AudioFormat_MIN AudioFormat_OGG_VORBIS_96
+#define _AudioFormat_MAX AudioFormat_AAC_48
+#define _AudioFormat_ARRAYSIZE ((AudioFormat)(AudioFormat_AAC_48+1))
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Initializer values for message structs */
+#define AudioFile_init_default                   {NULL, false, _AudioFormat_MIN}
+#define Restriction_init_default                 {NULL, NULL}
+#define Image_init_default                       {NULL}
+#define ImageGroup_init_default                  {0, NULL}
+#define Album_init_default                       {{{NULL}, NULL}, NULL, false, ImageGroup_init_default}
+#define Artist_init_default                      {NULL, NULL}
+#define Track_init_default                       {NULL, NULL, false, Album_init_default, 0, NULL, false, 0, 0, NULL, 0, NULL, 0, NULL}
+#define Episode_init_default                     {NULL, NULL, false, 0, 0, NULL, NULL}
+#define AudioFile_init_zero                      {NULL, false, _AudioFormat_MIN}
+#define Restriction_init_zero                    {NULL, NULL}
+#define Image_init_zero                          {NULL}
+#define ImageGroup_init_zero                     {0, NULL}
+#define Album_init_zero                          {{{NULL}, NULL}, NULL, false, ImageGroup_init_zero}
+#define Artist_init_zero                         {NULL, NULL}
+#define Track_init_zero                          {NULL, NULL, false, Album_init_zero, 0, NULL, false, 0, 0, NULL, 0, NULL, 0, NULL}
+#define Episode_init_zero                        {NULL, NULL, false, 0, 0, NULL, NULL}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define Artist_gid_tag                           1
+#define Artist_name_tag                          2
+#define Image_file_id_tag                        1
+#define ImageGroup_image_tag                     1
+#define Restriction_countries_allowed_tag        2
+#define Restriction_countries_forbidden_tag      3
+#define Album_gid_tag                            1
+#define Album_name_tag                           2
+#define Album_cover_group_tag                    17
+#define AudioFile_file_id_tag                    1
+#define AudioFile_format_tag                     2
+#define Episode_gid_tag                          1
+#define Episode_name_tag                         2
+#define Episode_duration_tag                     7
+#define Episode_audio_tag                        12
+#define Episode_covers_tag                       68
+#define Track_gid_tag                            1
+#define Track_name_tag                           2
+#define Track_album_tag                          3
+#define Track_artist_tag                         4
+#define Track_duration_tag                       7
+#define Track_restriction_tag                    11
+#define Track_file_tag                           12
+#define Track_alternative_tag                    13
+
+/* Struct field encoding specification for nanopb */
+#define AudioFile_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, BYTES,    file_id,           1) \
+X(a, STATIC,   OPTIONAL, UENUM,    format,            2)
+#define AudioFile_CALLBACK NULL
+#define AudioFile_DEFAULT NULL
+
+#define Restriction_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, STRING,   countries_allowed,   2) \
+X(a, POINTER,  OPTIONAL, STRING,   countries_forbidden,   3)
+#define Restriction_CALLBACK NULL
+#define Restriction_DEFAULT NULL
+
+#define Image_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, BYTES,    file_id,           1)
+#define Image_CALLBACK NULL
+#define Image_DEFAULT NULL
+
+#define ImageGroup_FIELDLIST(X, a) \
+X(a, POINTER,  REPEATED, MESSAGE,  image,             1)
+#define ImageGroup_CALLBACK NULL
+#define ImageGroup_DEFAULT NULL
+#define ImageGroup_image_MSGTYPE Image
+
+#define Album_FIELDLIST(X, a) \
+X(a, CALLBACK, OPTIONAL, BYTES,    gid,               1) \
+X(a, POINTER,  OPTIONAL, STRING,   name,              2) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  cover_group,      17)
+#define Album_CALLBACK pb_default_field_callback
+#define Album_DEFAULT NULL
+#define Album_cover_group_MSGTYPE ImageGroup
+
+#define Artist_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, BYTES,    gid,               1) \
+X(a, POINTER,  OPTIONAL, STRING,   name,              2)
+#define Artist_CALLBACK NULL
+#define Artist_DEFAULT NULL
+
+#define Track_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, BYTES,    gid,               1) \
+X(a, POINTER,  OPTIONAL, STRING,   name,              2) \
+X(a, STATIC,   OPTIONAL, MESSAGE,  album,             3) \
+X(a, POINTER,  REPEATED, MESSAGE,  artist,            4) \
+X(a, STATIC,   OPTIONAL, SINT32,   duration,          7) \
+X(a, POINTER,  REPEATED, MESSAGE,  restriction,      11) \
+X(a, POINTER,  REPEATED, MESSAGE,  file,             12) \
+X(a, POINTER,  REPEATED, MESSAGE,  alternative,      13)
+#define Track_CALLBACK NULL
+#define Track_DEFAULT NULL
+#define Track_album_MSGTYPE Album
+#define Track_artist_MSGTYPE Artist
+#define Track_restriction_MSGTYPE Restriction
+#define Track_file_MSGTYPE AudioFile
+#define Track_alternative_MSGTYPE Track
+
+#define Episode_FIELDLIST(X, a) \
+X(a, POINTER,  OPTIONAL, BYTES,    gid,               1) \
+X(a, POINTER,  OPTIONAL, STRING,   name,              2) \
+X(a, STATIC,   OPTIONAL, SINT32,   duration,          7) \
+X(a, POINTER,  REPEATED, MESSAGE,  audio,            12) \
+X(a, POINTER,  OPTIONAL, MESSAGE,  covers,           68)
+#define Episode_CALLBACK NULL
+#define Episode_DEFAULT NULL
+#define Episode_audio_MSGTYPE AudioFile
+#define Episode_covers_MSGTYPE ImageGroup
+
+extern const pb_msgdesc_t AudioFile_msg;
+extern const pb_msgdesc_t Restriction_msg;
+extern const pb_msgdesc_t Image_msg;
+extern const pb_msgdesc_t ImageGroup_msg;
+extern const pb_msgdesc_t Album_msg;
+extern const pb_msgdesc_t Artist_msg;
+extern const pb_msgdesc_t Track_msg;
+extern const pb_msgdesc_t Episode_msg;
+
+/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
+#define AudioFile_fields &AudioFile_msg
+#define Restriction_fields &Restriction_msg
+#define Image_fields &Image_msg
+#define ImageGroup_fields &ImageGroup_msg
+#define Album_fields &Album_msg
+#define Artist_fields &Artist_msg
+#define Track_fields &Track_msg
+#define Episode_fields &Episode_msg
+
+/* Maximum encoded size of messages (where known) */
+/* AudioFile_size depends on runtime parameters */
+/* Restriction_size depends on runtime parameters */
+/* Image_size depends on runtime parameters */
+/* ImageGroup_size depends on runtime parameters */
+/* Album_size depends on runtime parameters */
+/* Artist_size depends on runtime parameters */
+/* Track_size depends on runtime parameters */
+/* Episode_size depends on runtime parameters */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 27 - 0
components/spotify/cspot/protobuf/spirc.pb.c

@@ -0,0 +1,27 @@
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.4.6-dev */
+
+#include "protobuf/spirc.pb.h"
+#if PB_PROTO_HEADER_VERSION != 40
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+PB_BIND(TrackRef, TrackRef, AUTO)
+
+
+PB_BIND(State, State, 4)
+
+
+PB_BIND(Capability, Capability, 2)
+
+
+PB_BIND(DeviceState, DeviceState, 4)
+
+
+PB_BIND(Frame, Frame, 4)
+
+
+
+
+
+

File diff suppressed because it is too large
+ 156 - 0
components/spotify/cspot/protobuf/spirc.pb.h


Some files were not shown because too many files changed in this diff