mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-11 15:03:24 -05:00
[spotify] Import version 0.4 of librespot-c and remove password-based login
Experimental version to test new protocol
This commit is contained in:
parent
fd0060b199
commit
5b5e036330
@ -11,16 +11,31 @@ PROTO_SRC = \
|
||||
src/proto/mercury.pb-c.c src/proto/mercury.pb-c.h \
|
||||
src/proto/metadata.pb-c.c src/proto/metadata.pb-c.h
|
||||
|
||||
HTTP_PROTO_SRC = \
|
||||
src/proto/connectivity.pb-c.c src/proto/connectivity.pb-c.h \
|
||||
src/proto/clienttoken.pb-c.c src/proto/clienttoken.pb-c.h \
|
||||
src/proto/login5_user_info.pb-c.h src/proto/login5_user_info.pb-c.c \
|
||||
src/proto/login5.pb-c.h src/proto/login5.pb-c.c \
|
||||
src/proto/login5_identifiers.pb-c.h src/proto/login5_identifiers.pb-c.c \
|
||||
src/proto/login5_credentials.pb-c.h src/proto/login5_credentials.pb-c.c \
|
||||
src/proto/login5_client_info.pb-c.h src/proto/login5_client_info.pb-c.c \
|
||||
src/proto/login5_challenges_hashcash.pb-c.h src/proto/login5_challenges_hashcash.pb-c.c \
|
||||
src/proto/login5_challenges_code.pb-c.h src/proto/login5_challenges_code.pb-c.c \
|
||||
src/proto/google_duration.pb-c.h src/proto/google_duration.pb-c.c \
|
||||
src/proto/storage_resolve.pb-c.h src/proto/storage_resolve.pb-c.c
|
||||
|
||||
CORE_SRC = \
|
||||
src/librespot-c.c src/connection.c src/channel.c src/crypto.c src/commands.c
|
||||
src/librespot-c.c src/connection.c src/channel.c src/crypto.c src/commands.c \
|
||||
src/http.c
|
||||
|
||||
librespot_c_a_SOURCES = \
|
||||
$(CORE_SRC) \
|
||||
$(SHANNON_SRC) \
|
||||
$(PROTO_SRC)
|
||||
$(PROTO_SRC) \
|
||||
$(HTTP_PROTO_SRC)
|
||||
|
||||
noinst_HEADERS = \
|
||||
librespot-c.h src/librespot-c-internal.h src/connection.h \
|
||||
src/channel.h src/crypto.h src/commands.h
|
||||
src/channel.h src/crypto.h src/commands.h src/http.h
|
||||
|
||||
EXTRA_DIST = README.md LICENSE
|
||||
|
@ -1,10 +1,15 @@
|
||||
AC_INIT([librespot-c], [0.1])
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_AR
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_CPPFLAGS="-Wall"
|
||||
AC_SUBST([AM_CPPFLAGS])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE([sys/utsname.h])
|
||||
|
||||
AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h], [found_endian_headers=yes; break;])
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <pthread.h>
|
||||
|
||||
#define LIBRESPOT_C_VERSION_MAJOR 0
|
||||
#define LIBRESPOT_C_VERSION_MINOR 2
|
||||
#define LIBRESPOT_C_VERSION_MINOR 4
|
||||
|
||||
|
||||
struct sp_session;
|
||||
@ -47,8 +47,7 @@ struct sp_sysinfo
|
||||
|
||||
struct sp_callbacks
|
||||
{
|
||||
// Bring your own https client and tcp connector
|
||||
int (*https_get)(char **body, const char *url);
|
||||
// Bring your own tcp connector
|
||||
int (*tcp_connect)(const char *address, unsigned short port);
|
||||
void (*tcp_disconnect)(int fd);
|
||||
|
||||
@ -60,10 +59,9 @@ struct sp_callbacks
|
||||
void (*logmsg)(const char *fmt, ...);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Deprecated, use login_token and login_stored_cred instead
|
||||
struct sp_session *
|
||||
librespotc_login_password(const char *username, const char *password);
|
||||
librespotc_login_password(const char *username, const char *password) __attribute__ ((deprecated));
|
||||
|
||||
struct sp_session *
|
||||
librespotc_login_stored_cred(const char *username, uint8_t *stored_cred, size_t stored_cred_len);
|
||||
@ -74,6 +72,9 @@ librespotc_login_token(const char *username, const char *token);
|
||||
int
|
||||
librespotc_logout(struct sp_session *session);
|
||||
|
||||
int
|
||||
librespotc_legacy_set(struct sp_session *session, int use_legacy);
|
||||
|
||||
int
|
||||
librespotc_bitrate_set(struct sp_session *session, enum sp_bitrates bitrate);
|
||||
|
||||
|
@ -63,6 +63,8 @@ channel_get(uint32_t channel_id, struct sp_session *session)
|
||||
void
|
||||
channel_free(struct sp_channel *channel)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!channel || channel->state == SP_CHANNEL_STATE_UNALLOCATED)
|
||||
return;
|
||||
|
||||
@ -82,6 +84,9 @@ channel_free(struct sp_channel *channel)
|
||||
|
||||
free(channel->file.path);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(channel->file.cdnurl); i++)
|
||||
free(channel->file.cdnurl[i]);
|
||||
|
||||
memset(channel, 0, sizeof(struct sp_channel));
|
||||
|
||||
channel->audio_fd[0] = -1;
|
||||
@ -208,7 +213,8 @@ channel_seek_internal(struct sp_channel *channel, size_t pos, bool do_flush)
|
||||
channel->seek_pos = pos;
|
||||
|
||||
// If seek + header isn't word aligned we will get up to 3 bytes before the
|
||||
// actual seek position. We will remove those when they are received.
|
||||
// actual seek position with the legacy protocol. We will remove those when
|
||||
// they are received.
|
||||
channel->seek_align = (pos + SP_OGG_HEADER_LEN) % 4;
|
||||
|
||||
seek_words = (pos + SP_OGG_HEADER_LEN) / 4;
|
||||
@ -218,8 +224,8 @@ channel_seek_internal(struct sp_channel *channel, size_t pos, bool do_flush)
|
||||
RETURN_ERROR(SP_ERR_DECRYPTION, sp_errmsg);
|
||||
|
||||
// Set the offset and received counter to match the seek
|
||||
channel->file.offset_words = seek_words;
|
||||
channel->file.received_words = seek_words;
|
||||
channel->file.offset_bytes = 4 * seek_words;
|
||||
channel->file.received_bytes = 4 * seek_words;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -256,7 +262,7 @@ channel_retry(struct sp_channel *channel)
|
||||
memset(&channel->header, 0, sizeof(struct sp_channel_header));
|
||||
memset(&channel->body, 0, sizeof(struct sp_channel_body));
|
||||
|
||||
pos = 4 * channel->file.received_words - SP_OGG_HEADER_LEN;
|
||||
pos = channel->file.received_bytes - SP_OGG_HEADER_LEN;
|
||||
|
||||
channel_seek_internal(channel, pos, false); // false => don't flush
|
||||
}
|
||||
@ -316,12 +322,12 @@ channel_header_handle(struct sp_channel *channel, struct sp_channel_header *head
|
||||
}
|
||||
|
||||
memcpy(&be32, header->data, sizeof(be32));
|
||||
channel->file.len_words = be32toh(be32);
|
||||
channel->file.len_bytes = 4 * be32toh(be32);
|
||||
}
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
channel_header_trailer_read(struct sp_channel *channel, uint8_t *msg, size_t msg_len, struct sp_session *session)
|
||||
channel_header_trailer_read(struct sp_channel *channel, uint8_t *msg, size_t msg_len)
|
||||
{
|
||||
ssize_t parsed_len;
|
||||
ssize_t consumed_len;
|
||||
@ -333,10 +339,10 @@ channel_header_trailer_read(struct sp_channel *channel, uint8_t *msg, size_t msg
|
||||
if (msg_len == 0)
|
||||
{
|
||||
channel->file.end_of_chunk = true;
|
||||
channel->file.end_of_file = (channel->file.received_words >= channel->file.len_words);
|
||||
channel->file.end_of_file = (channel->file.received_bytes >= channel->file.len_bytes);
|
||||
|
||||
// In preparation for next chunk
|
||||
channel->file.offset_words += SP_CHUNK_LEN_WORDS;
|
||||
channel->file.offset_bytes += SP_CHUNK_LEN;
|
||||
channel->is_data_mode = false;
|
||||
|
||||
return 0;
|
||||
@ -369,22 +375,19 @@ channel_header_trailer_read(struct sp_channel *channel, uint8_t *msg, size_t msg
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
channel_data_read(struct sp_channel *channel, uint8_t *msg, size_t msg_len, struct sp_session *session)
|
||||
static int
|
||||
channel_data_read(struct sp_channel *channel, uint8_t *msg, size_t msg_len)
|
||||
{
|
||||
const char *errmsg;
|
||||
int ret;
|
||||
|
||||
assert (msg_len % 4 == 0);
|
||||
|
||||
channel->file.received_words += msg_len / 4;
|
||||
channel->file.received_bytes += msg_len;
|
||||
|
||||
ret = crypto_aes_decrypt(msg, msg_len, &channel->file.decrypt, &errmsg);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(SP_ERR_DECRYPTION, errmsg);
|
||||
|
||||
// Skip Spotify header
|
||||
// TODO What to do here when seeking
|
||||
if (!channel->is_spotify_header_received)
|
||||
{
|
||||
if (msg_len < SP_OGG_HEADER_LEN)
|
||||
@ -464,7 +467,7 @@ channel_msg_read(uint16_t *channel_id, uint8_t *msg, size_t msg_len, struct sp_s
|
||||
msg_len -= sizeof(be);
|
||||
|
||||
// Will set data_mode, end_of_file and end_of_chunk as appropriate
|
||||
consumed_len = channel_header_trailer_read(channel, msg, msg_len, session);
|
||||
consumed_len = channel_header_trailer_read(channel, msg, msg_len);
|
||||
if (consumed_len < 0)
|
||||
RETURN_ERROR((int)consumed_len, sp_errmsg);
|
||||
|
||||
@ -477,9 +480,9 @@ channel_msg_read(uint16_t *channel_id, uint8_t *msg, size_t msg_len, struct sp_s
|
||||
if (!channel->is_data_mode || !(msg_len > 0))
|
||||
return 0; // Not in data mode or no data to read
|
||||
|
||||
consumed_len = channel_data_read(channel, msg, msg_len, session);
|
||||
if (consumed_len < 0)
|
||||
RETURN_ERROR((int)consumed_len, sp_errmsg);
|
||||
ret = channel_data_read(channel, msg, msg_len);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -487,3 +490,21 @@ channel_msg_read(uint16_t *channel_id, uint8_t *msg, size_t msg_len, struct sp_s
|
||||
return ret;
|
||||
}
|
||||
|
||||
// With http there is the Spotify Ogg header, but no chunk header/trailer
|
||||
int
|
||||
channel_http_body_read(struct sp_channel *channel, uint8_t *body, size_t body_len)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = channel_data_read(channel, body, body_len);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
channel->file.end_of_chunk = true;
|
||||
channel->file.end_of_file = (channel->file.received_bytes >= channel->file.len_bytes);
|
||||
channel->file.offset_bytes += SP_CHUNK_LEN;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return ret;
|
||||
}
|
||||
|
@ -30,3 +30,6 @@ channel_retry(struct sp_channel *channel);
|
||||
|
||||
int
|
||||
channel_msg_read(uint16_t *channel_id, uint8_t *msg, size_t msg_len, struct sp_session *session);
|
||||
|
||||
int
|
||||
channel_http_body_read(struct sp_channel *channel, uint8_t *body, size_t body_len);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,22 +2,40 @@ void
|
||||
ap_disconnect(struct sp_connection *conn);
|
||||
|
||||
enum sp_error
|
||||
ap_connect(struct sp_connection *conn, enum sp_msg_type type, time_t *cooldown_ts, const char *ap_address, struct sp_conn_callbacks *cb, void *cb_arg);
|
||||
ap_connect(struct sp_connection *conn, struct sp_server *server, time_t *cooldown_ts, struct sp_conn_callbacks *cb, void *cb_arg);
|
||||
|
||||
const char *
|
||||
ap_address_get(struct sp_connection *conn);
|
||||
void
|
||||
ap_blacklist(struct sp_server *server);
|
||||
|
||||
int
|
||||
seq_requests_check(void);
|
||||
|
||||
struct sp_seq_request *
|
||||
seq_request_get(enum sp_seq_type seq_type, int n, bool use_legacy);
|
||||
|
||||
void
|
||||
seq_next_set(struct sp_session *session, enum sp_seq_type seq_type);
|
||||
|
||||
enum sp_error
|
||||
response_read(struct sp_session *session);
|
||||
seq_request_prepare(struct sp_seq_request *request, struct sp_conn_callbacks *cb, struct sp_session *session);
|
||||
|
||||
bool
|
||||
msg_is_handshake(enum sp_msg_type type);
|
||||
enum sp_error
|
||||
msg_tcp_read_one(struct sp_tcp_message *tmsg, struct sp_connection *conn);
|
||||
|
||||
enum sp_error
|
||||
msg_handle(struct sp_message *msg, struct sp_session *session);
|
||||
|
||||
void
|
||||
msg_clear(struct sp_message *msg);
|
||||
|
||||
int
|
||||
msg_make(struct sp_message *msg, enum sp_msg_type type, struct sp_session *session);
|
||||
msg_make(struct sp_message *msg, struct sp_seq_request *req, struct sp_session *session);
|
||||
|
||||
int
|
||||
msg_send(struct sp_message *msg, struct sp_connection *conn);
|
||||
enum sp_error
|
||||
msg_tcp_send(struct sp_tcp_message *tmsg, struct sp_connection *conn);
|
||||
|
||||
int
|
||||
enum sp_error
|
||||
msg_http_send(struct http_response *hres, struct http_request *hreq, struct http_session *hses);
|
||||
|
||||
enum sp_error
|
||||
msg_pong(struct sp_session *session);
|
||||
|
215
src/inputs/librespot-c/src/http.c
Normal file
215
src/inputs/librespot-c/src/http.c
Normal file
@ -0,0 +1,215 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h> // strncasecmp
|
||||
#include <limits.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <event2/event.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "http.h"
|
||||
|
||||
// Number of seconds the client will wait for a response before aborting
|
||||
#define HTTP_CLIENT_TIMEOUT 8
|
||||
|
||||
void
|
||||
http_session_init(struct http_session *session)
|
||||
{
|
||||
session->internal = curl_easy_init();
|
||||
}
|
||||
|
||||
void
|
||||
http_session_deinit(struct http_session *session)
|
||||
{
|
||||
curl_easy_cleanup(session->internal);
|
||||
}
|
||||
|
||||
void
|
||||
http_request_free(struct http_request *request, bool only_content)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!request)
|
||||
return;
|
||||
|
||||
free(request->url);
|
||||
free(request->body);
|
||||
|
||||
for (i = 0; request->headers[i]; i++)
|
||||
free(request->headers[i]);
|
||||
|
||||
if (only_content)
|
||||
memset(request, 0, sizeof(struct http_request));
|
||||
else
|
||||
free(request);
|
||||
}
|
||||
|
||||
void
|
||||
http_response_free(struct http_response *response, bool only_content)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!response)
|
||||
return;
|
||||
|
||||
free(response->body);
|
||||
|
||||
for (i = 0; response->headers[i]; i++)
|
||||
free(response->headers[i]);
|
||||
|
||||
if (only_content)
|
||||
memset(response, 0, sizeof(struct http_response));
|
||||
else
|
||||
free(response);
|
||||
}
|
||||
|
||||
static void
|
||||
headers_save(struct http_response *response, CURL *curl)
|
||||
{
|
||||
struct curl_header *prev = NULL;
|
||||
struct curl_header *header;
|
||||
int i = 0;
|
||||
|
||||
while ((header = curl_easy_nextheader(curl, CURLH_HEADER, 0, prev)) && i < HTTP_MAX_HEADERS)
|
||||
{
|
||||
if (asprintf(&response->headers[i], "%s:%s", header->name, header->value) < 0)
|
||||
return;
|
||||
|
||||
prev = header;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
static size_t
|
||||
body_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
||||
{
|
||||
struct http_response *response = userdata;
|
||||
size_t realsize = size * nmemb;
|
||||
size_t new_size;
|
||||
uint8_t *new;
|
||||
|
||||
if (realsize == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Make sure the size is +1 larger than needed so we can zero terminate for safety
|
||||
new_size = response->body_len + realsize + 1;
|
||||
new = realloc(response->body, new_size);
|
||||
if (!new)
|
||||
{
|
||||
free(response->body);
|
||||
response->body = NULL;
|
||||
response->body_len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(new + response->body_len, ptr, realsize);
|
||||
response->body_len += realsize;
|
||||
|
||||
memset(new + response->body_len, 0, 1); // Zero terminate in case we need to address as C string
|
||||
response->body = new;
|
||||
return nmemb;
|
||||
}
|
||||
|
||||
int
|
||||
http_request(struct http_response *response, struct http_request *request, struct http_session *session)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
struct curl_slist *headers = NULL;
|
||||
long response_code;
|
||||
long opt;
|
||||
curl_off_t content_length;
|
||||
int i;
|
||||
|
||||
if (session)
|
||||
{
|
||||
curl = session->internal;
|
||||
curl_easy_reset(curl);
|
||||
}
|
||||
else
|
||||
{
|
||||
curl = curl_easy_init();
|
||||
}
|
||||
if (!curl)
|
||||
return -1;
|
||||
|
||||
memset(response, 0, sizeof(struct http_response));
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, request->url);
|
||||
|
||||
// Set optional params
|
||||
if (request->user_agent)
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, request->user_agent);
|
||||
for (i = 0; i < HTTP_MAX_HEADERS && request->headers[i]; i++)
|
||||
headers = curl_slist_append(headers, request->headers[i]);
|
||||
if (headers)
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
|
||||
if ((opt = request->ssl_verify_peer))
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, opt);
|
||||
|
||||
if (request->headers_only)
|
||||
{
|
||||
curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); // Makes curl make a HEAD request
|
||||
}
|
||||
else if (request->body && request->body_len > 0)
|
||||
{
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, request->body);
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request->body_len);
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, HTTP_CLIENT_TIMEOUT);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, body_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, response);
|
||||
|
||||
// Allow redirects
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 5);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK)
|
||||
goto error;
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
response->code = (res == CURLE_OK) ? (int) response_code : -1;
|
||||
|
||||
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &content_length);
|
||||
response->content_length = (res == CURLE_OK) ? (ssize_t)content_length : -1;
|
||||
|
||||
headers_save(response, curl);
|
||||
|
||||
curl_slist_free_all(headers);
|
||||
if (!session)
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
curl_slist_free_all(headers);
|
||||
if (!session)
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *
|
||||
http_response_header_find(const char *key, struct http_response *response)
|
||||
{
|
||||
char **header;
|
||||
size_t key_len;
|
||||
|
||||
key_len = strlen(key);
|
||||
|
||||
for (header = response->headers; *header; header++)
|
||||
{
|
||||
if (strncasecmp(key, *header, key_len) == 0 && (*header)[key_len] == ':')
|
||||
return *header + key_len + 1;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
83
src/inputs/librespot-c/src/http.h
Normal file
83
src/inputs/librespot-c/src/http.h
Normal file
@ -0,0 +1,83 @@
|
||||
#ifndef __HTTP_H__
|
||||
#define __HTTP_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define HTTP_MAX_HEADERS 32
|
||||
|
||||
/* Response codes from event2/http.h with 206 added */
|
||||
#define HTTP_CONTINUE 100 /**< client should proceed to send */
|
||||
#define HTTP_SWITCH_PROTOCOLS 101 /**< switching to another protocol */
|
||||
#define HTTP_PROCESSING 102 /**< processing the request, but no response is available yet */
|
||||
#define HTTP_EARLYHINTS 103 /**< return some response headers */
|
||||
#define HTTP_OK 200 /**< request completed ok */
|
||||
#define HTTP_CREATED 201 /**< new resource is created */
|
||||
#define HTTP_ACCEPTED 202 /**< accepted for processing */
|
||||
#define HTTP_NONAUTHORITATIVE 203 /**< returning a modified version of the origin's response */
|
||||
#define HTTP_NOCONTENT 204 /**< request does not have content */
|
||||
#define HTTP_PARTIALCONTENT 206 /**< partial content returned*/
|
||||
#define HTTP_MOVEPERM 301 /**< the uri moved permanently */
|
||||
#define HTTP_MOVETEMP 302 /**< the uri moved temporarily */
|
||||
#define HTTP_NOTMODIFIED 304 /**< page was not modified from last */
|
||||
#define HTTP_BADREQUEST 400 /**< invalid http request was made */
|
||||
#define HTTP_UNAUTHORIZED 401 /**< authentication is required */
|
||||
#define HTTP_PAYMENTREQUIRED 402 /**< user exceeded limit on requests */
|
||||
#define HTTP_FORBIDDEN 403 /**< user not having the necessary permissions */
|
||||
#define HTTP_NOTFOUND 404 /**< could not find content for uri */
|
||||
#define HTTP_BADMETHOD 405 /**< method not allowed for this uri */
|
||||
#define HTTP_ENTITYTOOLARGE 413 /**< request is larger than the server is able to process */
|
||||
#define HTTP_EXPECTATIONFAILED 417 /**< we can't handle this expectation */
|
||||
#define HTTP_INTERNAL 500 /**< internal error */
|
||||
#define HTTP_NOTIMPLEMENTED 501 /**< not implemented */
|
||||
#define HTTP_BADGATEWAY 502 /**< received an invalid response from the upstream */
|
||||
#define HTTP_SERVUNAVAIL 503 /**< the server is not available */
|
||||
|
||||
struct http_session
|
||||
{
|
||||
void *internal;
|
||||
};
|
||||
|
||||
struct http_request
|
||||
{
|
||||
char *url;
|
||||
|
||||
const char *user_agent;
|
||||
bool headers_only; // HEAD request
|
||||
bool ssl_verify_peer;
|
||||
|
||||
char *headers[HTTP_MAX_HEADERS];
|
||||
uint8_t *body; // If not NULL and body_len > 0 -> POST request
|
||||
size_t body_len;
|
||||
};
|
||||
|
||||
struct http_response
|
||||
{
|
||||
int code;
|
||||
ssize_t content_length; // -1 = unknown
|
||||
|
||||
char *headers[HTTP_MAX_HEADERS];
|
||||
uint8_t *body; // Allocated, must be freed by caller
|
||||
size_t body_len;
|
||||
};
|
||||
|
||||
void
|
||||
http_session_init(struct http_session *session);
|
||||
|
||||
void
|
||||
http_session_deinit(struct http_session *session);
|
||||
|
||||
void
|
||||
http_request_free(struct http_request *request, bool only_content);
|
||||
|
||||
void
|
||||
http_response_free(struct http_response *response, bool only_content);
|
||||
|
||||
// The session is optional but increases performance when making many requests.
|
||||
int
|
||||
http_request(struct http_response *response, struct http_request *request, struct http_session *session);
|
||||
|
||||
char *
|
||||
http_response_header_find(const char *key, struct http_response *response);
|
||||
|
||||
#endif /* !__HTTP_H__ */
|
@ -27,16 +27,19 @@
|
||||
#define be64toh(x) OSSwapBigToHostInt64(x)
|
||||
#endif
|
||||
|
||||
#define ARRAY_SIZE(x) ((unsigned int)(sizeof(x) / sizeof((x)[0])))
|
||||
|
||||
#include "librespot-c.h"
|
||||
#include "crypto.h"
|
||||
#include "http.h"
|
||||
|
||||
#include "proto/keyexchange.pb-c.h"
|
||||
#include "proto/authentication.pb-c.h"
|
||||
#include "proto/mercury.pb-c.h"
|
||||
#include "proto/metadata.pb-c.h"
|
||||
|
||||
#define SP_AP_RESOLVE_URL "https://APResolve.spotify.com/"
|
||||
#define SP_AP_RESOLVE_KEY "ap_list"
|
||||
#include "proto/clienttoken.pb-c.h"
|
||||
#include "proto/login5.pb-c.h"
|
||||
#include "proto/storage_resolve.pb-c.h"
|
||||
|
||||
// Disconnect from AP after this number of secs idle
|
||||
#define SP_AP_DISCONNECT_SECS 60
|
||||
@ -68,15 +71,19 @@
|
||||
// Download in chunks of 32768 bytes. The chunks shouldn't be too large because
|
||||
// it makes seeking slow (seeking involves jumping around in the file), but
|
||||
// large enough that the file can be probed from the first chunk.
|
||||
#define SP_CHUNK_LEN_WORDS 1024 * 8
|
||||
// For comparison, Spotify for Windows seems to request 7300 byte chunks.
|
||||
#define SP_CHUNK_LEN 32768
|
||||
|
||||
// Used to create default sysinfo, which should be librespot_[short sha]_[random 8 characters build id],
|
||||
// ref https://github.com/plietar/librespot/pull/218. User may override, but
|
||||
// as of 20220516 Spotify seems to have whitelisting of client name.
|
||||
#define SP_CLIENT_NAME_DEFAULT "librespot"
|
||||
#define SP_CLIENT_VERSION_DEFAULT "000000"
|
||||
#define SP_CLIENT_VERSION_DEFAULT "0.0.0"
|
||||
#define SP_CLIENT_BUILD_ID_DEFAULT "aabbccdd"
|
||||
|
||||
// ClientIdHex from client_id.go
|
||||
#define SP_CLIENT_ID_HEX "65b708073fc0480ea92a077233ca87bd"
|
||||
|
||||
// Shorthand for error handling
|
||||
#define RETURN_ERROR(r, m) \
|
||||
do { ret = (r); sp_errmsg = (m); goto error; } while(0)
|
||||
@ -100,15 +107,24 @@ enum sp_error
|
||||
|
||||
enum sp_msg_type
|
||||
{
|
||||
MSG_TYPE_NONE,
|
||||
MSG_TYPE_CLIENT_HELLO,
|
||||
MSG_TYPE_CLIENT_RESPONSE_PLAINTEXT,
|
||||
MSG_TYPE_CLIENT_RESPONSE_ENCRYPTED,
|
||||
MSG_TYPE_PONG,
|
||||
MSG_TYPE_MERCURY_TRACK_GET,
|
||||
MSG_TYPE_MERCURY_EPISODE_GET,
|
||||
MSG_TYPE_AUDIO_KEY_GET,
|
||||
MSG_TYPE_CHUNK_REQUEST,
|
||||
SP_MSG_TYPE_HTTP_REQ,
|
||||
SP_MSG_TYPE_HTTP_RES,
|
||||
SP_MSG_TYPE_TCP,
|
||||
};
|
||||
|
||||
enum sp_seq_type
|
||||
{
|
||||
SP_SEQ_STOP = 0,
|
||||
SP_SEQ_LOGIN,
|
||||
SP_SEQ_MEDIA_OPEN,
|
||||
SP_SEQ_MEDIA_GET,
|
||||
SP_SEQ_PONG,
|
||||
};
|
||||
|
||||
enum sp_proto
|
||||
{
|
||||
SP_PROTO_TCP,
|
||||
SP_PROTO_HTTP,
|
||||
};
|
||||
|
||||
enum sp_media_type
|
||||
@ -177,6 +193,7 @@ struct sp_cmdargs
|
||||
int fd_write;
|
||||
size_t seek_pos;
|
||||
enum sp_bitrates bitrate;
|
||||
int use_legacy;
|
||||
|
||||
sp_progress_cb progress_cb;
|
||||
void *cb_arg;
|
||||
@ -190,32 +207,45 @@ struct sp_conn_callbacks
|
||||
event_callback_fn timeout_cb;
|
||||
};
|
||||
|
||||
struct sp_message
|
||||
struct sp_tcp_message
|
||||
{
|
||||
enum sp_msg_type type;
|
||||
enum sp_cmd_type cmd;
|
||||
|
||||
bool encrypt;
|
||||
bool add_version_header;
|
||||
|
||||
enum sp_msg_type type_next;
|
||||
enum sp_msg_type type_queued;
|
||||
size_t len;
|
||||
uint8_t *data;
|
||||
};
|
||||
|
||||
int (*response_handler)(uint8_t *msg, size_t msg_len, struct sp_session *session);
|
||||
struct sp_message
|
||||
{
|
||||
enum sp_msg_type type;
|
||||
|
||||
ssize_t len;
|
||||
uint8_t data[4096];
|
||||
union payload
|
||||
{
|
||||
struct sp_tcp_message tmsg;
|
||||
struct http_request hreq;
|
||||
struct http_response hres;
|
||||
} payload;
|
||||
};
|
||||
|
||||
struct sp_server
|
||||
{
|
||||
char *address; // e.g. ap-gue1.spotify.com
|
||||
unsigned short port; // normally 433 or 4070
|
||||
time_t last_connect_ts;
|
||||
time_t last_resolved_ts;
|
||||
time_t last_failed_ts;
|
||||
};
|
||||
|
||||
struct sp_connection
|
||||
{
|
||||
struct sp_server *server; // NULL or pointer to session.accesspoint
|
||||
|
||||
bool is_connected;
|
||||
bool is_encrypted;
|
||||
|
||||
// Resolved access point
|
||||
char *ap_address;
|
||||
unsigned short ap_port;
|
||||
|
||||
// Where we receive data from Spotify
|
||||
int response_fd;
|
||||
struct event *response_ev;
|
||||
@ -237,6 +267,14 @@ struct sp_connection
|
||||
struct crypto_cipher decrypt;
|
||||
};
|
||||
|
||||
struct sp_token
|
||||
{
|
||||
char value[512]; // base64 string, actual size 360 bytes
|
||||
int32_t expires_after_seconds;
|
||||
int32_t refresh_after_seconds;
|
||||
time_t received_ts;
|
||||
};
|
||||
|
||||
struct sp_mercury
|
||||
{
|
||||
char *uri;
|
||||
@ -263,14 +301,18 @@ struct sp_file
|
||||
uint8_t media_id[16]; // Decoded value of the URIs base62
|
||||
enum sp_media_type media_type; // track or episode from URI
|
||||
|
||||
// For files that are served via http/"new protocol" (we may receive multiple
|
||||
// urls).
|
||||
char *cdnurl[4];
|
||||
|
||||
uint8_t key[16];
|
||||
|
||||
uint16_t channel_id;
|
||||
|
||||
// Length and download progress
|
||||
size_t len_words; // Length of file in words (32 bit)
|
||||
size_t offset_words;
|
||||
size_t received_words;
|
||||
size_t len_bytes;
|
||||
size_t offset_bytes;
|
||||
size_t received_bytes;
|
||||
bool end_of_file;
|
||||
bool end_of_chunk;
|
||||
bool open;
|
||||
@ -326,11 +368,19 @@ struct sp_channel
|
||||
// Linked list of sessions
|
||||
struct sp_session
|
||||
{
|
||||
struct sp_server accesspoint;
|
||||
struct sp_server spclient;
|
||||
struct sp_server dealer;
|
||||
|
||||
struct sp_connection conn;
|
||||
time_t cooldown_ts;
|
||||
|
||||
// Address of an access point we want to avoid due to previous failure
|
||||
char *ap_avoid;
|
||||
// Use legacy protocol (non http, see seq_requests_legacy)
|
||||
bool use_legacy;
|
||||
|
||||
struct http_session http_session;
|
||||
struct sp_token http_clienttoken;
|
||||
struct sp_token http_accesstoken;
|
||||
|
||||
bool is_logged_in;
|
||||
struct sp_credentials credentials;
|
||||
@ -344,24 +394,35 @@ struct sp_session
|
||||
// the current track is also available
|
||||
struct sp_channel *now_streaming_channel;
|
||||
|
||||
// Current request in the sequence
|
||||
struct sp_seq_request *request;
|
||||
|
||||
// Go to next step in a request sequence
|
||||
struct event *continue_ev;
|
||||
|
||||
// Current, next and subsequent message being processed
|
||||
enum sp_msg_type msg_type_last;
|
||||
enum sp_msg_type msg_type_next;
|
||||
enum sp_msg_type msg_type_queued;
|
||||
int (*response_handler)(uint8_t *, size_t, struct sp_session *);
|
||||
// Which sequence comes next
|
||||
enum sp_seq_type next_seq;
|
||||
|
||||
struct sp_session *next;
|
||||
};
|
||||
|
||||
struct sp_seq_request
|
||||
{
|
||||
enum sp_seq_type seq_type;
|
||||
const char *name; // Name of request (for logging)
|
||||
enum sp_proto proto;
|
||||
int (*payload_make)(struct sp_message *, struct sp_session *);
|
||||
enum sp_error (*request_prepare)(struct sp_seq_request *, struct sp_conn_callbacks *, struct sp_session *);
|
||||
enum sp_error (*response_handler)(struct sp_message *, struct sp_session *);
|
||||
};
|
||||
|
||||
struct sp_err_map
|
||||
{
|
||||
ErrorCode errorcode;
|
||||
int errorcode;
|
||||
const char *errmsg;
|
||||
};
|
||||
|
||||
|
||||
extern struct sp_callbacks sp_cb;
|
||||
extern struct sp_sysinfo sp_sysinfo;
|
||||
extern const char *sp_errmsg;
|
||||
|
@ -47,6 +47,12 @@ events for proceeding are activated directly.
|
||||
"timeout": receive or write took too long to complete
|
||||
*/
|
||||
|
||||
// TODO
|
||||
// - update comments
|
||||
// - try different server if connection refused
|
||||
// - Valgrind
|
||||
// - Handle connection error -> ap_resolve
|
||||
|
||||
#include <pthread.h>
|
||||
#include <assert.h>
|
||||
|
||||
@ -79,9 +85,8 @@ static int debug_disconnect_counter;
|
||||
#endif
|
||||
|
||||
// Forwards
|
||||
static int
|
||||
request_make(enum sp_msg_type type, struct sp_session *session);
|
||||
|
||||
static void
|
||||
sequence_continue(struct sp_session *session);
|
||||
|
||||
/* -------------------------------- Session --------------------------------- */
|
||||
|
||||
@ -97,7 +102,8 @@ session_free(struct sp_session *session)
|
||||
|
||||
event_free(session->continue_ev);
|
||||
|
||||
free(session->ap_avoid);
|
||||
http_session_deinit(&session->http_session);
|
||||
|
||||
free(session);
|
||||
}
|
||||
|
||||
@ -133,6 +139,8 @@ session_new(struct sp_session **out, struct sp_cmdargs *cmdargs, event_callback_
|
||||
if (!session)
|
||||
RETURN_ERROR(SP_ERR_OOM, "Out of memory creating session");
|
||||
|
||||
http_session_init(&session->http_session);
|
||||
|
||||
session->continue_ev = evtimer_new(sp_evbase, cb, session);
|
||||
if (!session->continue_ev)
|
||||
RETURN_ERROR(SP_ERR_OOM, "Out of memory creating session event");
|
||||
@ -227,7 +235,7 @@ session_return(struct sp_session *session, enum sp_error err)
|
||||
static void
|
||||
session_error(struct sp_session *session, enum sp_error err)
|
||||
{
|
||||
sp_cb.logmsg("Session error: %d (occurred before msg %d, queue %d)\n", err, session->msg_type_next, session->msg_type_queued);
|
||||
sp_cb.logmsg("Session error %d: %s\n", err, sp_errmsg);
|
||||
|
||||
session_return(session, err);
|
||||
|
||||
@ -245,71 +253,26 @@ session_error(struct sp_session *session, enum sp_error err)
|
||||
|
||||
// Called if an access point disconnects. Will clear current connection and
|
||||
// start a flow where the same request will be made to another access point.
|
||||
// This is currently only implemented for the non-http connection.
|
||||
static void
|
||||
session_retry(struct sp_session *session)
|
||||
{
|
||||
struct sp_channel *channel = session->now_streaming_channel;
|
||||
enum sp_msg_type type = session->msg_type_last;
|
||||
const char *ap_address = ap_address_get(&session->conn);
|
||||
int ret;
|
||||
|
||||
sp_cb.logmsg("Retrying after disconnect (occurred at msg %d)\n", type);
|
||||
sp_cb.logmsg("Retrying after disconnect\n");
|
||||
|
||||
channel_retry(channel);
|
||||
|
||||
free(session->ap_avoid);
|
||||
session->ap_avoid = strdup(ap_address);
|
||||
ap_blacklist(session->conn.server);
|
||||
|
||||
ap_disconnect(&session->conn);
|
||||
|
||||
// If we were in the middle of a handshake when disconnected we must restart
|
||||
if (msg_is_handshake(type))
|
||||
type = MSG_TYPE_CLIENT_HELLO;
|
||||
|
||||
ret = request_make(type, session);
|
||||
if (ret < 0)
|
||||
session_error(session, ret);
|
||||
sequence_continue(session);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------ Main sequence control --------------------------- */
|
||||
|
||||
// This callback must determine if a new request should be made, or if we are
|
||||
// done and should return to caller
|
||||
static void
|
||||
continue_cb(int fd, short what, void *arg)
|
||||
{
|
||||
struct sp_session *session = arg;
|
||||
enum sp_msg_type type = MSG_TYPE_NONE;
|
||||
int ret;
|
||||
|
||||
// type_next has priority, since this is what we use to chain a sequence, e.g.
|
||||
// the handshake sequence. type_queued is what comes after, e.g. first a
|
||||
// handshake (type_next) and then a chunk request (type_queued)
|
||||
if (session->msg_type_next != MSG_TYPE_NONE)
|
||||
{
|
||||
// sp_cb.logmsg(">>> msg_next >>>\n");
|
||||
|
||||
type = session->msg_type_next;
|
||||
session->msg_type_next = MSG_TYPE_NONE;
|
||||
}
|
||||
else if (session->msg_type_queued != MSG_TYPE_NONE)
|
||||
{
|
||||
// sp_cb.logmsg(">>> msg_queued >>>\n");
|
||||
|
||||
type = session->msg_type_queued;
|
||||
session->msg_type_queued = MSG_TYPE_NONE;
|
||||
}
|
||||
|
||||
if (type != MSG_TYPE_NONE)
|
||||
{
|
||||
ret = request_make(type, session);
|
||||
if (ret < 0)
|
||||
session_error(session, ret);
|
||||
}
|
||||
else
|
||||
session_return(session, SP_OK_DONE); // All done, yay!
|
||||
}
|
||||
|
||||
// This callback is triggered by response_cb when the message response handler
|
||||
// said that there was data to write. If not all data can be written in one pass
|
||||
// it will re-add the event.
|
||||
@ -343,7 +306,7 @@ audio_write_cb(int fd, short what, void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
timeout_cb(int fd, short what, void *arg)
|
||||
timeout_tcp_cb(int fd, short what, void *arg)
|
||||
{
|
||||
struct sp_session *session = arg;
|
||||
|
||||
@ -353,11 +316,24 @@ timeout_cb(int fd, short what, void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
response_cb(int fd, short what, void *arg)
|
||||
audio_data_received(struct sp_session *session)
|
||||
{
|
||||
struct sp_channel *channel = session->now_streaming_channel;
|
||||
|
||||
if (channel->state == SP_CHANNEL_STATE_PLAYING && !channel->file.end_of_file)
|
||||
seq_next_set(session, SP_SEQ_MEDIA_GET);
|
||||
if (channel->progress_cb)
|
||||
channel->progress_cb(channel->audio_fd[0], channel->cb_arg, channel->file.received_bytes - SP_OGG_HEADER_LEN, channel->file.len_bytes - SP_OGG_HEADER_LEN);
|
||||
|
||||
event_add(channel->audio_write_ev, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
incoming_tcp_cb(int fd, short what, void *arg)
|
||||
{
|
||||
struct sp_session *session = arg;
|
||||
struct sp_connection *conn = &session->conn;
|
||||
struct sp_channel *channel = session->now_streaming_channel;
|
||||
struct sp_message msg = { .type = SP_MSG_TYPE_TCP };
|
||||
int ret;
|
||||
|
||||
if (what == EV_READ)
|
||||
@ -367,7 +343,7 @@ response_cb(int fd, short what, void *arg)
|
||||
debug_disconnect_counter++;
|
||||
if (debug_disconnect_counter == 1000)
|
||||
{
|
||||
sp_cb.logmsg("Simulating a disconnection from the access point (last request type was %d)\n", session->msg_type_last);
|
||||
sp_cb.logmsg("Simulating a disconnection from the access point (last request was %s)\n", session->request->name);
|
||||
ret = 0;
|
||||
}
|
||||
#endif
|
||||
@ -376,23 +352,29 @@ response_cb(int fd, short what, void *arg)
|
||||
RETURN_ERROR(SP_ERR_NOCONNECTION, "The access point disconnected");
|
||||
else if (ret < 0)
|
||||
RETURN_ERROR(SP_ERR_NOCONNECTION, "Connection to Spotify returned an error");
|
||||
|
||||
// sp_cb.logmsg("Received data len %d\n", ret);
|
||||
}
|
||||
|
||||
ret = response_read(session);
|
||||
// Allocates *data in msg
|
||||
ret = msg_tcp_read_one(&msg.payload.tmsg, conn);
|
||||
if (ret == SP_OK_WAIT)
|
||||
return;
|
||||
else if (ret < 0)
|
||||
goto error;
|
||||
|
||||
if (msg.payload.tmsg.len < 128)
|
||||
sp_cb.hexdump("Received tcp message\n", msg.payload.tmsg.data, msg.payload.tmsg.len);
|
||||
else
|
||||
sp_cb.hexdump("Received tcp message (truncated)\n", msg.payload.tmsg.data, 128);
|
||||
|
||||
ret = msg_handle(&msg, session);
|
||||
switch (ret)
|
||||
{
|
||||
case SP_OK_WAIT: // Incomplete, wait for more data
|
||||
break;
|
||||
case SP_OK_DATA:
|
||||
if (channel->state == SP_CHANNEL_STATE_PLAYING && !channel->file.end_of_file)
|
||||
session->msg_type_next = MSG_TYPE_CHUNK_REQUEST;
|
||||
if (channel->progress_cb)
|
||||
channel->progress_cb(channel->audio_fd[0], channel->cb_arg, 4 * channel->file.received_words - SP_OGG_HEADER_LEN, 4 * channel->file.len_words - SP_OGG_HEADER_LEN);
|
||||
audio_data_received(session);
|
||||
|
||||
event_del(conn->timeout_ev);
|
||||
event_add(channel->audio_write_ev, NULL);
|
||||
break;
|
||||
case SP_OK_DONE: // Got the response we expected, but possibly more to process
|
||||
if (evbuffer_get_length(conn->incoming) > 0)
|
||||
@ -410,77 +392,140 @@ response_cb(int fd, short what, void *arg)
|
||||
goto error;
|
||||
}
|
||||
|
||||
msg_clear(&msg);
|
||||
return;
|
||||
|
||||
error:
|
||||
msg_clear(&msg);
|
||||
|
||||
if (ret == SP_ERR_NOCONNECTION)
|
||||
session_retry(session);
|
||||
else
|
||||
session_error(session, ret);
|
||||
}
|
||||
|
||||
static int
|
||||
relogin(enum sp_msg_type type, struct sp_session *session)
|
||||
static enum sp_error
|
||||
msg_send(struct sp_message *msg, struct sp_session *session)
|
||||
{
|
||||
int ret;
|
||||
struct sp_message res;
|
||||
struct sp_connection *conn = &session->conn;
|
||||
enum sp_error ret;
|
||||
|
||||
ret = request_make(MSG_TYPE_CLIENT_HELLO, session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
if (session->request->proto == SP_PROTO_TCP)
|
||||
{
|
||||
if (msg->payload.tmsg.encrypt)
|
||||
conn->is_encrypted = true;
|
||||
|
||||
// In case we lost connection to the AP we have to make a new handshake for
|
||||
// the non-handshake message types. So queue the message until the handshake
|
||||
// is complete.
|
||||
session->msg_type_queued = type;
|
||||
return 0;
|
||||
ret = msg_tcp_send(&msg->payload.tmsg, conn);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
|
||||
// Only start timeout timer if a response is expected, otherwise go
|
||||
// straight to next message
|
||||
if (session->request->response_handler)
|
||||
event_add(conn->timeout_ev, &sp_response_timeout_tv);
|
||||
else
|
||||
event_active(session->continue_ev, 0, 0);
|
||||
}
|
||||
else if (session->request->proto == SP_PROTO_HTTP)
|
||||
{
|
||||
res.type = SP_MSG_TYPE_HTTP_RES;
|
||||
|
||||
// Using http_session ensures that Curl will use keepalive and doesn't
|
||||
// need to reconnect with every request
|
||||
ret = msg_http_send(&res.payload.hres, &msg->payload.hreq, &session->http_session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
|
||||
// Since http requests are currently sync we can handle the response right
|
||||
// away. In an async future we would need to make an incoming event and
|
||||
// have a callback func for msg_handle, like for tcp.
|
||||
ret = msg_handle(&res, session);
|
||||
msg_clear(&res);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
else if (ret == SP_OK_DATA)
|
||||
audio_data_received(session);
|
||||
else
|
||||
event_active(session->continue_ev, 0, 0);
|
||||
}
|
||||
else
|
||||
RETURN_ERROR(SP_ERR_INVALID, "Bug! Request is missing protocol type");
|
||||
|
||||
return SP_OK_DONE;
|
||||
|
||||
error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
request_make(enum sp_msg_type type, struct sp_session *session)
|
||||
static void
|
||||
sequence_continue(struct sp_session *session)
|
||||
{
|
||||
struct sp_message msg;
|
||||
struct sp_connection *conn = &session->conn;
|
||||
struct sp_conn_callbacks cb = { sp_evbase, response_cb, timeout_cb };
|
||||
struct sp_conn_callbacks cb = { sp_evbase, incoming_tcp_cb, timeout_tcp_cb };
|
||||
struct sp_message msg = { 0 };
|
||||
int ret;
|
||||
|
||||
// sp_cb.logmsg("Making request %d\n", type);
|
||||
sp_cb.logmsg("Preparing request '%s'\n", session->request->name);
|
||||
|
||||
// Make sure the connection is in a state suitable for sending this message
|
||||
ret = ap_connect(&session->conn, type, &session->cooldown_ts, session->ap_avoid, &cb, session);
|
||||
// Checks if the dependencies for making the request are met - e.g. do we have
|
||||
// a connection and a valid token. If not, tries to satisfy them.
|
||||
ret = seq_request_prepare(session->request, &cb, session);
|
||||
if (ret == SP_OK_WAIT)
|
||||
return relogin(type, session); // Can't proceed right now, the handshake needs to complete first
|
||||
sp_cb.logmsg("Sequence queued, first making request '%s'\n", session->request->name);
|
||||
else if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
|
||||
ret = msg_make(&msg, type, session);
|
||||
if (ret < 0)
|
||||
ret = msg_make(&msg, session->request, session);
|
||||
if (ret > 0)
|
||||
{
|
||||
event_active(session->continue_ev, 0, 0);
|
||||
return;
|
||||
}
|
||||
else if (ret < 0)
|
||||
RETURN_ERROR(SP_ERR_INVALID, "Error constructing message to Spotify");
|
||||
|
||||
if (msg.encrypt)
|
||||
conn->is_encrypted = true;
|
||||
|
||||
ret = msg_send(&msg, conn);
|
||||
ret = msg_send(&msg, session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
|
||||
// Only start timeout timer if a response is expected, otherwise go straight
|
||||
// to next message
|
||||
if (msg.response_handler)
|
||||
event_add(conn->timeout_ev, &sp_response_timeout_tv);
|
||||
else
|
||||
event_active(session->continue_ev, 0, 0);
|
||||
|
||||
session->msg_type_last = type;
|
||||
session->msg_type_next = msg.type_next;
|
||||
session->response_handler = msg.response_handler;
|
||||
|
||||
return 0;
|
||||
msg_clear(&msg);
|
||||
return; // Proceed in sequence_continue_cb
|
||||
|
||||
error:
|
||||
return ret;
|
||||
msg_clear(&msg);
|
||||
session_error(session, ret);
|
||||
}
|
||||
|
||||
static void
|
||||
sequence_continue_cb(int fd, short what, void *arg)
|
||||
{
|
||||
struct sp_session *session = arg;
|
||||
|
||||
// If set, we are in a sequence and should proceed to the next request
|
||||
if (session->request)
|
||||
session->request++;
|
||||
|
||||
// Starting a sequence, or ending one and should possibly start the next
|
||||
if (!session->request || !session->request->name)
|
||||
{
|
||||
session->request = seq_request_get(session->next_seq, 0, session->use_legacy);
|
||||
seq_next_set(session, SP_SEQ_STOP);
|
||||
}
|
||||
|
||||
if (session->request && session->request->name)
|
||||
sequence_continue(session);
|
||||
else
|
||||
session_return(session, SP_OK_DONE); // All done, yay!
|
||||
}
|
||||
|
||||
// All errors that may occur during a sequence are called back async
|
||||
static void
|
||||
sequence_start(enum sp_seq_type seq_type, struct sp_session *session)
|
||||
{
|
||||
session->request = NULL;
|
||||
seq_next_set(session, seq_type);
|
||||
|
||||
event_active(session->continue_ev, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -507,9 +552,7 @@ track_write(void *arg, int *retval)
|
||||
|
||||
channel_play(channel);
|
||||
|
||||
ret = request_make(MSG_TYPE_CHUNK_REQUEST, session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
sequence_start(SP_SEQ_MEDIA_GET, session);
|
||||
|
||||
channel->progress_cb = cmdargs->progress_cb;
|
||||
channel->cb_arg = cmdargs->cb_arg;
|
||||
@ -517,7 +560,7 @@ track_write(void *arg, int *retval)
|
||||
return COMMAND_END;
|
||||
|
||||
error:
|
||||
sp_cb.logmsg("Error %d: %s", ret, sp_errmsg);
|
||||
sp_cb.logmsg("Error %d: %s\n", ret, sp_errmsg);
|
||||
|
||||
return COMMAND_END;
|
||||
}
|
||||
@ -548,7 +591,7 @@ track_pause(void *arg, int *retval)
|
||||
}
|
||||
|
||||
channel_pause(channel);
|
||||
session->msg_type_next = MSG_TYPE_NONE;
|
||||
seq_next_set(session, SP_SEQ_STOP); // TODO test if this will work
|
||||
|
||||
*retval = 1;
|
||||
return COMMAND_PENDING;
|
||||
@ -580,9 +623,7 @@ track_seek(void *arg, int *retval)
|
||||
// AES decryptor to match the new position. It also flushes the pipe.
|
||||
channel_seek(channel, cmdargs->seek_pos);
|
||||
|
||||
ret = request_make(MSG_TYPE_CHUNK_REQUEST, session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
sequence_start(SP_SEQ_MEDIA_GET, session);
|
||||
|
||||
*retval = 1;
|
||||
return COMMAND_PENDING;
|
||||
@ -620,7 +661,6 @@ media_open(void *arg, int *retval)
|
||||
struct sp_cmdargs *cmdargs = arg;
|
||||
struct sp_session *session = cmdargs->session;
|
||||
struct sp_channel *channel = NULL;
|
||||
enum sp_msg_type type;
|
||||
int ret;
|
||||
|
||||
ret = session_check(session);
|
||||
@ -636,22 +676,13 @@ media_open(void *arg, int *retval)
|
||||
|
||||
cmdargs->fd_read = channel->audio_fd[0];
|
||||
|
||||
// Must be set before calling request_make() because this info is needed for
|
||||
// Must be set before calling sequence_start() because this info is needed for
|
||||
// making the request
|
||||
session->now_streaming_channel = channel;
|
||||
|
||||
if (channel->file.media_type == SP_MEDIA_TRACK)
|
||||
type = MSG_TYPE_MERCURY_TRACK_GET;
|
||||
else if (channel->file.media_type == SP_MEDIA_EPISODE)
|
||||
type = MSG_TYPE_MERCURY_EPISODE_GET;
|
||||
else
|
||||
RETURN_ERROR(SP_ERR_INVALID, "Unknown media type in Spotify path");
|
||||
|
||||
// Kicks of a sequence where we first get file info, then get the AES key and
|
||||
// then the first chunk (incl. headers)
|
||||
ret = request_make(type, session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(ret, sp_errmsg);
|
||||
sequence_start(SP_SEQ_MEDIA_OPEN, session);
|
||||
|
||||
*retval = 1;
|
||||
return COMMAND_PENDING;
|
||||
@ -685,13 +716,11 @@ login(void *arg, int *retval)
|
||||
struct sp_session *session = NULL;
|
||||
int ret;
|
||||
|
||||
ret = session_new(&session, cmdargs, continue_cb);
|
||||
ret = session_new(&session, cmdargs, sequence_continue_cb);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
ret = request_make(MSG_TYPE_CLIENT_HELLO, session);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
sequence_start(SP_SEQ_LOGIN, session);
|
||||
|
||||
cmdargs->session = session;
|
||||
|
||||
@ -736,6 +765,27 @@ logout(void *arg, int *retval)
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
static enum command_state
|
||||
legacy_set(void *arg, int *retval)
|
||||
{
|
||||
struct sp_cmdargs *cmdargs = arg;
|
||||
struct sp_session *session = cmdargs->session;
|
||||
int ret;
|
||||
|
||||
ret = session_check(session);
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(SP_ERR_NOSESSION, "Session has disappeared, cannot set legacy mode");
|
||||
|
||||
if (session->request && session->request->name)
|
||||
RETURN_ERROR(SP_ERR_INVALID, "Can't switch mode while session is active");
|
||||
|
||||
session->use_legacy = cmdargs->use_legacy;
|
||||
|
||||
error:
|
||||
*retval = ret;
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
static enum command_state
|
||||
metadata_get(void *arg, int *retval)
|
||||
{
|
||||
@ -749,7 +799,7 @@ metadata_get(void *arg, int *retval)
|
||||
RETURN_ERROR(SP_ERR_NOSESSION, "Session has disappeared, cannot get metadata");
|
||||
|
||||
memset(metadata, 0, sizeof(struct sp_metadata));
|
||||
metadata->file_len = 4 * session->now_streaming_channel->file.len_words - SP_OGG_HEADER_LEN;;
|
||||
metadata->file_len = session->now_streaming_channel->file.len_bytes - SP_OGG_HEADER_LEN;;
|
||||
|
||||
error:
|
||||
*retval = ret;
|
||||
@ -909,6 +959,17 @@ librespotc_logout(struct sp_session *session)
|
||||
return commands_exec_sync(sp_cmdbase, logout, NULL, &cmdargs);
|
||||
}
|
||||
|
||||
int
|
||||
librespotc_legacy_set(struct sp_session *session, int use_legacy)
|
||||
{
|
||||
struct sp_cmdargs cmdargs = { 0 };
|
||||
|
||||
cmdargs.session = session;
|
||||
cmdargs.use_legacy = use_legacy;
|
||||
|
||||
return commands_exec_sync(sp_cmdbase, legacy_set, NULL, &cmdargs);
|
||||
}
|
||||
|
||||
int
|
||||
librespotc_metadata_get(struct sp_metadata *metadata, int fd)
|
||||
{
|
||||
@ -953,11 +1014,11 @@ system_info_set(struct sp_sysinfo *si_out, struct sp_sysinfo *si_user)
|
||||
{
|
||||
memcpy(si_out, si_user, sizeof(struct sp_sysinfo));
|
||||
|
||||
if (si_out->client_name[9] == '\0')
|
||||
if (si_out->client_name[0] == '\0')
|
||||
snprintf(si_out->client_name, sizeof(si_out->client_name), SP_CLIENT_NAME_DEFAULT);
|
||||
if (si_out->client_version[9] == '\0')
|
||||
if (si_out->client_version[0] == '\0')
|
||||
snprintf(si_out->client_version, sizeof(si_out->client_version), SP_CLIENT_VERSION_DEFAULT);
|
||||
if (si_out->client_build_id[9] == '\0')
|
||||
if (si_out->client_build_id[0] == '\0')
|
||||
snprintf(si_out->client_build_id, sizeof(si_out->client_build_id), SP_CLIENT_BUILD_ID_DEFAULT);
|
||||
}
|
||||
|
||||
@ -969,6 +1030,10 @@ librespotc_init(struct sp_sysinfo *sysinfo, struct sp_callbacks *callbacks)
|
||||
if (sp_initialized)
|
||||
RETURN_ERROR(SP_ERR_INVALID, "librespot-c already initialized");
|
||||
|
||||
ret = seq_requests_check();
|
||||
if (ret < 0)
|
||||
RETURN_ERROR(SP_ERR_INVALID, "Bug! Misalignment between enum seq_type and seq_requests");
|
||||
|
||||
sp_cb = *callbacks;
|
||||
sp_initialized = true;
|
||||
|
||||
|
@ -1,51 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message Rule {
|
||||
optional string type = 0x1;
|
||||
optional uint32 times = 0x2;
|
||||
optional uint64 interval = 0x3;
|
||||
}
|
||||
|
||||
message AdRequest {
|
||||
optional string client_language = 0x1;
|
||||
optional string product = 0x2;
|
||||
optional uint32 version = 0x3;
|
||||
optional string type = 0x4;
|
||||
repeated string avoidAds = 0x5;
|
||||
}
|
||||
|
||||
message AdQueueResponse {
|
||||
repeated AdQueueEntry adQueueEntry = 0x1;
|
||||
}
|
||||
|
||||
message AdFile {
|
||||
optional string id = 0x1;
|
||||
optional string format = 0x2;
|
||||
}
|
||||
|
||||
message AdQueueEntry {
|
||||
optional uint64 start_time = 0x1;
|
||||
optional uint64 end_time = 0x2;
|
||||
optional double priority = 0x3;
|
||||
optional string token = 0x4;
|
||||
optional uint32 ad_version = 0x5;
|
||||
optional string id = 0x6;
|
||||
optional string type = 0x7;
|
||||
optional string campaign = 0x8;
|
||||
optional string advertiser = 0x9;
|
||||
optional string url = 0xa;
|
||||
optional uint64 duration = 0xb;
|
||||
optional uint64 expiry = 0xc;
|
||||
optional string tracking_url = 0xd;
|
||||
optional string banner_type = 0xe;
|
||||
optional string html = 0xf;
|
||||
optional string image = 0x10;
|
||||
optional string background_image = 0x11;
|
||||
optional string background_url = 0x12;
|
||||
optional string background_color = 0x13;
|
||||
optional string title = 0x14;
|
||||
optional string caption = 0x15;
|
||||
repeated AdFile file = 0x16;
|
||||
repeated Rule rule = 0x17;
|
||||
}
|
||||
|
@ -1,95 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message AppInfo {
|
||||
optional string identifier = 0x1;
|
||||
optional int32 version_int = 0x2;
|
||||
}
|
||||
|
||||
message AppInfoList {
|
||||
repeated AppInfo items = 0x1;
|
||||
}
|
||||
|
||||
message SemanticVersion {
|
||||
optional int32 major = 0x1;
|
||||
optional int32 minor = 0x2;
|
||||
optional int32 patch = 0x3;
|
||||
}
|
||||
|
||||
message RequestHeader {
|
||||
optional string market = 0x1;
|
||||
optional Platform platform = 0x2;
|
||||
enum Platform {
|
||||
WIN32_X86 = 0x0;
|
||||
OSX_X86 = 0x1;
|
||||
LINUX_X86 = 0x2;
|
||||
IPHONE_ARM = 0x3;
|
||||
SYMBIANS60_ARM = 0x4;
|
||||
OSX_POWERPC = 0x5;
|
||||
ANDROID_ARM = 0x6;
|
||||
WINCE_ARM = 0x7;
|
||||
LINUX_X86_64 = 0x8;
|
||||
OSX_X86_64 = 0x9;
|
||||
PALM_ARM = 0xa;
|
||||
LINUX_SH = 0xb;
|
||||
FREEBSD_X86 = 0xc;
|
||||
FREEBSD_X86_64 = 0xd;
|
||||
BLACKBERRY_ARM = 0xe;
|
||||
SONOS_UNKNOWN = 0xf;
|
||||
LINUX_MIPS = 0x10;
|
||||
LINUX_ARM = 0x11;
|
||||
LOGITECH_ARM = 0x12;
|
||||
LINUX_BLACKFIN = 0x13;
|
||||
ONKYO_ARM = 0x15;
|
||||
QNXNTO_ARM = 0x16;
|
||||
BADPLATFORM = 0xff;
|
||||
}
|
||||
optional AppInfoList app_infos = 0x6;
|
||||
optional string bridge_identifier = 0x7;
|
||||
optional SemanticVersion bridge_version = 0x8;
|
||||
optional DeviceClass device_class = 0x9;
|
||||
enum DeviceClass {
|
||||
DESKTOP = 0x1;
|
||||
TABLET = 0x2;
|
||||
MOBILE = 0x3;
|
||||
WEB = 0x4;
|
||||
TV = 0x5;
|
||||
}
|
||||
}
|
||||
|
||||
message AppItem {
|
||||
optional string identifier = 0x1;
|
||||
optional Requirement requirement = 0x2;
|
||||
enum Requirement {
|
||||
REQUIRED_INSTALL = 0x1;
|
||||
LAZYLOAD = 0x2;
|
||||
OPTIONAL_INSTALL = 0x3;
|
||||
}
|
||||
optional string manifest = 0x4;
|
||||
optional string checksum = 0x5;
|
||||
optional string bundle_uri = 0x6;
|
||||
optional string small_icon_uri = 0x7;
|
||||
optional string large_icon_uri = 0x8;
|
||||
optional string medium_icon_uri = 0x9;
|
||||
optional Type bundle_type = 0xa;
|
||||
enum Type {
|
||||
APPLICATION = 0x0;
|
||||
FRAMEWORK = 0x1;
|
||||
BRIDGE = 0x2;
|
||||
}
|
||||
optional SemanticVersion version = 0xb;
|
||||
optional uint32 ttl_in_seconds = 0xc;
|
||||
optional IdentifierList categories = 0xd;
|
||||
}
|
||||
|
||||
message AppList {
|
||||
repeated AppItem items = 0x1;
|
||||
}
|
||||
|
||||
message IdentifierList {
|
||||
repeated string identifiers = 0x1;
|
||||
}
|
||||
|
||||
message BannerConfig {
|
||||
optional string json = 0x1;
|
||||
}
|
||||
|
1676
src/inputs/librespot-c/src/proto/clienttoken.pb-c.c
Normal file
1676
src/inputs/librespot-c/src/proto/clienttoken.pb-c.c
Normal file
File diff suppressed because it is too large
Load Diff
678
src/inputs/librespot-c/src/proto/clienttoken.pb-c.h
Normal file
678
src/inputs/librespot-c/src/proto/clienttoken.pb-c.h
Normal file
@ -0,0 +1,678 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: clienttoken.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_clienttoken_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_clienttoken_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
#include "connectivity.pb-c.h"
|
||||
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ClientTokenRequest Spotify__Clienttoken__Http__V0__ClientTokenRequest;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ClientDataRequest Spotify__Clienttoken__Http__V0__ClientDataRequest;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ClientTokenResponse Spotify__Clienttoken__Http__V0__ClientTokenResponse;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__TokenDomain Spotify__Clienttoken__Http__V0__TokenDomain;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__GrantedTokenResponse Spotify__Clienttoken__Http__V0__GrantedTokenResponse;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ChallengesResponse Spotify__Clienttoken__Http__V0__ChallengesResponse;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ClientSecretParameters Spotify__Clienttoken__Http__V0__ClientSecretParameters;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__EvaluateJSParameters Spotify__Clienttoken__Http__V0__EvaluateJSParameters;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__HashCashParameters Spotify__Clienttoken__Http__V0__HashCashParameters;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__Challenge Spotify__Clienttoken__Http__V0__Challenge;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__EvaluateJSAnswer Spotify__Clienttoken__Http__V0__EvaluateJSAnswer;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__HashCashAnswer Spotify__Clienttoken__Http__V0__HashCashAnswer;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ChallengeAnswer Spotify__Clienttoken__Http__V0__ChallengeAnswer;
|
||||
typedef struct Spotify__Clienttoken__Http__V0__ClientTokenBadRequest Spotify__Clienttoken__Http__V0__ClientTokenBadRequest;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
typedef enum _Spotify__Clienttoken__Http__V0__ClientTokenRequestType {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST_TYPE__REQUEST_UNKNOWN = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST_TYPE__REQUEST_CLIENT_DATA_REQUEST = 1,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST_TYPE__REQUEST_CHALLENGE_ANSWERS_REQUEST = 2
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST_TYPE)
|
||||
} Spotify__Clienttoken__Http__V0__ClientTokenRequestType;
|
||||
typedef enum _Spotify__Clienttoken__Http__V0__ClientTokenResponseType {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE_TYPE__RESPONSE_UNKNOWN = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE_TYPE__RESPONSE_GRANTED_TOKEN_RESPONSE = 1,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE_TYPE__RESPONSE_CHALLENGES_RESPONSE = 2
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE_TYPE)
|
||||
} Spotify__Clienttoken__Http__V0__ClientTokenResponseType;
|
||||
typedef enum _Spotify__Clienttoken__Http__V0__ChallengeType {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE__CHALLENGE_UNKNOWN = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE__CHALLENGE_CLIENT_SECRET_HMAC = 1,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE__CHALLENGE_EVALUATE_JS = 2,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE__CHALLENGE_HASH_CASH = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE)
|
||||
} Spotify__Clienttoken__Http__V0__ChallengeType;
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST__REQUEST__NOT_SET = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST__REQUEST_CLIENT_DATA = 2,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST__REQUEST_CHALLENGE_ANSWERS = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST__REQUEST__CASE)
|
||||
} Spotify__Clienttoken__Http__V0__ClientTokenRequest__RequestCase;
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ClientTokenRequest
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenRequestType request_type;
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenRequest__RequestCase request_case;
|
||||
union {
|
||||
Spotify__Clienttoken__Http__V0__ClientDataRequest *client_data;
|
||||
Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *challenge_answers;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__client_token_request__descriptor) \
|
||||
, SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST_TYPE__REQUEST_UNKNOWN, SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_REQUEST__REQUEST__NOT_SET, {0} }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_DATA_REQUEST__DATA__NOT_SET = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_DATA_REQUEST__DATA_CONNECTIVITY_SDK_DATA = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_DATA_REQUEST__DATA__CASE)
|
||||
} Spotify__Clienttoken__Http__V0__ClientDataRequest__DataCase;
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ClientDataRequest
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *client_version;
|
||||
char *client_id;
|
||||
Spotify__Clienttoken__Http__V0__ClientDataRequest__DataCase data_case;
|
||||
union {
|
||||
Spotify__Clienttoken__Data__V0__ConnectivitySdkData *connectivity_sdk_data;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_DATA_REQUEST__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__client_data_request__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_DATA_REQUEST__DATA__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *state;
|
||||
size_t n_answers;
|
||||
Spotify__Clienttoken__Http__V0__ChallengeAnswer **answers;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWERS_REQUEST__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__challenge_answers_request__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, 0,NULL }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE__RESPONSE__NOT_SET = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE__RESPONSE_GRANTED_TOKEN = 2,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE__RESPONSE_CHALLENGES = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE__RESPONSE__CASE)
|
||||
} Spotify__Clienttoken__Http__V0__ClientTokenResponse__ResponseCase;
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ClientTokenResponse
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenResponseType response_type;
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenResponse__ResponseCase response_case;
|
||||
union {
|
||||
Spotify__Clienttoken__Http__V0__GrantedTokenResponse *granted_token;
|
||||
Spotify__Clienttoken__Http__V0__ChallengesResponse *challenges;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__client_token_response__descriptor) \
|
||||
, SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE_TYPE__RESPONSE_UNKNOWN, SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_RESPONSE__RESPONSE__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__TokenDomain
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *domain;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__TOKEN_DOMAIN__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__token_domain__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__GrantedTokenResponse
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *token;
|
||||
int32_t expires_after_seconds;
|
||||
int32_t refresh_after_seconds;
|
||||
size_t n_domains;
|
||||
Spotify__Clienttoken__Http__V0__TokenDomain **domains;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__GRANTED_TOKEN_RESPONSE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__granted_token_response__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, 0, 0, 0,NULL }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ChallengesResponse
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *state;
|
||||
size_t n_challenges;
|
||||
Spotify__Clienttoken__Http__V0__Challenge **challenges;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGES_RESPONSE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__challenges_response__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, 0,NULL }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ClientSecretParameters
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *salt;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_SECRET_PARAMETERS__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__client_secret_parameters__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__EvaluateJSParameters
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *code;
|
||||
size_t n_libraries;
|
||||
char **libraries;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__EVALUATE_JSPARAMETERS__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__evaluate_jsparameters__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, 0,NULL }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__HashCashParameters
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
int32_t length;
|
||||
char *prefix;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__HASH_CASH_PARAMETERS__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__hash_cash_parameters__descriptor) \
|
||||
, 0, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__PARAMETERS__NOT_SET = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__PARAMETERS_CLIENT_SECRET_PARAMETERS = 2,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__PARAMETERS_EVALUATE_JS_PARAMETERS = 3,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__PARAMETERS_EVALUATE_HASHCASH_PARAMETERS = 4
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__PARAMETERS__CASE)
|
||||
} Spotify__Clienttoken__Http__V0__Challenge__ParametersCase;
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__Challenge
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Http__V0__ChallengeType type;
|
||||
Spotify__Clienttoken__Http__V0__Challenge__ParametersCase parameters_case;
|
||||
union {
|
||||
Spotify__Clienttoken__Http__V0__ClientSecretParameters *client_secret_parameters;
|
||||
Spotify__Clienttoken__Http__V0__EvaluateJSParameters *evaluate_js_parameters;
|
||||
Spotify__Clienttoken__Http__V0__HashCashParameters *evaluate_hashcash_parameters;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__challenge__descriptor) \
|
||||
, SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE__CHALLENGE_UNKNOWN, SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE__PARAMETERS__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *hmac;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_SECRET_HMACANSWER__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__client_secret_hmacanswer__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__EvaluateJSAnswer
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *result;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__EVALUATE_JSANSWER__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__evaluate_jsanswer__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__HashCashAnswer
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *suffix;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__HASH_CASH_ANSWER__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__hash_cash_answer__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__ANSWER__NOT_SET = 0,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__ANSWER_CLIENT_SECRET = 2,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__ANSWER_EVALUATE_JS = 3,
|
||||
SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__ANSWER_HASH_CASH = 4
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__ANSWER__CASE)
|
||||
} Spotify__Clienttoken__Http__V0__ChallengeAnswer__AnswerCase;
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ChallengeAnswer
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Http__V0__ChallengeType challengetype;
|
||||
Spotify__Clienttoken__Http__V0__ChallengeAnswer__AnswerCase answer_case;
|
||||
union {
|
||||
Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *client_secret;
|
||||
Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *evaluate_js;
|
||||
Spotify__Clienttoken__Http__V0__HashCashAnswer *hash_cash;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__challenge_answer__descriptor) \
|
||||
, SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_TYPE__CHALLENGE_UNKNOWN, SPOTIFY__CLIENTTOKEN__HTTP__V0__CHALLENGE_ANSWER__ANSWER__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Http__V0__ClientTokenBadRequest
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *message;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__HTTP__V0__CLIENT_TOKEN_BAD_REQUEST__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__http__v0__client_token_bad_request__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
/* Spotify__Clienttoken__Http__V0__ClientTokenRequest methods */
|
||||
void spotify__clienttoken__http__v0__client_token_request__init
|
||||
(Spotify__Clienttoken__Http__V0__ClientTokenRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__client_token_request__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__client_token_request__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenRequest *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__client_token_request__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenRequest *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenRequest *
|
||||
spotify__clienttoken__http__v0__client_token_request__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__client_token_request__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ClientTokenRequest *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ClientDataRequest methods */
|
||||
void spotify__clienttoken__http__v0__client_data_request__init
|
||||
(Spotify__Clienttoken__Http__V0__ClientDataRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__client_data_request__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ClientDataRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__client_data_request__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ClientDataRequest *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__client_data_request__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ClientDataRequest *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ClientDataRequest *
|
||||
spotify__clienttoken__http__v0__client_data_request__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__client_data_request__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ClientDataRequest *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest methods */
|
||||
void spotify__clienttoken__http__v0__challenge_answers_request__init
|
||||
(Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__challenge_answers_request__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__challenge_answers_request__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__challenge_answers_request__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *
|
||||
spotify__clienttoken__http__v0__challenge_answers_request__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__challenge_answers_request__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ClientTokenResponse methods */
|
||||
void spotify__clienttoken__http__v0__client_token_response__init
|
||||
(Spotify__Clienttoken__Http__V0__ClientTokenResponse *message);
|
||||
size_t spotify__clienttoken__http__v0__client_token_response__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenResponse *message);
|
||||
size_t spotify__clienttoken__http__v0__client_token_response__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenResponse *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__client_token_response__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenResponse *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenResponse *
|
||||
spotify__clienttoken__http__v0__client_token_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__client_token_response__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ClientTokenResponse *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__TokenDomain methods */
|
||||
void spotify__clienttoken__http__v0__token_domain__init
|
||||
(Spotify__Clienttoken__Http__V0__TokenDomain *message);
|
||||
size_t spotify__clienttoken__http__v0__token_domain__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__TokenDomain *message);
|
||||
size_t spotify__clienttoken__http__v0__token_domain__pack
|
||||
(const Spotify__Clienttoken__Http__V0__TokenDomain *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__token_domain__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__TokenDomain *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__TokenDomain *
|
||||
spotify__clienttoken__http__v0__token_domain__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__token_domain__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__TokenDomain *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__GrantedTokenResponse methods */
|
||||
void spotify__clienttoken__http__v0__granted_token_response__init
|
||||
(Spotify__Clienttoken__Http__V0__GrantedTokenResponse *message);
|
||||
size_t spotify__clienttoken__http__v0__granted_token_response__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__GrantedTokenResponse *message);
|
||||
size_t spotify__clienttoken__http__v0__granted_token_response__pack
|
||||
(const Spotify__Clienttoken__Http__V0__GrantedTokenResponse *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__granted_token_response__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__GrantedTokenResponse *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__GrantedTokenResponse *
|
||||
spotify__clienttoken__http__v0__granted_token_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__granted_token_response__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__GrantedTokenResponse *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ChallengesResponse methods */
|
||||
void spotify__clienttoken__http__v0__challenges_response__init
|
||||
(Spotify__Clienttoken__Http__V0__ChallengesResponse *message);
|
||||
size_t spotify__clienttoken__http__v0__challenges_response__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengesResponse *message);
|
||||
size_t spotify__clienttoken__http__v0__challenges_response__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengesResponse *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__challenges_response__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengesResponse *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ChallengesResponse *
|
||||
spotify__clienttoken__http__v0__challenges_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__challenges_response__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ChallengesResponse *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ClientSecretParameters methods */
|
||||
void spotify__clienttoken__http__v0__client_secret_parameters__init
|
||||
(Spotify__Clienttoken__Http__V0__ClientSecretParameters *message);
|
||||
size_t spotify__clienttoken__http__v0__client_secret_parameters__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretParameters *message);
|
||||
size_t spotify__clienttoken__http__v0__client_secret_parameters__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretParameters *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__client_secret_parameters__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretParameters *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ClientSecretParameters *
|
||||
spotify__clienttoken__http__v0__client_secret_parameters__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__client_secret_parameters__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ClientSecretParameters *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__EvaluateJSParameters methods */
|
||||
void spotify__clienttoken__http__v0__evaluate_jsparameters__init
|
||||
(Spotify__Clienttoken__Http__V0__EvaluateJSParameters *message);
|
||||
size_t spotify__clienttoken__http__v0__evaluate_jsparameters__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSParameters *message);
|
||||
size_t spotify__clienttoken__http__v0__evaluate_jsparameters__pack
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSParameters *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__evaluate_jsparameters__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSParameters *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__EvaluateJSParameters *
|
||||
spotify__clienttoken__http__v0__evaluate_jsparameters__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__evaluate_jsparameters__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__EvaluateJSParameters *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__HashCashParameters methods */
|
||||
void spotify__clienttoken__http__v0__hash_cash_parameters__init
|
||||
(Spotify__Clienttoken__Http__V0__HashCashParameters *message);
|
||||
size_t spotify__clienttoken__http__v0__hash_cash_parameters__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashParameters *message);
|
||||
size_t spotify__clienttoken__http__v0__hash_cash_parameters__pack
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashParameters *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__hash_cash_parameters__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashParameters *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__HashCashParameters *
|
||||
spotify__clienttoken__http__v0__hash_cash_parameters__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__hash_cash_parameters__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__HashCashParameters *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__Challenge methods */
|
||||
void spotify__clienttoken__http__v0__challenge__init
|
||||
(Spotify__Clienttoken__Http__V0__Challenge *message);
|
||||
size_t spotify__clienttoken__http__v0__challenge__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__Challenge *message);
|
||||
size_t spotify__clienttoken__http__v0__challenge__pack
|
||||
(const Spotify__Clienttoken__Http__V0__Challenge *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__challenge__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__Challenge *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__Challenge *
|
||||
spotify__clienttoken__http__v0__challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__challenge__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__Challenge *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer methods */
|
||||
void spotify__clienttoken__http__v0__client_secret_hmacanswer__init
|
||||
(Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__client_secret_hmacanswer__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__client_secret_hmacanswer__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__client_secret_hmacanswer__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *
|
||||
spotify__clienttoken__http__v0__client_secret_hmacanswer__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__client_secret_hmacanswer__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__EvaluateJSAnswer methods */
|
||||
void spotify__clienttoken__http__v0__evaluate_jsanswer__init
|
||||
(Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__evaluate_jsanswer__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__evaluate_jsanswer__pack
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__evaluate_jsanswer__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *
|
||||
spotify__clienttoken__http__v0__evaluate_jsanswer__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__evaluate_jsanswer__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__HashCashAnswer methods */
|
||||
void spotify__clienttoken__http__v0__hash_cash_answer__init
|
||||
(Spotify__Clienttoken__Http__V0__HashCashAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__hash_cash_answer__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__hash_cash_answer__pack
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashAnswer *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__hash_cash_answer__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashAnswer *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__HashCashAnswer *
|
||||
spotify__clienttoken__http__v0__hash_cash_answer__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__hash_cash_answer__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__HashCashAnswer *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ChallengeAnswer methods */
|
||||
void spotify__clienttoken__http__v0__challenge_answer__init
|
||||
(Spotify__Clienttoken__Http__V0__ChallengeAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__challenge_answer__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswer *message);
|
||||
size_t spotify__clienttoken__http__v0__challenge_answer__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswer *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__challenge_answer__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswer *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ChallengeAnswer *
|
||||
spotify__clienttoken__http__v0__challenge_answer__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__challenge_answer__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ChallengeAnswer *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Http__V0__ClientTokenBadRequest methods */
|
||||
void spotify__clienttoken__http__v0__client_token_bad_request__init
|
||||
(Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__client_token_bad_request__get_packed_size
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *message);
|
||||
size_t spotify__clienttoken__http__v0__client_token_bad_request__pack
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__http__v0__client_token_bad_request__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *
|
||||
spotify__clienttoken__http__v0__client_token_bad_request__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__http__v0__client_token_bad_request__free_unpacked
|
||||
(Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ClientTokenRequest_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenRequest *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ClientDataRequest_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ClientDataRequest *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswersRequest *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ClientTokenResponse_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenResponse *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__TokenDomain_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__TokenDomain *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__GrantedTokenResponse_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__GrantedTokenResponse *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ChallengesResponse_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengesResponse *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ClientSecretParameters_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretParameters *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__EvaluateJSParameters_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSParameters *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__HashCashParameters_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashParameters *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__Challenge_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__Challenge *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ClientSecretHMACAnswer *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__EvaluateJSAnswer_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__EvaluateJSAnswer *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__HashCashAnswer_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__HashCashAnswer *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ChallengeAnswer_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ChallengeAnswer *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Http__V0__ClientTokenBadRequest_Closure)
|
||||
(const Spotify__Clienttoken__Http__V0__ClientTokenBadRequest *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCEnumDescriptor spotify__clienttoken__http__v0__client_token_request_type__descriptor;
|
||||
extern const ProtobufCEnumDescriptor spotify__clienttoken__http__v0__client_token_response_type__descriptor;
|
||||
extern const ProtobufCEnumDescriptor spotify__clienttoken__http__v0__challenge_type__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__client_token_request__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__client_data_request__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__challenge_answers_request__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__client_token_response__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__token_domain__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__granted_token_response__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__challenges_response__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__client_secret_parameters__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__evaluate_jsparameters__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__hash_cash_parameters__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__challenge__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__client_secret_hmacanswer__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__evaluate_jsanswer__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__hash_cash_answer__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__challenge_answer__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__http__v0__client_token_bad_request__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_clienttoken_2eproto__INCLUDED */
|
122
src/inputs/librespot-c/src/proto/clienttoken.proto
Normal file
122
src/inputs/librespot-c/src/proto/clienttoken.proto
Normal file
@ -0,0 +1,122 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.clienttoken.http.v0;
|
||||
|
||||
import "connectivity.proto";
|
||||
|
||||
message ClientTokenRequest {
|
||||
ClientTokenRequestType request_type = 1;
|
||||
|
||||
oneof request {
|
||||
ClientDataRequest client_data = 2;
|
||||
ChallengeAnswersRequest challenge_answers = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message ClientDataRequest {
|
||||
string client_version = 1;
|
||||
string client_id = 2;
|
||||
|
||||
oneof data {
|
||||
spotify.clienttoken.data.v0.ConnectivitySdkData connectivity_sdk_data = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message ChallengeAnswersRequest {
|
||||
string state = 1;
|
||||
repeated ChallengeAnswer answers = 2;
|
||||
}
|
||||
|
||||
message ClientTokenResponse {
|
||||
ClientTokenResponseType response_type = 1;
|
||||
|
||||
oneof response {
|
||||
GrantedTokenResponse granted_token = 2;
|
||||
ChallengesResponse challenges = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message TokenDomain {
|
||||
string domain = 1;
|
||||
}
|
||||
|
||||
message GrantedTokenResponse {
|
||||
string token = 1;
|
||||
int32 expires_after_seconds = 2;
|
||||
int32 refresh_after_seconds = 3;
|
||||
repeated TokenDomain domains = 4;
|
||||
}
|
||||
|
||||
message ChallengesResponse {
|
||||
string state = 1;
|
||||
repeated Challenge challenges = 2;
|
||||
}
|
||||
|
||||
message ClientSecretParameters {
|
||||
string salt = 1;
|
||||
}
|
||||
|
||||
message EvaluateJSParameters {
|
||||
string code = 1;
|
||||
repeated string libraries = 2;
|
||||
}
|
||||
|
||||
message HashCashParameters {
|
||||
int32 length = 1;
|
||||
string prefix = 2;
|
||||
}
|
||||
|
||||
message Challenge {
|
||||
ChallengeType type = 1;
|
||||
|
||||
oneof parameters {
|
||||
ClientSecretParameters client_secret_parameters = 2;
|
||||
EvaluateJSParameters evaluate_js_parameters = 3;
|
||||
HashCashParameters evaluate_hashcash_parameters = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message ClientSecretHMACAnswer {
|
||||
string hmac = 1;
|
||||
}
|
||||
|
||||
message EvaluateJSAnswer {
|
||||
string result = 1;
|
||||
}
|
||||
|
||||
message HashCashAnswer {
|
||||
string suffix = 1;
|
||||
}
|
||||
|
||||
message ChallengeAnswer {
|
||||
ChallengeType ChallengeType = 1;
|
||||
|
||||
oneof answer {
|
||||
ClientSecretHMACAnswer client_secret = 2;
|
||||
EvaluateJSAnswer evaluate_js = 3;
|
||||
HashCashAnswer hash_cash = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message ClientTokenBadRequest {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
enum ClientTokenRequestType {
|
||||
REQUEST_UNKNOWN = 0;
|
||||
REQUEST_CLIENT_DATA_REQUEST = 1;
|
||||
REQUEST_CHALLENGE_ANSWERS_REQUEST = 2;
|
||||
}
|
||||
|
||||
enum ClientTokenResponseType {
|
||||
RESPONSE_UNKNOWN = 0;
|
||||
RESPONSE_GRANTED_TOKEN_RESPONSE = 1;
|
||||
RESPONSE_CHALLENGES_RESPONSE = 2;
|
||||
}
|
||||
|
||||
enum ChallengeType {
|
||||
CHALLENGE_UNKNOWN = 0;
|
||||
CHALLENGE_CLIENT_SECRET_HMAC = 1;
|
||||
CHALLENGE_EVALUATE_JS = 2;
|
||||
CHALLENGE_HASH_CASH = 3;
|
||||
}
|
1091
src/inputs/librespot-c/src/proto/connectivity.pb-c.c
Normal file
1091
src/inputs/librespot-c/src/proto/connectivity.pb-c.c
Normal file
File diff suppressed because it is too large
Load Diff
378
src/inputs/librespot-c/src/proto/connectivity.pb-c.h
Normal file
378
src/inputs/librespot-c/src/proto/connectivity.pb-c.h
Normal file
@ -0,0 +1,378 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: connectivity.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_connectivity_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_connectivity_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Clienttoken__Data__V0__ConnectivitySdkData Spotify__Clienttoken__Data__V0__ConnectivitySdkData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__PlatformSpecificData Spotify__Clienttoken__Data__V0__PlatformSpecificData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__NativeAndroidData Spotify__Clienttoken__Data__V0__NativeAndroidData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__NativeIOSData Spotify__Clienttoken__Data__V0__NativeIOSData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData;
|
||||
typedef struct Spotify__Clienttoken__Data__V0__Screen Spotify__Clienttoken__Data__V0__Screen;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__ConnectivitySdkData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Data__V0__PlatformSpecificData *platform_specific_data;
|
||||
char *device_id;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__CONNECTIVITY_SDK_DATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__connectivity_sdk_data__descriptor) \
|
||||
, NULL, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA__NOT_SET = 0,
|
||||
SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA_ANDROID = 1,
|
||||
SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA_IOS = 2,
|
||||
SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA_DESKTOP_MACOS = 3,
|
||||
SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA_DESKTOP_WINDOWS = 4,
|
||||
SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA_DESKTOP_LINUX = 5
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA__CASE)
|
||||
} Spotify__Clienttoken__Data__V0__PlatformSpecificData__DataCase;
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__PlatformSpecificData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Data__V0__PlatformSpecificData__DataCase data_case;
|
||||
union {
|
||||
Spotify__Clienttoken__Data__V0__NativeAndroidData *android;
|
||||
Spotify__Clienttoken__Data__V0__NativeIOSData *ios;
|
||||
Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *desktop_macos;
|
||||
Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *desktop_windows;
|
||||
Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *desktop_linux;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__platform_specific_data__descriptor) \
|
||||
, SPOTIFY__CLIENTTOKEN__DATA__V0__PLATFORM_SPECIFIC_DATA__DATA__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__NativeAndroidData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Clienttoken__Data__V0__Screen *screen_dimensions;
|
||||
char *android_version;
|
||||
int32_t api_version;
|
||||
char *device_name;
|
||||
char *model_str;
|
||||
char *vendor;
|
||||
char *vendor_2;
|
||||
int32_t unknown_value_8;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__NATIVE_ANDROID_DATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__native_android_data__descriptor) \
|
||||
, NULL, (char *)protobuf_c_empty_string, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0 }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__NativeIOSData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
/*
|
||||
* https://developer.apple.com/documentation/uikit/uiuserinterfaceidiom
|
||||
*/
|
||||
int32_t user_interface_idiom;
|
||||
protobuf_c_boolean target_iphone_simulator;
|
||||
char *hw_machine;
|
||||
char *system_version;
|
||||
char *simulator_model_identifier;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__NATIVE_IOSDATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__native_iosdata__descriptor) \
|
||||
, 0, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
int32_t os_version;
|
||||
int32_t os_build;
|
||||
/*
|
||||
* https://docs.microsoft.com/en-us/dotnet/api/system.platformid?view=net-6.0
|
||||
*/
|
||||
int32_t platform_id;
|
||||
int32_t unknown_value_5;
|
||||
int32_t unknown_value_6;
|
||||
/*
|
||||
* https://docs.microsoft.com/en-us/dotnet/api/system.reflection.imagefilemachine?view=net-6.0
|
||||
*/
|
||||
int32_t image_file_machine;
|
||||
/*
|
||||
* https://docs.microsoft.com/en-us/dotnet/api/system.reflection.portableexecutable.machine?view=net-6.0
|
||||
*/
|
||||
int32_t pe_machine;
|
||||
protobuf_c_boolean unknown_value_10;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__NATIVE_DESKTOP_WINDOWS_DATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__native_desktop_windows_data__descriptor) \
|
||||
, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
/*
|
||||
* uname -s
|
||||
*/
|
||||
char *system_name;
|
||||
/*
|
||||
* -r
|
||||
*/
|
||||
char *system_release;
|
||||
/*
|
||||
* -v
|
||||
*/
|
||||
char *system_version;
|
||||
/*
|
||||
* -i
|
||||
*/
|
||||
char *hardware;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__NATIVE_DESKTOP_LINUX_DATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__native_desktop_linux_data__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *system_version;
|
||||
char *hw_model;
|
||||
char *compiled_cpu_type;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__NATIVE_DESKTOP_MAC_OSDATA__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__native_desktop_mac_osdata__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Clienttoken__Data__V0__Screen
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
int32_t density;
|
||||
int32_t unknown_value_4;
|
||||
int32_t unknown_value_5;
|
||||
};
|
||||
#define SPOTIFY__CLIENTTOKEN__DATA__V0__SCREEN__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__clienttoken__data__v0__screen__descriptor) \
|
||||
, 0, 0, 0, 0, 0 }
|
||||
|
||||
|
||||
/* Spotify__Clienttoken__Data__V0__ConnectivitySdkData methods */
|
||||
void spotify__clienttoken__data__v0__connectivity_sdk_data__init
|
||||
(Spotify__Clienttoken__Data__V0__ConnectivitySdkData *message);
|
||||
size_t spotify__clienttoken__data__v0__connectivity_sdk_data__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__ConnectivitySdkData *message);
|
||||
size_t spotify__clienttoken__data__v0__connectivity_sdk_data__pack
|
||||
(const Spotify__Clienttoken__Data__V0__ConnectivitySdkData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__connectivity_sdk_data__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__ConnectivitySdkData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__ConnectivitySdkData *
|
||||
spotify__clienttoken__data__v0__connectivity_sdk_data__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__connectivity_sdk_data__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__ConnectivitySdkData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__PlatformSpecificData methods */
|
||||
void spotify__clienttoken__data__v0__platform_specific_data__init
|
||||
(Spotify__Clienttoken__Data__V0__PlatformSpecificData *message);
|
||||
size_t spotify__clienttoken__data__v0__platform_specific_data__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__PlatformSpecificData *message);
|
||||
size_t spotify__clienttoken__data__v0__platform_specific_data__pack
|
||||
(const Spotify__Clienttoken__Data__V0__PlatformSpecificData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__platform_specific_data__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__PlatformSpecificData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__PlatformSpecificData *
|
||||
spotify__clienttoken__data__v0__platform_specific_data__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__platform_specific_data__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__PlatformSpecificData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__NativeAndroidData methods */
|
||||
void spotify__clienttoken__data__v0__native_android_data__init
|
||||
(Spotify__Clienttoken__Data__V0__NativeAndroidData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_android_data__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__NativeAndroidData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_android_data__pack
|
||||
(const Spotify__Clienttoken__Data__V0__NativeAndroidData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__native_android_data__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__NativeAndroidData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__NativeAndroidData *
|
||||
spotify__clienttoken__data__v0__native_android_data__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__native_android_data__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__NativeAndroidData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__NativeIOSData methods */
|
||||
void spotify__clienttoken__data__v0__native_iosdata__init
|
||||
(Spotify__Clienttoken__Data__V0__NativeIOSData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_iosdata__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__NativeIOSData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_iosdata__pack
|
||||
(const Spotify__Clienttoken__Data__V0__NativeIOSData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__native_iosdata__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__NativeIOSData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__NativeIOSData *
|
||||
spotify__clienttoken__data__v0__native_iosdata__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__native_iosdata__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__NativeIOSData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData methods */
|
||||
void spotify__clienttoken__data__v0__native_desktop_windows_data__init
|
||||
(Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_windows_data__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_windows_data__pack
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_windows_data__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *
|
||||
spotify__clienttoken__data__v0__native_desktop_windows_data__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__native_desktop_windows_data__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData methods */
|
||||
void spotify__clienttoken__data__v0__native_desktop_linux_data__init
|
||||
(Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_linux_data__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_linux_data__pack
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_linux_data__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *
|
||||
spotify__clienttoken__data__v0__native_desktop_linux_data__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__native_desktop_linux_data__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData methods */
|
||||
void spotify__clienttoken__data__v0__native_desktop_mac_osdata__init
|
||||
(Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_mac_osdata__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *message);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_mac_osdata__pack
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__native_desktop_mac_osdata__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *
|
||||
spotify__clienttoken__data__v0__native_desktop_mac_osdata__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__native_desktop_mac_osdata__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Clienttoken__Data__V0__Screen methods */
|
||||
void spotify__clienttoken__data__v0__screen__init
|
||||
(Spotify__Clienttoken__Data__V0__Screen *message);
|
||||
size_t spotify__clienttoken__data__v0__screen__get_packed_size
|
||||
(const Spotify__Clienttoken__Data__V0__Screen *message);
|
||||
size_t spotify__clienttoken__data__v0__screen__pack
|
||||
(const Spotify__Clienttoken__Data__V0__Screen *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__clienttoken__data__v0__screen__pack_to_buffer
|
||||
(const Spotify__Clienttoken__Data__V0__Screen *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Clienttoken__Data__V0__Screen *
|
||||
spotify__clienttoken__data__v0__screen__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__clienttoken__data__v0__screen__free_unpacked
|
||||
(Spotify__Clienttoken__Data__V0__Screen *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__ConnectivitySdkData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__ConnectivitySdkData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__PlatformSpecificData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__PlatformSpecificData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__NativeAndroidData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__NativeAndroidData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__NativeIOSData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__NativeIOSData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopWindowsData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopLinuxData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__NativeDesktopMacOSData *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Clienttoken__Data__V0__Screen_Closure)
|
||||
(const Spotify__Clienttoken__Data__V0__Screen *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__connectivity_sdk_data__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__platform_specific_data__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__native_android_data__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__native_iosdata__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__native_desktop_windows_data__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__native_desktop_linux_data__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__native_desktop_mac_osdata__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__clienttoken__data__v0__screen__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_connectivity_2eproto__INCLUDED */
|
73
src/inputs/librespot-c/src/proto/connectivity.proto
Normal file
73
src/inputs/librespot-c/src/proto/connectivity.proto
Normal file
@ -0,0 +1,73 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.clienttoken.data.v0;
|
||||
|
||||
message ConnectivitySdkData {
|
||||
PlatformSpecificData platform_specific_data = 1;
|
||||
string device_id = 2;
|
||||
}
|
||||
|
||||
message PlatformSpecificData {
|
||||
oneof data {
|
||||
NativeAndroidData android = 1;
|
||||
NativeIOSData ios = 2;
|
||||
NativeDesktopMacOSData desktop_macos = 3;
|
||||
NativeDesktopWindowsData desktop_windows = 4;
|
||||
NativeDesktopLinuxData desktop_linux = 5;
|
||||
}
|
||||
}
|
||||
|
||||
message NativeAndroidData {
|
||||
Screen screen_dimensions = 1;
|
||||
string android_version = 2;
|
||||
int32 api_version = 3;
|
||||
string device_name = 4;
|
||||
string model_str = 5;
|
||||
string vendor = 6;
|
||||
string vendor_2 = 7;
|
||||
int32 unknown_value_8 = 8;
|
||||
}
|
||||
|
||||
message NativeIOSData {
|
||||
// https://developer.apple.com/documentation/uikit/uiuserinterfaceidiom
|
||||
int32 user_interface_idiom = 1;
|
||||
bool target_iphone_simulator = 2;
|
||||
string hw_machine = 3;
|
||||
string system_version = 4;
|
||||
string simulator_model_identifier = 5;
|
||||
}
|
||||
|
||||
message NativeDesktopWindowsData {
|
||||
int32 os_version = 1;
|
||||
int32 os_build = 3;
|
||||
// https://docs.microsoft.com/en-us/dotnet/api/system.platformid?view=net-6.0
|
||||
int32 platform_id = 4;
|
||||
int32 unknown_value_5 = 5;
|
||||
int32 unknown_value_6 = 6;
|
||||
// https://docs.microsoft.com/en-us/dotnet/api/system.reflection.imagefilemachine?view=net-6.0
|
||||
int32 image_file_machine = 7;
|
||||
// https://docs.microsoft.com/en-us/dotnet/api/system.reflection.portableexecutable.machine?view=net-6.0
|
||||
int32 pe_machine = 8;
|
||||
bool unknown_value_10 = 10;
|
||||
}
|
||||
|
||||
message NativeDesktopLinuxData {
|
||||
string system_name = 1; // uname -s
|
||||
string system_release = 2; // -r
|
||||
string system_version = 3; // -v
|
||||
string hardware = 4; // -i
|
||||
}
|
||||
|
||||
message NativeDesktopMacOSData {
|
||||
string system_version = 1;
|
||||
string hw_model = 2;
|
||||
string compiled_cpu_type = 3;
|
||||
}
|
||||
|
||||
message Screen {
|
||||
int32 width = 1;
|
||||
int32 height = 2;
|
||||
int32 density = 3;
|
||||
int32 unknown_value_4 = 4;
|
||||
int32 unknown_value_5 = 5;
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message EventReply {
|
||||
optional int32 queued = 0x1;
|
||||
optional RetryInfo retry = 0x2;
|
||||
}
|
||||
|
||||
message RetryInfo {
|
||||
optional int32 retry_delay = 0x1;
|
||||
optional int32 max_retry = 0x2;
|
||||
}
|
||||
|
||||
message Id {
|
||||
optional string uri = 0x1;
|
||||
optional int64 start_time = 0x2;
|
||||
}
|
||||
|
||||
message Start {
|
||||
optional int32 length = 0x1;
|
||||
optional string context_uri = 0x2;
|
||||
optional int64 end_time = 0x3;
|
||||
}
|
||||
|
||||
message Seek {
|
||||
optional int64 end_time = 0x1;
|
||||
}
|
||||
|
||||
message Pause {
|
||||
optional int32 seconds_played = 0x1;
|
||||
optional int64 end_time = 0x2;
|
||||
}
|
||||
|
||||
message Resume {
|
||||
optional int32 seconds_played = 0x1;
|
||||
optional int64 end_time = 0x2;
|
||||
}
|
||||
|
||||
message End {
|
||||
optional int32 seconds_played = 0x1;
|
||||
optional int64 end_time = 0x2;
|
||||
}
|
||||
|
||||
message Event {
|
||||
optional Id id = 0x1;
|
||||
optional Start start = 0x2;
|
||||
optional Seek seek = 0x3;
|
||||
optional Pause pause = 0x4;
|
||||
optional Resume resume = 0x5;
|
||||
optional End end = 0x6;
|
||||
}
|
||||
|
@ -1,183 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message Credential {
|
||||
optional string facebook_uid = 0x1;
|
||||
optional string access_token = 0x2;
|
||||
}
|
||||
|
||||
message EnableRequest {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message EnableReply {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message DisableRequest {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message RevokeRequest {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message InspectCredentialRequest {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message InspectCredentialReply {
|
||||
optional Credential alternative_credential = 0x1;
|
||||
optional bool app_user = 0x2;
|
||||
optional bool permanent_error = 0x3;
|
||||
optional bool transient_error = 0x4;
|
||||
}
|
||||
|
||||
message UserState {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message UpdateUserStateRequest {
|
||||
optional Credential credential = 0x1;
|
||||
}
|
||||
|
||||
message OpenGraphError {
|
||||
repeated string permanent = 0x1;
|
||||
repeated string invalid_token = 0x2;
|
||||
repeated string retries = 0x3;
|
||||
}
|
||||
|
||||
message OpenGraphScrobble {
|
||||
optional int32 create_delay = 0x1;
|
||||
}
|
||||
|
||||
message OpenGraphConfig {
|
||||
optional OpenGraphError error = 0x1;
|
||||
optional OpenGraphScrobble scrobble = 0x2;
|
||||
}
|
||||
|
||||
message AuthConfig {
|
||||
optional string url = 0x1;
|
||||
repeated string permissions = 0x2;
|
||||
repeated string blacklist = 0x3;
|
||||
repeated string whitelist = 0x4;
|
||||
repeated string cancel = 0x5;
|
||||
}
|
||||
|
||||
message ConfigReply {
|
||||
optional string domain = 0x1;
|
||||
optional string app_id = 0x2;
|
||||
optional string app_namespace = 0x3;
|
||||
optional AuthConfig auth = 0x4;
|
||||
optional OpenGraphConfig og = 0x5;
|
||||
}
|
||||
|
||||
message UserFields {
|
||||
optional bool app_user = 0x1;
|
||||
optional bool display_name = 0x2;
|
||||
optional bool first_name = 0x3;
|
||||
optional bool middle_name = 0x4;
|
||||
optional bool last_name = 0x5;
|
||||
optional bool picture_large = 0x6;
|
||||
optional bool picture_square = 0x7;
|
||||
optional bool gender = 0x8;
|
||||
optional bool email = 0x9;
|
||||
}
|
||||
|
||||
message UserOptions {
|
||||
optional bool cache_is_king = 0x1;
|
||||
}
|
||||
|
||||
message UserRequest {
|
||||
optional UserOptions options = 0x1;
|
||||
optional UserFields fields = 0x2;
|
||||
}
|
||||
|
||||
message User {
|
||||
optional string spotify_username = 0x1;
|
||||
optional string facebook_uid = 0x2;
|
||||
optional bool app_user = 0x3;
|
||||
optional string display_name = 0x4;
|
||||
optional string first_name = 0x5;
|
||||
optional string middle_name = 0x6;
|
||||
optional string last_name = 0x7;
|
||||
optional string picture_large = 0x8;
|
||||
optional string picture_square = 0x9;
|
||||
optional string gender = 0xa;
|
||||
optional string email = 0xb;
|
||||
}
|
||||
|
||||
message FriendsFields {
|
||||
optional bool app_user = 0x1;
|
||||
optional bool display_name = 0x2;
|
||||
optional bool picture_large = 0x6;
|
||||
}
|
||||
|
||||
message FriendsOptions {
|
||||
optional int32 limit = 0x1;
|
||||
optional int32 offset = 0x2;
|
||||
optional bool cache_is_king = 0x3;
|
||||
optional bool app_friends = 0x4;
|
||||
optional bool non_app_friends = 0x5;
|
||||
}
|
||||
|
||||
message FriendsRequest {
|
||||
optional FriendsOptions options = 0x1;
|
||||
optional FriendsFields fields = 0x2;
|
||||
}
|
||||
|
||||
message FriendsReply {
|
||||
repeated User friends = 0x1;
|
||||
optional bool more = 0x2;
|
||||
}
|
||||
|
||||
message ShareRequest {
|
||||
optional Credential credential = 0x1;
|
||||
optional string uri = 0x2;
|
||||
optional string message_text = 0x3;
|
||||
}
|
||||
|
||||
message ShareReply {
|
||||
optional string post_id = 0x1;
|
||||
}
|
||||
|
||||
message InboxRequest {
|
||||
optional Credential credential = 0x1;
|
||||
repeated string facebook_uids = 0x3;
|
||||
optional string message_text = 0x4;
|
||||
optional string message_link = 0x5;
|
||||
}
|
||||
|
||||
message InboxReply {
|
||||
optional string message_id = 0x1;
|
||||
optional string thread_id = 0x2;
|
||||
}
|
||||
|
||||
message PermissionsOptions {
|
||||
optional bool cache_is_king = 0x1;
|
||||
}
|
||||
|
||||
message PermissionsRequest {
|
||||
optional Credential credential = 0x1;
|
||||
optional PermissionsOptions options = 0x2;
|
||||
}
|
||||
|
||||
message PermissionsReply {
|
||||
repeated string permissions = 0x1;
|
||||
}
|
||||
|
||||
message GrantPermissionsRequest {
|
||||
optional Credential credential = 0x1;
|
||||
repeated string permissions = 0x2;
|
||||
}
|
||||
|
||||
message GrantPermissionsReply {
|
||||
repeated string granted = 0x1;
|
||||
repeated string failed = 0x2;
|
||||
}
|
||||
|
||||
message TransferRequest {
|
||||
optional Credential credential = 0x1;
|
||||
optional string source_username = 0x2;
|
||||
optional string target_username = 0x3;
|
||||
}
|
||||
|
105
src/inputs/librespot-c/src/proto/google_duration.pb-c.c
Normal file
105
src/inputs/librespot-c/src/proto/google_duration.pb-c.c
Normal file
@ -0,0 +1,105 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: google_duration.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "google_duration.pb-c.h"
|
||||
void google__protobuf__duration__init
|
||||
(Google__Protobuf__Duration *message)
|
||||
{
|
||||
static const Google__Protobuf__Duration init_value = GOOGLE__PROTOBUF__DURATION__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t google__protobuf__duration__get_packed_size
|
||||
(const Google__Protobuf__Duration *message)
|
||||
{
|
||||
assert(message->base.descriptor == &google__protobuf__duration__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t google__protobuf__duration__pack
|
||||
(const Google__Protobuf__Duration *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &google__protobuf__duration__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t google__protobuf__duration__pack_to_buffer
|
||||
(const Google__Protobuf__Duration *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &google__protobuf__duration__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Google__Protobuf__Duration *
|
||||
google__protobuf__duration__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Google__Protobuf__Duration *)
|
||||
protobuf_c_message_unpack (&google__protobuf__duration__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void google__protobuf__duration__free_unpacked
|
||||
(Google__Protobuf__Duration *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &google__protobuf__duration__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCFieldDescriptor google__protobuf__duration__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"seconds",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_INT64,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Google__Protobuf__Duration, seconds),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"nanos",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_INT32,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Google__Protobuf__Duration, nanos),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned google__protobuf__duration__field_indices_by_name[] = {
|
||||
1, /* field[1] = nanos */
|
||||
0, /* field[0] = seconds */
|
||||
};
|
||||
static const ProtobufCIntRange google__protobuf__duration__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor google__protobuf__duration__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"google.protobuf.Duration",
|
||||
"Duration",
|
||||
"Google__Protobuf__Duration",
|
||||
"google.protobuf",
|
||||
sizeof(Google__Protobuf__Duration),
|
||||
2,
|
||||
google__protobuf__duration__field_descriptors,
|
||||
google__protobuf__duration__field_indices_by_name,
|
||||
1, google__protobuf__duration__number_ranges,
|
||||
(ProtobufCMessageInit) google__protobuf__duration__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
72
src/inputs/librespot-c/src/proto/google_duration.pb-c.h
Normal file
72
src/inputs/librespot-c/src/proto/google_duration.pb-c.h
Normal file
@ -0,0 +1,72 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: google_duration.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_google_5fduration_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_google_5fduration_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Google__Protobuf__Duration Google__Protobuf__Duration;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Google__Protobuf__Duration
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
int64_t seconds;
|
||||
int32_t nanos;
|
||||
};
|
||||
#define GOOGLE__PROTOBUF__DURATION__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&google__protobuf__duration__descriptor) \
|
||||
, 0, 0 }
|
||||
|
||||
|
||||
/* Google__Protobuf__Duration methods */
|
||||
void google__protobuf__duration__init
|
||||
(Google__Protobuf__Duration *message);
|
||||
size_t google__protobuf__duration__get_packed_size
|
||||
(const Google__Protobuf__Duration *message);
|
||||
size_t google__protobuf__duration__pack
|
||||
(const Google__Protobuf__Duration *message,
|
||||
uint8_t *out);
|
||||
size_t google__protobuf__duration__pack_to_buffer
|
||||
(const Google__Protobuf__Duration *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Google__Protobuf__Duration *
|
||||
google__protobuf__duration__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void google__protobuf__duration__free_unpacked
|
||||
(Google__Protobuf__Duration *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Google__Protobuf__Duration_Closure)
|
||||
(const Google__Protobuf__Duration *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor google__protobuf__duration__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_google_5fduration_2eproto__INCLUDED */
|
8
src/inputs/librespot-c/src/proto/google_duration.proto
Normal file
8
src/inputs/librespot-c/src/proto/google_duration.proto
Normal file
@ -0,0 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package google.protobuf;
|
||||
|
||||
message Duration {
|
||||
int64 seconds = 1;
|
||||
int32 nanos = 2;
|
||||
}
|
947
src/inputs/librespot-c/src/proto/login5.pb-c.c
Normal file
947
src/inputs/librespot-c/src/proto/login5.pb-c.c
Normal file
@ -0,0 +1,947 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5.pb-c.h"
|
||||
void spotify__login5__v3__challenges__init
|
||||
(Spotify__Login5__V3__Challenges *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Challenges init_value = SPOTIFY__LOGIN5__V3__CHALLENGES__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__pack
|
||||
(const Spotify__Login5__V3__Challenges *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Challenges *
|
||||
spotify__login5__v3__challenges__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Challenges *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenges__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenges__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__challenge__init
|
||||
(Spotify__Login5__V3__Challenge *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Challenge init_value = SPOTIFY__LOGIN5__V3__CHALLENGE__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenge__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenge *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenge__pack
|
||||
(const Spotify__Login5__V3__Challenge *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenge__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenge *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Challenge *
|
||||
spotify__login5__v3__challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Challenge *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenge__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenge__free_unpacked
|
||||
(Spotify__Login5__V3__Challenge *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__challenge_solutions__init
|
||||
(Spotify__Login5__V3__ChallengeSolutions *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__ChallengeSolutions init_value = SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTIONS__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenge_solutions__get_packed_size
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solutions__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenge_solutions__pack
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solutions__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenge_solutions__pack_to_buffer
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solutions__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__ChallengeSolutions *
|
||||
spotify__login5__v3__challenge_solutions__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__ChallengeSolutions *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenge_solutions__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenge_solutions__free_unpacked
|
||||
(Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solutions__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__challenge_solution__init
|
||||
(Spotify__Login5__V3__ChallengeSolution *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__ChallengeSolution init_value = SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenge_solution__get_packed_size
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solution__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenge_solution__pack
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solution__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenge_solution__pack_to_buffer
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solution__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__ChallengeSolution *
|
||||
spotify__login5__v3__challenge_solution__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__ChallengeSolution *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenge_solution__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenge_solution__free_unpacked
|
||||
(Spotify__Login5__V3__ChallengeSolution *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenge_solution__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__login_request__init
|
||||
(Spotify__Login5__V3__LoginRequest *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__LoginRequest init_value = SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__login_request__get_packed_size
|
||||
(const Spotify__Login5__V3__LoginRequest *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_request__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__login_request__pack
|
||||
(const Spotify__Login5__V3__LoginRequest *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_request__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__login_request__pack_to_buffer
|
||||
(const Spotify__Login5__V3__LoginRequest *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_request__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__LoginRequest *
|
||||
spotify__login5__v3__login_request__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__LoginRequest *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__login_request__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__login_request__free_unpacked
|
||||
(Spotify__Login5__V3__LoginRequest *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_request__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__login_ok__init
|
||||
(Spotify__Login5__V3__LoginOk *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__LoginOk init_value = SPOTIFY__LOGIN5__V3__LOGIN_OK__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__login_ok__get_packed_size
|
||||
(const Spotify__Login5__V3__LoginOk *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_ok__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__login_ok__pack
|
||||
(const Spotify__Login5__V3__LoginOk *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_ok__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__login_ok__pack_to_buffer
|
||||
(const Spotify__Login5__V3__LoginOk *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_ok__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__LoginOk *
|
||||
spotify__login5__v3__login_ok__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__LoginOk *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__login_ok__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__login_ok__free_unpacked
|
||||
(Spotify__Login5__V3__LoginOk *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_ok__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__login_response__init
|
||||
(Spotify__Login5__V3__LoginResponse *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__LoginResponse init_value = SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__login_response__get_packed_size
|
||||
(const Spotify__Login5__V3__LoginResponse *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_response__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__login_response__pack
|
||||
(const Spotify__Login5__V3__LoginResponse *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_response__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__login_response__pack_to_buffer
|
||||
(const Spotify__Login5__V3__LoginResponse *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_response__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__LoginResponse *
|
||||
spotify__login5__v3__login_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__LoginResponse *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__login_response__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__login_response__free_unpacked
|
||||
(Spotify__Login5__V3__LoginResponse *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__login_response__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenges__field_descriptors[1] =
|
||||
{
|
||||
{
|
||||
"challenges",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_REPEATED,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__Challenges, n_challenges),
|
||||
offsetof(Spotify__Login5__V3__Challenges, challenges),
|
||||
&spotify__login5__v3__challenge__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenges__field_indices_by_name[] = {
|
||||
0, /* field[0] = challenges */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenges__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenges__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.Challenges",
|
||||
"Challenges",
|
||||
"Spotify__Login5__V3__Challenges",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__Challenges),
|
||||
1,
|
||||
spotify__login5__v3__challenges__field_descriptors,
|
||||
spotify__login5__v3__challenges__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenges__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenges__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenge__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"hashcash",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__Challenge, challenge_case),
|
||||
offsetof(Spotify__Login5__V3__Challenge, hashcash),
|
||||
&spotify__login5__v3__challenges__hashcash_challenge__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"code",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__Challenge, challenge_case),
|
||||
offsetof(Spotify__Login5__V3__Challenge, code),
|
||||
&spotify__login5__v3__challenges__code_challenge__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenge__field_indices_by_name[] = {
|
||||
1, /* field[1] = code */
|
||||
0, /* field[0] = hashcash */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenge__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenge__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.Challenge",
|
||||
"Challenge",
|
||||
"Spotify__Login5__V3__Challenge",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__Challenge),
|
||||
2,
|
||||
spotify__login5__v3__challenge__field_descriptors,
|
||||
spotify__login5__v3__challenge__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenge__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenge__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenge_solutions__field_descriptors[1] =
|
||||
{
|
||||
{
|
||||
"solutions",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_REPEATED,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__ChallengeSolutions, n_solutions),
|
||||
offsetof(Spotify__Login5__V3__ChallengeSolutions, solutions),
|
||||
&spotify__login5__v3__challenge_solution__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenge_solutions__field_indices_by_name[] = {
|
||||
0, /* field[0] = solutions */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenge_solutions__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenge_solutions__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.ChallengeSolutions",
|
||||
"ChallengeSolutions",
|
||||
"Spotify__Login5__V3__ChallengeSolutions",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__ChallengeSolutions),
|
||||
1,
|
||||
spotify__login5__v3__challenge_solutions__field_descriptors,
|
||||
spotify__login5__v3__challenge_solutions__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenge_solutions__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenge_solutions__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenge_solution__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"hashcash",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__ChallengeSolution, solution_case),
|
||||
offsetof(Spotify__Login5__V3__ChallengeSolution, hashcash),
|
||||
&spotify__login5__v3__challenges__hashcash_solution__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"code",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__ChallengeSolution, solution_case),
|
||||
offsetof(Spotify__Login5__V3__ChallengeSolution, code),
|
||||
&spotify__login5__v3__challenges__code_solution__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenge_solution__field_indices_by_name[] = {
|
||||
1, /* field[1] = code */
|
||||
0, /* field[0] = hashcash */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenge_solution__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenge_solution__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.ChallengeSolution",
|
||||
"ChallengeSolution",
|
||||
"Spotify__Login5__V3__ChallengeSolution",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__ChallengeSolution),
|
||||
2,
|
||||
spotify__login5__v3__challenge_solution__field_descriptors,
|
||||
spotify__login5__v3__challenge_solution__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenge_solution__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenge_solution__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__login_request__field_descriptors[12] =
|
||||
{
|
||||
{
|
||||
"client_info",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, client_info),
|
||||
&spotify__login5__v3__client_info__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"login_context",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_context),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"challenge_solutions",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, challenge_solutions),
|
||||
&spotify__login5__v3__challenge_solutions__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"stored_credential",
|
||||
100,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, stored_credential),
|
||||
&spotify__login5__v3__credentials__stored_credential__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"password",
|
||||
101,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, password),
|
||||
&spotify__login5__v3__credentials__password__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"facebook_access_token",
|
||||
102,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, facebook_access_token),
|
||||
&spotify__login5__v3__credentials__facebook_access_token__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"phone_number",
|
||||
103,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, phone_number),
|
||||
&spotify__login5__v3__identifiers__phone_number__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"one_time_token",
|
||||
104,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, one_time_token),
|
||||
&spotify__login5__v3__credentials__one_time_token__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"parent_child_credential",
|
||||
105,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, parent_child_credential),
|
||||
&spotify__login5__v3__credentials__parent_child_credential__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"apple_sign_in_credential",
|
||||
106,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, apple_sign_in_credential),
|
||||
&spotify__login5__v3__credentials__apple_sign_in_credential__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"samsung_sign_in_credential",
|
||||
107,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, samsung_sign_in_credential),
|
||||
&spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"google_sign_in_credential",
|
||||
108,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, login_method_case),
|
||||
offsetof(Spotify__Login5__V3__LoginRequest, google_sign_in_credential),
|
||||
&spotify__login5__v3__credentials__google_sign_in_credential__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__login_request__field_indices_by_name[] = {
|
||||
9, /* field[9] = apple_sign_in_credential */
|
||||
2, /* field[2] = challenge_solutions */
|
||||
0, /* field[0] = client_info */
|
||||
5, /* field[5] = facebook_access_token */
|
||||
11, /* field[11] = google_sign_in_credential */
|
||||
1, /* field[1] = login_context */
|
||||
7, /* field[7] = one_time_token */
|
||||
8, /* field[8] = parent_child_credential */
|
||||
4, /* field[4] = password */
|
||||
6, /* field[6] = phone_number */
|
||||
10, /* field[10] = samsung_sign_in_credential */
|
||||
3, /* field[3] = stored_credential */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__login_request__number_ranges[2 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 100, 3 },
|
||||
{ 0, 12 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__login_request__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.LoginRequest",
|
||||
"LoginRequest",
|
||||
"Spotify__Login5__V3__LoginRequest",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__LoginRequest),
|
||||
12,
|
||||
spotify__login5__v3__login_request__field_descriptors,
|
||||
spotify__login5__v3__login_request__field_indices_by_name,
|
||||
2, spotify__login5__v3__login_request__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__login_request__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__login_ok__field_descriptors[4] =
|
||||
{
|
||||
{
|
||||
"username",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginOk, username),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"access_token",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginOk, access_token),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"stored_credential",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginOk, stored_credential),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"access_token_expires_in",
|
||||
4,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_INT32,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginOk, access_token_expires_in),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__login_ok__field_indices_by_name[] = {
|
||||
1, /* field[1] = access_token */
|
||||
3, /* field[3] = access_token_expires_in */
|
||||
2, /* field[2] = stored_credential */
|
||||
0, /* field[0] = username */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__login_ok__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 4 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__login_ok__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.LoginOk",
|
||||
"LoginOk",
|
||||
"Spotify__Login5__V3__LoginOk",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__LoginOk),
|
||||
4,
|
||||
spotify__login5__v3__login_ok__field_descriptors,
|
||||
spotify__login5__v3__login_ok__field_indices_by_name,
|
||||
1, spotify__login5__v3__login_ok__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__login_ok__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCEnumValue spotify__login5__v3__login_response__warnings__enum_values_by_number[2] =
|
||||
{
|
||||
{ "UNKNOWN_WARNING", "SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__WARNINGS__UNKNOWN_WARNING", 0 },
|
||||
{ "DEPRECATED_PROTOCOL_VERSION", "SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__WARNINGS__DEPRECATED_PROTOCOL_VERSION", 1 },
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__login_response__warnings__value_ranges[] = {
|
||||
{0, 0},{0, 2}
|
||||
};
|
||||
static const ProtobufCEnumValueIndex spotify__login5__v3__login_response__warnings__enum_values_by_name[2] =
|
||||
{
|
||||
{ "DEPRECATED_PROTOCOL_VERSION", 1 },
|
||||
{ "UNKNOWN_WARNING", 0 },
|
||||
};
|
||||
const ProtobufCEnumDescriptor spotify__login5__v3__login_response__warnings__descriptor =
|
||||
{
|
||||
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.LoginResponse.Warnings",
|
||||
"Warnings",
|
||||
"Spotify__Login5__V3__LoginResponse__Warnings",
|
||||
"spotify.login5.v3",
|
||||
2,
|
||||
spotify__login5__v3__login_response__warnings__enum_values_by_number,
|
||||
2,
|
||||
spotify__login5__v3__login_response__warnings__enum_values_by_name,
|
||||
1,
|
||||
spotify__login5__v3__login_response__warnings__value_ranges,
|
||||
NULL,NULL,NULL,NULL /* reserved[1234] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__login_response__field_descriptors[7] =
|
||||
{
|
||||
{
|
||||
"ok",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, response_case),
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, ok),
|
||||
&spotify__login5__v3__login_ok__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"error",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_ENUM,
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, response_case),
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, error),
|
||||
&spotify__login5__v3__login_error__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"challenges",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, response_case),
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, challenges),
|
||||
&spotify__login5__v3__challenges__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"warnings",
|
||||
4,
|
||||
PROTOBUF_C_LABEL_REPEATED,
|
||||
PROTOBUF_C_TYPE_ENUM,
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, n_warnings),
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, warnings),
|
||||
&spotify__login5__v3__login_response__warnings__descriptor,
|
||||
NULL,
|
||||
0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"login_context",
|
||||
5,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, login_context),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"identifier_token",
|
||||
6,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, identifier_token),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"user_info",
|
||||
7,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__LoginResponse, user_info),
|
||||
&spotify__login5__v3__user_info__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__login_response__field_indices_by_name[] = {
|
||||
2, /* field[2] = challenges */
|
||||
1, /* field[1] = error */
|
||||
5, /* field[5] = identifier_token */
|
||||
4, /* field[4] = login_context */
|
||||
0, /* field[0] = ok */
|
||||
6, /* field[6] = user_info */
|
||||
3, /* field[3] = warnings */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__login_response__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 7 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__login_response__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.LoginResponse",
|
||||
"LoginResponse",
|
||||
"Spotify__Login5__V3__LoginResponse",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__LoginResponse),
|
||||
7,
|
||||
spotify__login5__v3__login_response__field_descriptors,
|
||||
spotify__login5__v3__login_response__field_indices_by_name,
|
||||
1, spotify__login5__v3__login_response__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__login_response__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCEnumValue spotify__login5__v3__login_error__enum_values_by_number[9] =
|
||||
{
|
||||
{ "UNKNOWN_ERROR", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__UNKNOWN_ERROR", 0 },
|
||||
{ "INVALID_CREDENTIALS", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__INVALID_CREDENTIALS", 1 },
|
||||
{ "BAD_REQUEST", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__BAD_REQUEST", 2 },
|
||||
{ "UNSUPPORTED_LOGIN_PROTOCOL", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__UNSUPPORTED_LOGIN_PROTOCOL", 3 },
|
||||
{ "TIMEOUT", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__TIMEOUT", 4 },
|
||||
{ "UNKNOWN_IDENTIFIER", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__UNKNOWN_IDENTIFIER", 5 },
|
||||
{ "TOO_MANY_ATTEMPTS", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__TOO_MANY_ATTEMPTS", 6 },
|
||||
{ "INVALID_PHONENUMBER", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__INVALID_PHONENUMBER", 7 },
|
||||
{ "TRY_AGAIN_LATER", "SPOTIFY__LOGIN5__V3__LOGIN_ERROR__TRY_AGAIN_LATER", 8 },
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__login_error__value_ranges[] = {
|
||||
{0, 0},{0, 9}
|
||||
};
|
||||
static const ProtobufCEnumValueIndex spotify__login5__v3__login_error__enum_values_by_name[9] =
|
||||
{
|
||||
{ "BAD_REQUEST", 2 },
|
||||
{ "INVALID_CREDENTIALS", 1 },
|
||||
{ "INVALID_PHONENUMBER", 7 },
|
||||
{ "TIMEOUT", 4 },
|
||||
{ "TOO_MANY_ATTEMPTS", 6 },
|
||||
{ "TRY_AGAIN_LATER", 8 },
|
||||
{ "UNKNOWN_ERROR", 0 },
|
||||
{ "UNKNOWN_IDENTIFIER", 5 },
|
||||
{ "UNSUPPORTED_LOGIN_PROTOCOL", 3 },
|
||||
};
|
||||
const ProtobufCEnumDescriptor spotify__login5__v3__login_error__descriptor =
|
||||
{
|
||||
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.LoginError",
|
||||
"LoginError",
|
||||
"Spotify__Login5__V3__LoginError",
|
||||
"spotify.login5.v3",
|
||||
9,
|
||||
spotify__login5__v3__login_error__enum_values_by_number,
|
||||
9,
|
||||
spotify__login5__v3__login_error__enum_values_by_name,
|
||||
1,
|
||||
spotify__login5__v3__login_error__value_ranges,
|
||||
NULL,NULL,NULL,NULL /* reserved[1234] */
|
||||
};
|
373
src/inputs/librespot-c/src/proto/login5.pb-c.h
Normal file
373
src/inputs/librespot-c/src/proto/login5.pb-c.h
Normal file
@ -0,0 +1,373 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
#include "login5_client_info.pb-c.h"
|
||||
#include "login5_user_info.pb-c.h"
|
||||
#include "login5_challenges_code.pb-c.h"
|
||||
#include "login5_challenges_hashcash.pb-c.h"
|
||||
#include "login5_credentials.pb-c.h"
|
||||
#include "login5_identifiers.pb-c.h"
|
||||
|
||||
typedef struct Spotify__Login5__V3__Challenges Spotify__Login5__V3__Challenges;
|
||||
typedef struct Spotify__Login5__V3__Challenge Spotify__Login5__V3__Challenge;
|
||||
typedef struct Spotify__Login5__V3__ChallengeSolutions Spotify__Login5__V3__ChallengeSolutions;
|
||||
typedef struct Spotify__Login5__V3__ChallengeSolution Spotify__Login5__V3__ChallengeSolution;
|
||||
typedef struct Spotify__Login5__V3__LoginRequest Spotify__Login5__V3__LoginRequest;
|
||||
typedef struct Spotify__Login5__V3__LoginOk Spotify__Login5__V3__LoginOk;
|
||||
typedef struct Spotify__Login5__V3__LoginResponse Spotify__Login5__V3__LoginResponse;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
typedef enum _Spotify__Login5__V3__LoginResponse__Warnings {
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__WARNINGS__UNKNOWN_WARNING = 0,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__WARNINGS__DEPRECATED_PROTOCOL_VERSION = 1
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__WARNINGS)
|
||||
} Spotify__Login5__V3__LoginResponse__Warnings;
|
||||
typedef enum _Spotify__Login5__V3__LoginError {
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__UNKNOWN_ERROR = 0,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__INVALID_CREDENTIALS = 1,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__BAD_REQUEST = 2,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__UNSUPPORTED_LOGIN_PROTOCOL = 3,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__TIMEOUT = 4,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__UNKNOWN_IDENTIFIER = 5,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__TOO_MANY_ATTEMPTS = 6,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__INVALID_PHONENUMBER = 7,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_ERROR__TRY_AGAIN_LATER = 8
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__LOGIN_ERROR)
|
||||
} Spotify__Login5__V3__LoginError;
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__Challenges
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
size_t n_challenges;
|
||||
Spotify__Login5__V3__Challenge **challenges;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGES__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenges__descriptor) \
|
||||
, 0,NULL }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGE__CHALLENGE__NOT_SET = 0,
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGE__CHALLENGE_HASHCASH = 1,
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGE__CHALLENGE_CODE = 2
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__CHALLENGE__CHALLENGE__CASE)
|
||||
} Spotify__Login5__V3__Challenge__ChallengeCase;
|
||||
|
||||
struct Spotify__Login5__V3__Challenge
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Login5__V3__Challenge__ChallengeCase challenge_case;
|
||||
union {
|
||||
Spotify__Login5__V3__Challenges__HashcashChallenge *hashcash;
|
||||
Spotify__Login5__V3__Challenges__CodeChallenge *code;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenge__descriptor) \
|
||||
, SPOTIFY__LOGIN5__V3__CHALLENGE__CHALLENGE__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__ChallengeSolutions
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
size_t n_solutions;
|
||||
Spotify__Login5__V3__ChallengeSolution **solutions;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTIONS__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenge_solutions__descriptor) \
|
||||
, 0,NULL }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__SOLUTION__NOT_SET = 0,
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__SOLUTION_HASHCASH = 1,
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__SOLUTION_CODE = 2
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__SOLUTION__CASE)
|
||||
} Spotify__Login5__V3__ChallengeSolution__SolutionCase;
|
||||
|
||||
struct Spotify__Login5__V3__ChallengeSolution
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Login5__V3__ChallengeSolution__SolutionCase solution_case;
|
||||
union {
|
||||
Spotify__Login5__V3__Challenges__HashcashSolution *hashcash;
|
||||
Spotify__Login5__V3__Challenges__CodeSolution *code;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenge_solution__descriptor) \
|
||||
, SPOTIFY__LOGIN5__V3__CHALLENGE_SOLUTION__SOLUTION__NOT_SET, {0} }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD__NOT_SET = 0,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_STORED_CREDENTIAL = 100,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_PASSWORD = 101,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_FACEBOOK_ACCESS_TOKEN = 102,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_PHONE_NUMBER = 103,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_ONE_TIME_TOKEN = 104,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_PARENT_CHILD_CREDENTIAL = 105,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_APPLE_SIGN_IN_CREDENTIAL = 106,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_SAMSUNG_SIGN_IN_CREDENTIAL = 107,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD_GOOGLE_SIGN_IN_CREDENTIAL = 108
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD__CASE)
|
||||
} Spotify__Login5__V3__LoginRequest__LoginMethodCase;
|
||||
|
||||
struct Spotify__Login5__V3__LoginRequest
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Login5__V3__ClientInfo *client_info;
|
||||
ProtobufCBinaryData login_context;
|
||||
Spotify__Login5__V3__ChallengeSolutions *challenge_solutions;
|
||||
Spotify__Login5__V3__LoginRequest__LoginMethodCase login_method_case;
|
||||
union {
|
||||
Spotify__Login5__V3__Credentials__StoredCredential *stored_credential;
|
||||
Spotify__Login5__V3__Credentials__Password *password;
|
||||
Spotify__Login5__V3__Credentials__FacebookAccessToken *facebook_access_token;
|
||||
Spotify__Login5__V3__Identifiers__PhoneNumber *phone_number;
|
||||
Spotify__Login5__V3__Credentials__OneTimeToken *one_time_token;
|
||||
Spotify__Login5__V3__Credentials__ParentChildCredential *parent_child_credential;
|
||||
Spotify__Login5__V3__Credentials__AppleSignInCredential *apple_sign_in_credential;
|
||||
Spotify__Login5__V3__Credentials__SamsungSignInCredential *samsung_sign_in_credential;
|
||||
Spotify__Login5__V3__Credentials__GoogleSignInCredential *google_sign_in_credential;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__login_request__descriptor) \
|
||||
, NULL, {0,NULL}, NULL, SPOTIFY__LOGIN5__V3__LOGIN_REQUEST__LOGIN_METHOD__NOT_SET, {0} }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__LoginOk
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *username;
|
||||
char *access_token;
|
||||
ProtobufCBinaryData stored_credential;
|
||||
int32_t access_token_expires_in;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__LOGIN_OK__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__login_ok__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, {0,NULL}, 0 }
|
||||
|
||||
|
||||
typedef enum {
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__RESPONSE__NOT_SET = 0,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__RESPONSE_OK = 1,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__RESPONSE_ERROR = 2,
|
||||
SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__RESPONSE_CHALLENGES = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__RESPONSE__CASE)
|
||||
} Spotify__Login5__V3__LoginResponse__ResponseCase;
|
||||
|
||||
struct Spotify__Login5__V3__LoginResponse
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
size_t n_warnings;
|
||||
Spotify__Login5__V3__LoginResponse__Warnings *warnings;
|
||||
ProtobufCBinaryData login_context;
|
||||
char *identifier_token;
|
||||
Spotify__Login5__V3__UserInfo *user_info;
|
||||
Spotify__Login5__V3__LoginResponse__ResponseCase response_case;
|
||||
union {
|
||||
Spotify__Login5__V3__LoginOk *ok;
|
||||
Spotify__Login5__V3__LoginError error;
|
||||
Spotify__Login5__V3__Challenges *challenges;
|
||||
};
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__login_response__descriptor) \
|
||||
, 0,NULL, {0,NULL}, (char *)protobuf_c_empty_string, NULL, SPOTIFY__LOGIN5__V3__LOGIN_RESPONSE__RESPONSE__NOT_SET, {0} }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__Challenges methods */
|
||||
void spotify__login5__v3__challenges__init
|
||||
(Spotify__Login5__V3__Challenges *message);
|
||||
size_t spotify__login5__v3__challenges__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges *message);
|
||||
size_t spotify__login5__v3__challenges__pack
|
||||
(const Spotify__Login5__V3__Challenges *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenges__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Challenges *
|
||||
spotify__login5__v3__challenges__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenges__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Challenge methods */
|
||||
void spotify__login5__v3__challenge__init
|
||||
(Spotify__Login5__V3__Challenge *message);
|
||||
size_t spotify__login5__v3__challenge__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenge *message);
|
||||
size_t spotify__login5__v3__challenge__pack
|
||||
(const Spotify__Login5__V3__Challenge *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenge__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenge *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Challenge *
|
||||
spotify__login5__v3__challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenge__free_unpacked
|
||||
(Spotify__Login5__V3__Challenge *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__ChallengeSolutions methods */
|
||||
void spotify__login5__v3__challenge_solutions__init
|
||||
(Spotify__Login5__V3__ChallengeSolutions *message);
|
||||
size_t spotify__login5__v3__challenge_solutions__get_packed_size
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message);
|
||||
size_t spotify__login5__v3__challenge_solutions__pack
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenge_solutions__pack_to_buffer
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__ChallengeSolutions *
|
||||
spotify__login5__v3__challenge_solutions__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenge_solutions__free_unpacked
|
||||
(Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__ChallengeSolution methods */
|
||||
void spotify__login5__v3__challenge_solution__init
|
||||
(Spotify__Login5__V3__ChallengeSolution *message);
|
||||
size_t spotify__login5__v3__challenge_solution__get_packed_size
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message);
|
||||
size_t spotify__login5__v3__challenge_solution__pack
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenge_solution__pack_to_buffer
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__ChallengeSolution *
|
||||
spotify__login5__v3__challenge_solution__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenge_solution__free_unpacked
|
||||
(Spotify__Login5__V3__ChallengeSolution *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__LoginRequest methods */
|
||||
void spotify__login5__v3__login_request__init
|
||||
(Spotify__Login5__V3__LoginRequest *message);
|
||||
size_t spotify__login5__v3__login_request__get_packed_size
|
||||
(const Spotify__Login5__V3__LoginRequest *message);
|
||||
size_t spotify__login5__v3__login_request__pack
|
||||
(const Spotify__Login5__V3__LoginRequest *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__login_request__pack_to_buffer
|
||||
(const Spotify__Login5__V3__LoginRequest *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__LoginRequest *
|
||||
spotify__login5__v3__login_request__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__login_request__free_unpacked
|
||||
(Spotify__Login5__V3__LoginRequest *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__LoginOk methods */
|
||||
void spotify__login5__v3__login_ok__init
|
||||
(Spotify__Login5__V3__LoginOk *message);
|
||||
size_t spotify__login5__v3__login_ok__get_packed_size
|
||||
(const Spotify__Login5__V3__LoginOk *message);
|
||||
size_t spotify__login5__v3__login_ok__pack
|
||||
(const Spotify__Login5__V3__LoginOk *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__login_ok__pack_to_buffer
|
||||
(const Spotify__Login5__V3__LoginOk *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__LoginOk *
|
||||
spotify__login5__v3__login_ok__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__login_ok__free_unpacked
|
||||
(Spotify__Login5__V3__LoginOk *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__LoginResponse methods */
|
||||
void spotify__login5__v3__login_response__init
|
||||
(Spotify__Login5__V3__LoginResponse *message);
|
||||
size_t spotify__login5__v3__login_response__get_packed_size
|
||||
(const Spotify__Login5__V3__LoginResponse *message);
|
||||
size_t spotify__login5__v3__login_response__pack
|
||||
(const Spotify__Login5__V3__LoginResponse *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__login_response__pack_to_buffer
|
||||
(const Spotify__Login5__V3__LoginResponse *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__LoginResponse *
|
||||
spotify__login5__v3__login_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__login_response__free_unpacked
|
||||
(Spotify__Login5__V3__LoginResponse *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__Challenges_Closure)
|
||||
(const Spotify__Login5__V3__Challenges *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Challenge_Closure)
|
||||
(const Spotify__Login5__V3__Challenge *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__ChallengeSolutions_Closure)
|
||||
(const Spotify__Login5__V3__ChallengeSolutions *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__ChallengeSolution_Closure)
|
||||
(const Spotify__Login5__V3__ChallengeSolution *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__LoginRequest_Closure)
|
||||
(const Spotify__Login5__V3__LoginRequest *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__LoginOk_Closure)
|
||||
(const Spotify__Login5__V3__LoginOk *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__LoginResponse_Closure)
|
||||
(const Spotify__Login5__V3__LoginResponse *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCEnumDescriptor spotify__login5__v3__login_error__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenges__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenge__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenge_solutions__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenge_solution__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__login_request__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__login_ok__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__login_response__descriptor;
|
||||
extern const ProtobufCEnumDescriptor spotify__login5__v3__login_response__warnings__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_2eproto__INCLUDED */
|
87
src/inputs/librespot-c/src/proto/login5.proto
Normal file
87
src/inputs/librespot-c/src/proto/login5.proto
Normal file
@ -0,0 +1,87 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3;
|
||||
|
||||
import "login5_client_info.proto";
|
||||
import "login5_user_info.proto";
|
||||
import "login5_challenges_code.proto";
|
||||
import "login5_challenges_hashcash.proto";
|
||||
import "login5_credentials.proto";
|
||||
import "login5_identifiers.proto";
|
||||
|
||||
message Challenges {
|
||||
repeated Challenge challenges = 1;
|
||||
}
|
||||
|
||||
message Challenge {
|
||||
oneof challenge {
|
||||
challenges.HashcashChallenge hashcash = 1;
|
||||
challenges.CodeChallenge code = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message ChallengeSolutions {
|
||||
repeated ChallengeSolution solutions = 1;
|
||||
}
|
||||
|
||||
message ChallengeSolution {
|
||||
oneof solution {
|
||||
challenges.HashcashSolution hashcash = 1;
|
||||
challenges.CodeSolution code = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message LoginRequest {
|
||||
ClientInfo client_info = 1;
|
||||
bytes login_context = 2;
|
||||
ChallengeSolutions challenge_solutions = 3;
|
||||
|
||||
oneof login_method {
|
||||
credentials.StoredCredential stored_credential = 100;
|
||||
credentials.Password password = 101;
|
||||
credentials.FacebookAccessToken facebook_access_token = 102;
|
||||
identifiers.PhoneNumber phone_number = 103;
|
||||
credentials.OneTimeToken one_time_token = 104;
|
||||
credentials.ParentChildCredential parent_child_credential = 105;
|
||||
credentials.AppleSignInCredential apple_sign_in_credential = 106;
|
||||
credentials.SamsungSignInCredential samsung_sign_in_credential = 107;
|
||||
credentials.GoogleSignInCredential google_sign_in_credential = 108;
|
||||
}
|
||||
}
|
||||
|
||||
message LoginOk {
|
||||
string username = 1;
|
||||
string access_token = 2;
|
||||
bytes stored_credential = 3;
|
||||
int32 access_token_expires_in = 4;
|
||||
}
|
||||
|
||||
message LoginResponse {
|
||||
repeated Warnings warnings = 4;
|
||||
enum Warnings {
|
||||
UNKNOWN_WARNING = 0;
|
||||
DEPRECATED_PROTOCOL_VERSION = 1;
|
||||
}
|
||||
|
||||
bytes login_context = 5;
|
||||
string identifier_token = 6;
|
||||
UserInfo user_info = 7;
|
||||
|
||||
oneof response {
|
||||
LoginOk ok = 1;
|
||||
LoginError error = 2;
|
||||
Challenges challenges = 3;
|
||||
}
|
||||
}
|
||||
|
||||
enum LoginError {
|
||||
UNKNOWN_ERROR = 0;
|
||||
INVALID_CREDENTIALS = 1;
|
||||
BAD_REQUEST = 2;
|
||||
UNSUPPORTED_LOGIN_PROTOCOL = 3;
|
||||
TIMEOUT = 4;
|
||||
UNKNOWN_IDENTIFIER = 5;
|
||||
TOO_MANY_ATTEMPTS = 6;
|
||||
INVALID_PHONENUMBER = 7;
|
||||
TRY_AGAIN_LATER = 8;
|
||||
}
|
242
src/inputs/librespot-c/src/proto/login5_challenges_code.pb-c.c
Normal file
242
src/inputs/librespot-c/src/proto/login5_challenges_code.pb-c.c
Normal file
@ -0,0 +1,242 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_challenges_code.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5_challenges_code.pb-c.h"
|
||||
void spotify__login5__v3__challenges__code_challenge__init
|
||||
(Spotify__Login5__V3__Challenges__CodeChallenge *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Challenges__CodeChallenge init_value = SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__code_challenge__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_challenge__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__code_challenge__pack
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_challenge__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__code_challenge__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_challenge__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Challenges__CodeChallenge *
|
||||
spotify__login5__v3__challenges__code_challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Challenges__CodeChallenge *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenges__code_challenge__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenges__code_challenge__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_challenge__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__challenges__code_solution__init
|
||||
(Spotify__Login5__V3__Challenges__CodeSolution *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Challenges__CodeSolution init_value = SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_SOLUTION__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__code_solution__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_solution__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__code_solution__pack
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_solution__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__code_solution__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_solution__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Challenges__CodeSolution *
|
||||
spotify__login5__v3__challenges__code_solution__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Challenges__CodeSolution *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenges__code_solution__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenges__code_solution__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__code_solution__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCEnumValue spotify__login5__v3__challenges__code_challenge__method__enum_values_by_number[2] =
|
||||
{
|
||||
{ "UNKNOWN", "SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__METHOD__UNKNOWN", 0 },
|
||||
{ "SMS", "SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__METHOD__SMS", 1 },
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenges__code_challenge__method__value_ranges[] = {
|
||||
{0, 0},{0, 2}
|
||||
};
|
||||
static const ProtobufCEnumValueIndex spotify__login5__v3__challenges__code_challenge__method__enum_values_by_name[2] =
|
||||
{
|
||||
{ "SMS", 1 },
|
||||
{ "UNKNOWN", 0 },
|
||||
};
|
||||
const ProtobufCEnumDescriptor spotify__login5__v3__challenges__code_challenge__method__descriptor =
|
||||
{
|
||||
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.challenges.CodeChallenge.Method",
|
||||
"Method",
|
||||
"Spotify__Login5__V3__Challenges__CodeChallenge__Method",
|
||||
"spotify.login5.v3.challenges",
|
||||
2,
|
||||
spotify__login5__v3__challenges__code_challenge__method__enum_values_by_number,
|
||||
2,
|
||||
spotify__login5__v3__challenges__code_challenge__method__enum_values_by_name,
|
||||
1,
|
||||
spotify__login5__v3__challenges__code_challenge__method__value_ranges,
|
||||
NULL,NULL,NULL,NULL /* reserved[1234] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenges__code_challenge__field_descriptors[4] =
|
||||
{
|
||||
{
|
||||
"method",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_ENUM,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__CodeChallenge, method),
|
||||
&spotify__login5__v3__challenges__code_challenge__method__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"code_length",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_INT32,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__CodeChallenge, code_length),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"expires_in",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_INT32,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__CodeChallenge, expires_in),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"canonical_phone_number",
|
||||
4,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__CodeChallenge, canonical_phone_number),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenges__code_challenge__field_indices_by_name[] = {
|
||||
3, /* field[3] = canonical_phone_number */
|
||||
1, /* field[1] = code_length */
|
||||
2, /* field[2] = expires_in */
|
||||
0, /* field[0] = method */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenges__code_challenge__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 4 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenges__code_challenge__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.challenges.CodeChallenge",
|
||||
"CodeChallenge",
|
||||
"Spotify__Login5__V3__Challenges__CodeChallenge",
|
||||
"spotify.login5.v3.challenges",
|
||||
sizeof(Spotify__Login5__V3__Challenges__CodeChallenge),
|
||||
4,
|
||||
spotify__login5__v3__challenges__code_challenge__field_descriptors,
|
||||
spotify__login5__v3__challenges__code_challenge__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenges__code_challenge__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenges__code_challenge__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenges__code_solution__field_descriptors[1] =
|
||||
{
|
||||
{
|
||||
"code",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__CodeSolution, code),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenges__code_solution__field_indices_by_name[] = {
|
||||
0, /* field[0] = code */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenges__code_solution__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenges__code_solution__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.challenges.CodeSolution",
|
||||
"CodeSolution",
|
||||
"Spotify__Login5__V3__Challenges__CodeSolution",
|
||||
"spotify.login5.v3.challenges",
|
||||
sizeof(Spotify__Login5__V3__Challenges__CodeSolution),
|
||||
1,
|
||||
spotify__login5__v3__challenges__code_solution__field_descriptors,
|
||||
spotify__login5__v3__challenges__code_solution__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenges__code_solution__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenges__code_solution__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
114
src/inputs/librespot-c/src/proto/login5_challenges_code.pb-c.h
Normal file
114
src/inputs/librespot-c/src/proto/login5_challenges_code.pb-c.h
Normal file
@ -0,0 +1,114 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_challenges_code.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_5fchallenges_5fcode_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_5fchallenges_5fcode_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Login5__V3__Challenges__CodeChallenge Spotify__Login5__V3__Challenges__CodeChallenge;
|
||||
typedef struct Spotify__Login5__V3__Challenges__CodeSolution Spotify__Login5__V3__Challenges__CodeSolution;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
typedef enum _Spotify__Login5__V3__Challenges__CodeChallenge__Method {
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__METHOD__UNKNOWN = 0,
|
||||
SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__METHOD__SMS = 1
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__METHOD)
|
||||
} Spotify__Login5__V3__Challenges__CodeChallenge__Method;
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__Challenges__CodeChallenge
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Login5__V3__Challenges__CodeChallenge__Method method;
|
||||
int32_t code_length;
|
||||
int32_t expires_in;
|
||||
char *canonical_phone_number;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenges__code_challenge__descriptor) \
|
||||
, SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_CHALLENGE__METHOD__UNKNOWN, 0, 0, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Challenges__CodeSolution
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *code;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGES__CODE_SOLUTION__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenges__code_solution__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__Challenges__CodeChallenge methods */
|
||||
void spotify__login5__v3__challenges__code_challenge__init
|
||||
(Spotify__Login5__V3__Challenges__CodeChallenge *message);
|
||||
size_t spotify__login5__v3__challenges__code_challenge__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message);
|
||||
size_t spotify__login5__v3__challenges__code_challenge__pack
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenges__code_challenge__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Challenges__CodeChallenge *
|
||||
spotify__login5__v3__challenges__code_challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenges__code_challenge__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Challenges__CodeSolution methods */
|
||||
void spotify__login5__v3__challenges__code_solution__init
|
||||
(Spotify__Login5__V3__Challenges__CodeSolution *message);
|
||||
size_t spotify__login5__v3__challenges__code_solution__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message);
|
||||
size_t spotify__login5__v3__challenges__code_solution__pack
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenges__code_solution__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Challenges__CodeSolution *
|
||||
spotify__login5__v3__challenges__code_solution__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenges__code_solution__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__Challenges__CodeChallenge_Closure)
|
||||
(const Spotify__Login5__V3__Challenges__CodeChallenge *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Challenges__CodeSolution_Closure)
|
||||
(const Spotify__Login5__V3__Challenges__CodeSolution *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenges__code_challenge__descriptor;
|
||||
extern const ProtobufCEnumDescriptor spotify__login5__v3__challenges__code_challenge__method__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenges__code_solution__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_5fchallenges_5fcode_2eproto__INCLUDED */
|
@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3.challenges;
|
||||
|
||||
message CodeChallenge {
|
||||
Method method = 1;
|
||||
enum Method {
|
||||
UNKNOWN = 0;
|
||||
SMS = 1;
|
||||
}
|
||||
|
||||
int32 code_length = 2;
|
||||
int32 expires_in = 3;
|
||||
string canonical_phone_number = 4;
|
||||
}
|
||||
|
||||
message CodeSolution {
|
||||
string code = 1;
|
||||
}
|
@ -0,0 +1,201 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_challenges_hashcash.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5_challenges_hashcash.pb-c.h"
|
||||
void spotify__login5__v3__challenges__hashcash_challenge__init
|
||||
(Spotify__Login5__V3__Challenges__HashcashChallenge *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Challenges__HashcashChallenge init_value = SPOTIFY__LOGIN5__V3__CHALLENGES__HASHCASH_CHALLENGE__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__hashcash_challenge__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_challenge__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__hashcash_challenge__pack
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_challenge__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__hashcash_challenge__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_challenge__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Challenges__HashcashChallenge *
|
||||
spotify__login5__v3__challenges__hashcash_challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Challenges__HashcashChallenge *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenges__hashcash_challenge__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenges__hashcash_challenge__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_challenge__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__challenges__hashcash_solution__init
|
||||
(Spotify__Login5__V3__Challenges__HashcashSolution *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Challenges__HashcashSolution init_value = SPOTIFY__LOGIN5__V3__CHALLENGES__HASHCASH_SOLUTION__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__hashcash_solution__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_solution__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__hashcash_solution__pack
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_solution__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__challenges__hashcash_solution__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_solution__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Challenges__HashcashSolution *
|
||||
spotify__login5__v3__challenges__hashcash_solution__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Challenges__HashcashSolution *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__challenges__hashcash_solution__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__challenges__hashcash_solution__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__challenges__hashcash_solution__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenges__hashcash_challenge__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"prefix",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__HashcashChallenge, prefix),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"length",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_INT32,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__HashcashChallenge, length),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenges__hashcash_challenge__field_indices_by_name[] = {
|
||||
1, /* field[1] = length */
|
||||
0, /* field[0] = prefix */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenges__hashcash_challenge__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenges__hashcash_challenge__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.challenges.HashcashChallenge",
|
||||
"HashcashChallenge",
|
||||
"Spotify__Login5__V3__Challenges__HashcashChallenge",
|
||||
"spotify.login5.v3.challenges",
|
||||
sizeof(Spotify__Login5__V3__Challenges__HashcashChallenge),
|
||||
2,
|
||||
spotify__login5__v3__challenges__hashcash_challenge__field_descriptors,
|
||||
spotify__login5__v3__challenges__hashcash_challenge__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenges__hashcash_challenge__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenges__hashcash_challenge__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__challenges__hashcash_solution__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"suffix",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__HashcashSolution, suffix),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"duration",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Challenges__HashcashSolution, duration),
|
||||
&google__protobuf__duration__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__challenges__hashcash_solution__field_indices_by_name[] = {
|
||||
1, /* field[1] = duration */
|
||||
0, /* field[0] = suffix */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__challenges__hashcash_solution__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__challenges__hashcash_solution__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.challenges.HashcashSolution",
|
||||
"HashcashSolution",
|
||||
"Spotify__Login5__V3__Challenges__HashcashSolution",
|
||||
"spotify.login5.v3.challenges",
|
||||
sizeof(Spotify__Login5__V3__Challenges__HashcashSolution),
|
||||
2,
|
||||
spotify__login5__v3__challenges__hashcash_solution__field_descriptors,
|
||||
spotify__login5__v3__challenges__hashcash_solution__field_indices_by_name,
|
||||
1, spotify__login5__v3__challenges__hashcash_solution__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__challenges__hashcash_solution__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
@ -0,0 +1,108 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_challenges_hashcash.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_5fchallenges_5fhashcash_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_5fchallenges_5fhashcash_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
#include "google_duration.pb-c.h"
|
||||
|
||||
typedef struct Spotify__Login5__V3__Challenges__HashcashChallenge Spotify__Login5__V3__Challenges__HashcashChallenge;
|
||||
typedef struct Spotify__Login5__V3__Challenges__HashcashSolution Spotify__Login5__V3__Challenges__HashcashSolution;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__Challenges__HashcashChallenge
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
ProtobufCBinaryData prefix;
|
||||
int32_t length;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGES__HASHCASH_CHALLENGE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenges__hashcash_challenge__descriptor) \
|
||||
, {0,NULL}, 0 }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Challenges__HashcashSolution
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
ProtobufCBinaryData suffix;
|
||||
Google__Protobuf__Duration *duration;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CHALLENGES__HASHCASH_SOLUTION__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__challenges__hashcash_solution__descriptor) \
|
||||
, {0,NULL}, NULL }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__Challenges__HashcashChallenge methods */
|
||||
void spotify__login5__v3__challenges__hashcash_challenge__init
|
||||
(Spotify__Login5__V3__Challenges__HashcashChallenge *message);
|
||||
size_t spotify__login5__v3__challenges__hashcash_challenge__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message);
|
||||
size_t spotify__login5__v3__challenges__hashcash_challenge__pack
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenges__hashcash_challenge__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Challenges__HashcashChallenge *
|
||||
spotify__login5__v3__challenges__hashcash_challenge__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenges__hashcash_challenge__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Challenges__HashcashSolution methods */
|
||||
void spotify__login5__v3__challenges__hashcash_solution__init
|
||||
(Spotify__Login5__V3__Challenges__HashcashSolution *message);
|
||||
size_t spotify__login5__v3__challenges__hashcash_solution__get_packed_size
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message);
|
||||
size_t spotify__login5__v3__challenges__hashcash_solution__pack
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__challenges__hashcash_solution__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Challenges__HashcashSolution *
|
||||
spotify__login5__v3__challenges__hashcash_solution__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__challenges__hashcash_solution__free_unpacked
|
||||
(Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__Challenges__HashcashChallenge_Closure)
|
||||
(const Spotify__Login5__V3__Challenges__HashcashChallenge *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Challenges__HashcashSolution_Closure)
|
||||
(const Spotify__Login5__V3__Challenges__HashcashSolution *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenges__hashcash_challenge__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__challenges__hashcash_solution__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_5fchallenges_5fhashcash_2eproto__INCLUDED */
|
@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3.challenges;
|
||||
|
||||
import "google_duration.proto";
|
||||
|
||||
message HashcashChallenge {
|
||||
bytes prefix = 1;
|
||||
int32 length = 2;
|
||||
}
|
||||
|
||||
message HashcashSolution {
|
||||
bytes suffix = 1;
|
||||
google.protobuf.Duration duration = 2;
|
||||
}
|
105
src/inputs/librespot-c/src/proto/login5_client_info.pb-c.c
Normal file
105
src/inputs/librespot-c/src/proto/login5_client_info.pb-c.c
Normal file
@ -0,0 +1,105 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_client_info.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5_client_info.pb-c.h"
|
||||
void spotify__login5__v3__client_info__init
|
||||
(Spotify__Login5__V3__ClientInfo *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__ClientInfo init_value = SPOTIFY__LOGIN5__V3__CLIENT_INFO__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__client_info__get_packed_size
|
||||
(const Spotify__Login5__V3__ClientInfo *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__client_info__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__client_info__pack
|
||||
(const Spotify__Login5__V3__ClientInfo *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__client_info__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__client_info__pack_to_buffer
|
||||
(const Spotify__Login5__V3__ClientInfo *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__client_info__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__ClientInfo *
|
||||
spotify__login5__v3__client_info__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__ClientInfo *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__client_info__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__client_info__free_unpacked
|
||||
(Spotify__Login5__V3__ClientInfo *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__client_info__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__client_info__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"client_id",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__ClientInfo, client_id),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"device_id",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__ClientInfo, device_id),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__client_info__field_indices_by_name[] = {
|
||||
0, /* field[0] = client_id */
|
||||
1, /* field[1] = device_id */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__client_info__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__client_info__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.ClientInfo",
|
||||
"ClientInfo",
|
||||
"Spotify__Login5__V3__ClientInfo",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__ClientInfo),
|
||||
2,
|
||||
spotify__login5__v3__client_info__field_descriptors,
|
||||
spotify__login5__v3__client_info__field_indices_by_name,
|
||||
1, spotify__login5__v3__client_info__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__client_info__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
72
src/inputs/librespot-c/src/proto/login5_client_info.pb-c.h
Normal file
72
src/inputs/librespot-c/src/proto/login5_client_info.pb-c.h
Normal file
@ -0,0 +1,72 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_client_info.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_5fclient_5finfo_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_5fclient_5finfo_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Login5__V3__ClientInfo Spotify__Login5__V3__ClientInfo;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__ClientInfo
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *client_id;
|
||||
char *device_id;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CLIENT_INFO__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__client_info__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__ClientInfo methods */
|
||||
void spotify__login5__v3__client_info__init
|
||||
(Spotify__Login5__V3__ClientInfo *message);
|
||||
size_t spotify__login5__v3__client_info__get_packed_size
|
||||
(const Spotify__Login5__V3__ClientInfo *message);
|
||||
size_t spotify__login5__v3__client_info__pack
|
||||
(const Spotify__Login5__V3__ClientInfo *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__client_info__pack_to_buffer
|
||||
(const Spotify__Login5__V3__ClientInfo *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__ClientInfo *
|
||||
spotify__login5__v3__client_info__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__client_info__free_unpacked
|
||||
(Spotify__Login5__V3__ClientInfo *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__ClientInfo_Closure)
|
||||
(const Spotify__Login5__V3__ClientInfo *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__client_info__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_5fclient_5finfo_2eproto__INCLUDED */
|
@ -0,0 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3;
|
||||
|
||||
message ClientInfo {
|
||||
string client_id = 1;
|
||||
string device_id = 2;
|
||||
}
|
816
src/inputs/librespot-c/src/proto/login5_credentials.pb-c.c
Normal file
816
src/inputs/librespot-c/src/proto/login5_credentials.pb-c.c
Normal file
@ -0,0 +1,816 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_credentials.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5_credentials.pb-c.h"
|
||||
void spotify__login5__v3__credentials__stored_credential__init
|
||||
(Spotify__Login5__V3__Credentials__StoredCredential *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__StoredCredential init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__STORED_CREDENTIAL__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__stored_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__stored_credential__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__stored_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__stored_credential__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__stored_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__stored_credential__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__StoredCredential *
|
||||
spotify__login5__v3__credentials__stored_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__StoredCredential *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__stored_credential__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__stored_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__stored_credential__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__password__init
|
||||
(Spotify__Login5__V3__Credentials__Password *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__Password init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__PASSWORD__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__password__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__Password *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__password__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__password__pack
|
||||
(const Spotify__Login5__V3__Credentials__Password *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__password__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__password__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__Password *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__password__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__Password *
|
||||
spotify__login5__v3__credentials__password__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__Password *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__password__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__password__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__Password *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__password__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__facebook_access_token__init
|
||||
(Spotify__Login5__V3__Credentials__FacebookAccessToken *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__FacebookAccessToken init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__FACEBOOK_ACCESS_TOKEN__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__facebook_access_token__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__facebook_access_token__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__facebook_access_token__pack
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__facebook_access_token__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__facebook_access_token__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__facebook_access_token__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__FacebookAccessToken *
|
||||
spotify__login5__v3__credentials__facebook_access_token__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__FacebookAccessToken *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__facebook_access_token__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__facebook_access_token__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__facebook_access_token__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__one_time_token__init
|
||||
(Spotify__Login5__V3__Credentials__OneTimeToken *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__OneTimeToken init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__ONE_TIME_TOKEN__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__one_time_token__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__one_time_token__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__one_time_token__pack
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__one_time_token__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__one_time_token__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__one_time_token__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__OneTimeToken *
|
||||
spotify__login5__v3__credentials__one_time_token__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__OneTimeToken *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__one_time_token__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__one_time_token__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__one_time_token__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__parent_child_credential__init
|
||||
(Spotify__Login5__V3__Credentials__ParentChildCredential *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__ParentChildCredential init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__PARENT_CHILD_CREDENTIAL__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__parent_child_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__parent_child_credential__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__parent_child_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__parent_child_credential__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__parent_child_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__parent_child_credential__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__ParentChildCredential *
|
||||
spotify__login5__v3__credentials__parent_child_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__ParentChildCredential *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__parent_child_credential__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__parent_child_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__parent_child_credential__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__apple_sign_in_credential__init
|
||||
(Spotify__Login5__V3__Credentials__AppleSignInCredential *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__AppleSignInCredential init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__APPLE_SIGN_IN_CREDENTIAL__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__apple_sign_in_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__apple_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__apple_sign_in_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__apple_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__apple_sign_in_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__apple_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__AppleSignInCredential *
|
||||
spotify__login5__v3__credentials__apple_sign_in_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__AppleSignInCredential *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__apple_sign_in_credential__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__apple_sign_in_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__apple_sign_in_credential__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__samsung_sign_in_credential__init
|
||||
(Spotify__Login5__V3__Credentials__SamsungSignInCredential *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__SamsungSignInCredential init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__SAMSUNG_SIGN_IN_CREDENTIAL__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__samsung_sign_in_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__samsung_sign_in_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__samsung_sign_in_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__SamsungSignInCredential *
|
||||
spotify__login5__v3__credentials__samsung_sign_in_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__SamsungSignInCredential *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__samsung_sign_in_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
void spotify__login5__v3__credentials__google_sign_in_credential__init
|
||||
(Spotify__Login5__V3__Credentials__GoogleSignInCredential *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Credentials__GoogleSignInCredential init_value = SPOTIFY__LOGIN5__V3__CREDENTIALS__GOOGLE_SIGN_IN_CREDENTIAL__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__google_sign_in_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__google_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__google_sign_in_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__google_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__credentials__google_sign_in_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__google_sign_in_credential__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Credentials__GoogleSignInCredential *
|
||||
spotify__login5__v3__credentials__google_sign_in_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Credentials__GoogleSignInCredential *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__credentials__google_sign_in_credential__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__credentials__google_sign_in_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__credentials__google_sign_in_credential__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__stored_credential__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"username",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__StoredCredential, username),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"data",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__StoredCredential, data),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__stored_credential__field_indices_by_name[] = {
|
||||
1, /* field[1] = data */
|
||||
0, /* field[0] = username */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__stored_credential__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__stored_credential__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.StoredCredential",
|
||||
"StoredCredential",
|
||||
"Spotify__Login5__V3__Credentials__StoredCredential",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__StoredCredential),
|
||||
2,
|
||||
spotify__login5__v3__credentials__stored_credential__field_descriptors,
|
||||
spotify__login5__v3__credentials__stored_credential__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__stored_credential__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__stored_credential__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__password__field_descriptors[3] =
|
||||
{
|
||||
{
|
||||
"id",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__Password, id),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"password",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__Password, password),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"padding",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__Password, padding),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__password__field_indices_by_name[] = {
|
||||
0, /* field[0] = id */
|
||||
2, /* field[2] = padding */
|
||||
1, /* field[1] = password */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__password__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 3 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__password__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.Password",
|
||||
"Password",
|
||||
"Spotify__Login5__V3__Credentials__Password",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__Password),
|
||||
3,
|
||||
spotify__login5__v3__credentials__password__field_descriptors,
|
||||
spotify__login5__v3__credentials__password__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__password__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__password__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__facebook_access_token__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"fb_uid",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__FacebookAccessToken, fb_uid),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"access_token",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__FacebookAccessToken, access_token),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__facebook_access_token__field_indices_by_name[] = {
|
||||
1, /* field[1] = access_token */
|
||||
0, /* field[0] = fb_uid */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__facebook_access_token__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__facebook_access_token__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.FacebookAccessToken",
|
||||
"FacebookAccessToken",
|
||||
"Spotify__Login5__V3__Credentials__FacebookAccessToken",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__FacebookAccessToken),
|
||||
2,
|
||||
spotify__login5__v3__credentials__facebook_access_token__field_descriptors,
|
||||
spotify__login5__v3__credentials__facebook_access_token__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__facebook_access_token__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__facebook_access_token__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__one_time_token__field_descriptors[1] =
|
||||
{
|
||||
{
|
||||
"token",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__OneTimeToken, token),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__one_time_token__field_indices_by_name[] = {
|
||||
0, /* field[0] = token */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__one_time_token__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 1 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__one_time_token__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.OneTimeToken",
|
||||
"OneTimeToken",
|
||||
"Spotify__Login5__V3__Credentials__OneTimeToken",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__OneTimeToken),
|
||||
1,
|
||||
spotify__login5__v3__credentials__one_time_token__field_descriptors,
|
||||
spotify__login5__v3__credentials__one_time_token__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__one_time_token__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__one_time_token__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__parent_child_credential__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"child_id",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__ParentChildCredential, child_id),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"parent_stored_credential",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_MESSAGE,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__ParentChildCredential, parent_stored_credential),
|
||||
&spotify__login5__v3__credentials__stored_credential__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__parent_child_credential__field_indices_by_name[] = {
|
||||
0, /* field[0] = child_id */
|
||||
1, /* field[1] = parent_stored_credential */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__parent_child_credential__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__parent_child_credential__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.ParentChildCredential",
|
||||
"ParentChildCredential",
|
||||
"Spotify__Login5__V3__Credentials__ParentChildCredential",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__ParentChildCredential),
|
||||
2,
|
||||
spotify__login5__v3__credentials__parent_child_credential__field_descriptors,
|
||||
spotify__login5__v3__credentials__parent_child_credential__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__parent_child_credential__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__parent_child_credential__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__apple_sign_in_credential__field_descriptors[3] =
|
||||
{
|
||||
{
|
||||
"auth_code",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__AppleSignInCredential, auth_code),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"redirect_uri",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__AppleSignInCredential, redirect_uri),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"bundle_id",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__AppleSignInCredential, bundle_id),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__apple_sign_in_credential__field_indices_by_name[] = {
|
||||
0, /* field[0] = auth_code */
|
||||
2, /* field[2] = bundle_id */
|
||||
1, /* field[1] = redirect_uri */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__apple_sign_in_credential__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 3 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__apple_sign_in_credential__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.AppleSignInCredential",
|
||||
"AppleSignInCredential",
|
||||
"Spotify__Login5__V3__Credentials__AppleSignInCredential",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__AppleSignInCredential),
|
||||
3,
|
||||
spotify__login5__v3__credentials__apple_sign_in_credential__field_descriptors,
|
||||
spotify__login5__v3__credentials__apple_sign_in_credential__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__apple_sign_in_credential__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__apple_sign_in_credential__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__samsung_sign_in_credential__field_descriptors[4] =
|
||||
{
|
||||
{
|
||||
"auth_code",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__SamsungSignInCredential, auth_code),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"redirect_uri",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__SamsungSignInCredential, redirect_uri),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"id_token",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__SamsungSignInCredential, id_token),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"token_endpoint_url",
|
||||
4,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__SamsungSignInCredential, token_endpoint_url),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__samsung_sign_in_credential__field_indices_by_name[] = {
|
||||
0, /* field[0] = auth_code */
|
||||
2, /* field[2] = id_token */
|
||||
1, /* field[1] = redirect_uri */
|
||||
3, /* field[3] = token_endpoint_url */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__samsung_sign_in_credential__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 4 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.SamsungSignInCredential",
|
||||
"SamsungSignInCredential",
|
||||
"Spotify__Login5__V3__Credentials__SamsungSignInCredential",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__SamsungSignInCredential),
|
||||
4,
|
||||
spotify__login5__v3__credentials__samsung_sign_in_credential__field_descriptors,
|
||||
spotify__login5__v3__credentials__samsung_sign_in_credential__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__samsung_sign_in_credential__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__samsung_sign_in_credential__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__credentials__google_sign_in_credential__field_descriptors[2] =
|
||||
{
|
||||
{
|
||||
"auth_code",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__GoogleSignInCredential, auth_code),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"redirect_uri",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Credentials__GoogleSignInCredential, redirect_uri),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__credentials__google_sign_in_credential__field_indices_by_name[] = {
|
||||
0, /* field[0] = auth_code */
|
||||
1, /* field[1] = redirect_uri */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__credentials__google_sign_in_credential__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 2 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__credentials__google_sign_in_credential__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.credentials.GoogleSignInCredential",
|
||||
"GoogleSignInCredential",
|
||||
"Spotify__Login5__V3__Credentials__GoogleSignInCredential",
|
||||
"spotify.login5.v3.credentials",
|
||||
sizeof(Spotify__Login5__V3__Credentials__GoogleSignInCredential),
|
||||
2,
|
||||
spotify__login5__v3__credentials__google_sign_in_credential__field_descriptors,
|
||||
spotify__login5__v3__credentials__google_sign_in_credential__field_indices_by_name,
|
||||
1, spotify__login5__v3__credentials__google_sign_in_credential__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__credentials__google_sign_in_credential__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
320
src/inputs/librespot-c/src/proto/login5_credentials.pb-c.h
Normal file
320
src/inputs/librespot-c/src/proto/login5_credentials.pb-c.h
Normal file
@ -0,0 +1,320 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_credentials.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_5fcredentials_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_5fcredentials_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Login5__V3__Credentials__StoredCredential Spotify__Login5__V3__Credentials__StoredCredential;
|
||||
typedef struct Spotify__Login5__V3__Credentials__Password Spotify__Login5__V3__Credentials__Password;
|
||||
typedef struct Spotify__Login5__V3__Credentials__FacebookAccessToken Spotify__Login5__V3__Credentials__FacebookAccessToken;
|
||||
typedef struct Spotify__Login5__V3__Credentials__OneTimeToken Spotify__Login5__V3__Credentials__OneTimeToken;
|
||||
typedef struct Spotify__Login5__V3__Credentials__ParentChildCredential Spotify__Login5__V3__Credentials__ParentChildCredential;
|
||||
typedef struct Spotify__Login5__V3__Credentials__AppleSignInCredential Spotify__Login5__V3__Credentials__AppleSignInCredential;
|
||||
typedef struct Spotify__Login5__V3__Credentials__SamsungSignInCredential Spotify__Login5__V3__Credentials__SamsungSignInCredential;
|
||||
typedef struct Spotify__Login5__V3__Credentials__GoogleSignInCredential Spotify__Login5__V3__Credentials__GoogleSignInCredential;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__StoredCredential
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *username;
|
||||
ProtobufCBinaryData data;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__STORED_CREDENTIAL__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__stored_credential__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, {0,NULL} }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__Password
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *id;
|
||||
char *password;
|
||||
ProtobufCBinaryData padding;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__PASSWORD__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__password__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, {0,NULL} }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__FacebookAccessToken
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *fb_uid;
|
||||
char *access_token;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__FACEBOOK_ACCESS_TOKEN__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__facebook_access_token__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__OneTimeToken
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *token;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__ONE_TIME_TOKEN__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__one_time_token__descriptor) \
|
||||
, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__ParentChildCredential
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *child_id;
|
||||
Spotify__Login5__V3__Credentials__StoredCredential *parent_stored_credential;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__PARENT_CHILD_CREDENTIAL__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__parent_child_credential__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, NULL }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__AppleSignInCredential
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *auth_code;
|
||||
char *redirect_uri;
|
||||
char *bundle_id;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__APPLE_SIGN_IN_CREDENTIAL__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__apple_sign_in_credential__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__SamsungSignInCredential
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *auth_code;
|
||||
char *redirect_uri;
|
||||
char *id_token;
|
||||
char *token_endpoint_url;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__SAMSUNG_SIGN_IN_CREDENTIAL__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
struct Spotify__Login5__V3__Credentials__GoogleSignInCredential
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *auth_code;
|
||||
char *redirect_uri;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__CREDENTIALS__GOOGLE_SIGN_IN_CREDENTIAL__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__credentials__google_sign_in_credential__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__Credentials__StoredCredential methods */
|
||||
void spotify__login5__v3__credentials__stored_credential__init
|
||||
(Spotify__Login5__V3__Credentials__StoredCredential *message);
|
||||
size_t spotify__login5__v3__credentials__stored_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message);
|
||||
size_t spotify__login5__v3__credentials__stored_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__stored_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__StoredCredential *
|
||||
spotify__login5__v3__credentials__stored_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__stored_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__Password methods */
|
||||
void spotify__login5__v3__credentials__password__init
|
||||
(Spotify__Login5__V3__Credentials__Password *message);
|
||||
size_t spotify__login5__v3__credentials__password__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__Password *message);
|
||||
size_t spotify__login5__v3__credentials__password__pack
|
||||
(const Spotify__Login5__V3__Credentials__Password *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__password__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__Password *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__Password *
|
||||
spotify__login5__v3__credentials__password__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__password__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__Password *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__FacebookAccessToken methods */
|
||||
void spotify__login5__v3__credentials__facebook_access_token__init
|
||||
(Spotify__Login5__V3__Credentials__FacebookAccessToken *message);
|
||||
size_t spotify__login5__v3__credentials__facebook_access_token__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message);
|
||||
size_t spotify__login5__v3__credentials__facebook_access_token__pack
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__facebook_access_token__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__FacebookAccessToken *
|
||||
spotify__login5__v3__credentials__facebook_access_token__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__facebook_access_token__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__OneTimeToken methods */
|
||||
void spotify__login5__v3__credentials__one_time_token__init
|
||||
(Spotify__Login5__V3__Credentials__OneTimeToken *message);
|
||||
size_t spotify__login5__v3__credentials__one_time_token__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message);
|
||||
size_t spotify__login5__v3__credentials__one_time_token__pack
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__one_time_token__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__OneTimeToken *
|
||||
spotify__login5__v3__credentials__one_time_token__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__one_time_token__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__ParentChildCredential methods */
|
||||
void spotify__login5__v3__credentials__parent_child_credential__init
|
||||
(Spotify__Login5__V3__Credentials__ParentChildCredential *message);
|
||||
size_t spotify__login5__v3__credentials__parent_child_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message);
|
||||
size_t spotify__login5__v3__credentials__parent_child_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__parent_child_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__ParentChildCredential *
|
||||
spotify__login5__v3__credentials__parent_child_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__parent_child_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__AppleSignInCredential methods */
|
||||
void spotify__login5__v3__credentials__apple_sign_in_credential__init
|
||||
(Spotify__Login5__V3__Credentials__AppleSignInCredential *message);
|
||||
size_t spotify__login5__v3__credentials__apple_sign_in_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message);
|
||||
size_t spotify__login5__v3__credentials__apple_sign_in_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__apple_sign_in_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__AppleSignInCredential *
|
||||
spotify__login5__v3__credentials__apple_sign_in_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__apple_sign_in_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__SamsungSignInCredential methods */
|
||||
void spotify__login5__v3__credentials__samsung_sign_in_credential__init
|
||||
(Spotify__Login5__V3__Credentials__SamsungSignInCredential *message);
|
||||
size_t spotify__login5__v3__credentials__samsung_sign_in_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message);
|
||||
size_t spotify__login5__v3__credentials__samsung_sign_in_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__samsung_sign_in_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__SamsungSignInCredential *
|
||||
spotify__login5__v3__credentials__samsung_sign_in_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__samsung_sign_in_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* Spotify__Login5__V3__Credentials__GoogleSignInCredential methods */
|
||||
void spotify__login5__v3__credentials__google_sign_in_credential__init
|
||||
(Spotify__Login5__V3__Credentials__GoogleSignInCredential *message);
|
||||
size_t spotify__login5__v3__credentials__google_sign_in_credential__get_packed_size
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message);
|
||||
size_t spotify__login5__v3__credentials__google_sign_in_credential__pack
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__credentials__google_sign_in_credential__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Credentials__GoogleSignInCredential *
|
||||
spotify__login5__v3__credentials__google_sign_in_credential__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__credentials__google_sign_in_credential__free_unpacked
|
||||
(Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__Credentials__StoredCredential_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__StoredCredential *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__Password_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__Password *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__FacebookAccessToken_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__FacebookAccessToken *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__OneTimeToken_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__OneTimeToken *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__ParentChildCredential_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__ParentChildCredential *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__AppleSignInCredential_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__AppleSignInCredential *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__SamsungSignInCredential_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__SamsungSignInCredential *message,
|
||||
void *closure_data);
|
||||
typedef void (*Spotify__Login5__V3__Credentials__GoogleSignInCredential_Closure)
|
||||
(const Spotify__Login5__V3__Credentials__GoogleSignInCredential *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__stored_credential__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__password__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__facebook_access_token__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__one_time_token__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__parent_child_credential__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__apple_sign_in_credential__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__samsung_sign_in_credential__descriptor;
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__credentials__google_sign_in_credential__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_5fcredentials_2eproto__INCLUDED */
|
46
src/inputs/librespot-c/src/proto/login5_credentials.proto
Normal file
46
src/inputs/librespot-c/src/proto/login5_credentials.proto
Normal file
@ -0,0 +1,46 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3.credentials;
|
||||
|
||||
message StoredCredential {
|
||||
string username = 1;
|
||||
bytes data = 2;
|
||||
}
|
||||
|
||||
message Password {
|
||||
string id = 1;
|
||||
string password = 2;
|
||||
bytes padding = 3;
|
||||
}
|
||||
|
||||
message FacebookAccessToken {
|
||||
string fb_uid = 1;
|
||||
string access_token = 2;
|
||||
}
|
||||
|
||||
message OneTimeToken {
|
||||
string token = 1;
|
||||
}
|
||||
|
||||
message ParentChildCredential {
|
||||
string child_id = 1;
|
||||
StoredCredential parent_stored_credential = 2;
|
||||
}
|
||||
|
||||
message AppleSignInCredential {
|
||||
string auth_code = 1;
|
||||
string redirect_uri = 2;
|
||||
string bundle_id = 3;
|
||||
}
|
||||
|
||||
message SamsungSignInCredential {
|
||||
string auth_code = 1;
|
||||
string redirect_uri = 2;
|
||||
string id_token = 3;
|
||||
string token_endpoint_url = 4;
|
||||
}
|
||||
|
||||
message GoogleSignInCredential {
|
||||
string auth_code = 1;
|
||||
string redirect_uri = 2;
|
||||
}
|
118
src/inputs/librespot-c/src/proto/login5_identifiers.pb-c.c
Normal file
118
src/inputs/librespot-c/src/proto/login5_identifiers.pb-c.c
Normal file
@ -0,0 +1,118 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_identifiers.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5_identifiers.pb-c.h"
|
||||
void spotify__login5__v3__identifiers__phone_number__init
|
||||
(Spotify__Login5__V3__Identifiers__PhoneNumber *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__Identifiers__PhoneNumber init_value = SPOTIFY__LOGIN5__V3__IDENTIFIERS__PHONE_NUMBER__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__identifiers__phone_number__get_packed_size
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__identifiers__phone_number__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__identifiers__phone_number__pack
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__identifiers__phone_number__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__identifiers__phone_number__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__identifiers__phone_number__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__Identifiers__PhoneNumber *
|
||||
spotify__login5__v3__identifiers__phone_number__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__Identifiers__PhoneNumber *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__identifiers__phone_number__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__identifiers__phone_number__free_unpacked
|
||||
(Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__identifiers__phone_number__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__identifiers__phone_number__field_descriptors[3] =
|
||||
{
|
||||
{
|
||||
"number",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Identifiers__PhoneNumber, number),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"iso_country_code",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Identifiers__PhoneNumber, iso_country_code),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"country_calling_code",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__Identifiers__PhoneNumber, country_calling_code),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__identifiers__phone_number__field_indices_by_name[] = {
|
||||
2, /* field[2] = country_calling_code */
|
||||
1, /* field[1] = iso_country_code */
|
||||
0, /* field[0] = number */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__identifiers__phone_number__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 3 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__identifiers__phone_number__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.identifiers.PhoneNumber",
|
||||
"PhoneNumber",
|
||||
"Spotify__Login5__V3__Identifiers__PhoneNumber",
|
||||
"spotify.login5.v3.identifiers",
|
||||
sizeof(Spotify__Login5__V3__Identifiers__PhoneNumber),
|
||||
3,
|
||||
spotify__login5__v3__identifiers__phone_number__field_descriptors,
|
||||
spotify__login5__v3__identifiers__phone_number__field_indices_by_name,
|
||||
1, spotify__login5__v3__identifiers__phone_number__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__identifiers__phone_number__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
73
src/inputs/librespot-c/src/proto/login5_identifiers.pb-c.h
Normal file
73
src/inputs/librespot-c/src/proto/login5_identifiers.pb-c.h
Normal file
@ -0,0 +1,73 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_identifiers.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_5fidentifiers_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_5fidentifiers_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Login5__V3__Identifiers__PhoneNumber Spotify__Login5__V3__Identifiers__PhoneNumber;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__Identifiers__PhoneNumber
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *number;
|
||||
char *iso_country_code;
|
||||
char *country_calling_code;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__IDENTIFIERS__PHONE_NUMBER__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__identifiers__phone_number__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__Identifiers__PhoneNumber methods */
|
||||
void spotify__login5__v3__identifiers__phone_number__init
|
||||
(Spotify__Login5__V3__Identifiers__PhoneNumber *message);
|
||||
size_t spotify__login5__v3__identifiers__phone_number__get_packed_size
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message);
|
||||
size_t spotify__login5__v3__identifiers__phone_number__pack
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__identifiers__phone_number__pack_to_buffer
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__Identifiers__PhoneNumber *
|
||||
spotify__login5__v3__identifiers__phone_number__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__identifiers__phone_number__free_unpacked
|
||||
(Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__Identifiers__PhoneNumber_Closure)
|
||||
(const Spotify__Login5__V3__Identifiers__PhoneNumber *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__identifiers__phone_number__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_5fidentifiers_2eproto__INCLUDED */
|
@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3.identifiers;
|
||||
|
||||
message PhoneNumber {
|
||||
string number = 1;
|
||||
string iso_country_code = 2;
|
||||
string country_calling_code = 3;
|
||||
}
|
215
src/inputs/librespot-c/src/proto/login5_user_info.pb-c.c
Normal file
215
src/inputs/librespot-c/src/proto/login5_user_info.pb-c.c
Normal file
@ -0,0 +1,215 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_user_info.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "login5_user_info.pb-c.h"
|
||||
void spotify__login5__v3__user_info__init
|
||||
(Spotify__Login5__V3__UserInfo *message)
|
||||
{
|
||||
static const Spotify__Login5__V3__UserInfo init_value = SPOTIFY__LOGIN5__V3__USER_INFO__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__login5__v3__user_info__get_packed_size
|
||||
(const Spotify__Login5__V3__UserInfo *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__user_info__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__login5__v3__user_info__pack
|
||||
(const Spotify__Login5__V3__UserInfo *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__user_info__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__login5__v3__user_info__pack_to_buffer
|
||||
(const Spotify__Login5__V3__UserInfo *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__login5__v3__user_info__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Login5__V3__UserInfo *
|
||||
spotify__login5__v3__user_info__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Login5__V3__UserInfo *)
|
||||
protobuf_c_message_unpack (&spotify__login5__v3__user_info__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__login5__v3__user_info__free_unpacked
|
||||
(Spotify__Login5__V3__UserInfo *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__login5__v3__user_info__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCEnumValue spotify__login5__v3__user_info__gender__enum_values_by_number[4] =
|
||||
{
|
||||
{ "UNKNOWN", "SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__UNKNOWN", 0 },
|
||||
{ "MALE", "SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__MALE", 1 },
|
||||
{ "FEMALE", "SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__FEMALE", 2 },
|
||||
{ "NEUTRAL", "SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__NEUTRAL", 3 },
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__user_info__gender__value_ranges[] = {
|
||||
{0, 0},{0, 4}
|
||||
};
|
||||
static const ProtobufCEnumValueIndex spotify__login5__v3__user_info__gender__enum_values_by_name[4] =
|
||||
{
|
||||
{ "FEMALE", 2 },
|
||||
{ "MALE", 1 },
|
||||
{ "NEUTRAL", 3 },
|
||||
{ "UNKNOWN", 0 },
|
||||
};
|
||||
const ProtobufCEnumDescriptor spotify__login5__v3__user_info__gender__descriptor =
|
||||
{
|
||||
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.UserInfo.Gender",
|
||||
"Gender",
|
||||
"Spotify__Login5__V3__UserInfo__Gender",
|
||||
"spotify.login5.v3",
|
||||
4,
|
||||
spotify__login5__v3__user_info__gender__enum_values_by_number,
|
||||
4,
|
||||
spotify__login5__v3__user_info__gender__enum_values_by_name,
|
||||
1,
|
||||
spotify__login5__v3__user_info__gender__value_ranges,
|
||||
NULL,NULL,NULL,NULL /* reserved[1234] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__login5__v3__user_info__field_descriptors[8] =
|
||||
{
|
||||
{
|
||||
"name",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, name),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"email",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, email),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"email_verified",
|
||||
3,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BOOL,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, email_verified),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"birthdate",
|
||||
4,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, birthdate),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"gender",
|
||||
5,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_ENUM,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, gender),
|
||||
&spotify__login5__v3__user_info__gender__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"phone_number",
|
||||
6,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, phone_number),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"phone_number_verified",
|
||||
7,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BOOL,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, phone_number_verified),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"email_already_registered",
|
||||
8,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BOOL,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Login5__V3__UserInfo, email_already_registered),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__login5__v3__user_info__field_indices_by_name[] = {
|
||||
3, /* field[3] = birthdate */
|
||||
1, /* field[1] = email */
|
||||
7, /* field[7] = email_already_registered */
|
||||
2, /* field[2] = email_verified */
|
||||
4, /* field[4] = gender */
|
||||
0, /* field[0] = name */
|
||||
5, /* field[5] = phone_number */
|
||||
6, /* field[6] = phone_number_verified */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__login5__v3__user_info__number_ranges[1 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 0, 8 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__login5__v3__user_info__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.login5.v3.UserInfo",
|
||||
"UserInfo",
|
||||
"Spotify__Login5__V3__UserInfo",
|
||||
"spotify.login5.v3",
|
||||
sizeof(Spotify__Login5__V3__UserInfo),
|
||||
8,
|
||||
spotify__login5__v3__user_info__field_descriptors,
|
||||
spotify__login5__v3__user_info__field_indices_by_name,
|
||||
1, spotify__login5__v3__user_info__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__login5__v3__user_info__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
86
src/inputs/librespot-c/src/proto/login5_user_info.pb-c.h
Normal file
86
src/inputs/librespot-c/src/proto/login5_user_info.pb-c.h
Normal file
@ -0,0 +1,86 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: login5_user_info.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_login5_5fuser_5finfo_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_login5_5fuser_5finfo_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Login5__V3__UserInfo Spotify__Login5__V3__UserInfo;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
typedef enum _Spotify__Login5__V3__UserInfo__Gender {
|
||||
SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__UNKNOWN = 0,
|
||||
SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__MALE = 1,
|
||||
SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__FEMALE = 2,
|
||||
SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__NEUTRAL = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__LOGIN5__V3__USER_INFO__GENDER)
|
||||
} Spotify__Login5__V3__UserInfo__Gender;
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Login5__V3__UserInfo
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
char *name;
|
||||
char *email;
|
||||
protobuf_c_boolean email_verified;
|
||||
char *birthdate;
|
||||
Spotify__Login5__V3__UserInfo__Gender gender;
|
||||
char *phone_number;
|
||||
protobuf_c_boolean phone_number_verified;
|
||||
protobuf_c_boolean email_already_registered;
|
||||
};
|
||||
#define SPOTIFY__LOGIN5__V3__USER_INFO__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__login5__v3__user_info__descriptor) \
|
||||
, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, 0, (char *)protobuf_c_empty_string, SPOTIFY__LOGIN5__V3__USER_INFO__GENDER__UNKNOWN, (char *)protobuf_c_empty_string, 0, 0 }
|
||||
|
||||
|
||||
/* Spotify__Login5__V3__UserInfo methods */
|
||||
void spotify__login5__v3__user_info__init
|
||||
(Spotify__Login5__V3__UserInfo *message);
|
||||
size_t spotify__login5__v3__user_info__get_packed_size
|
||||
(const Spotify__Login5__V3__UserInfo *message);
|
||||
size_t spotify__login5__v3__user_info__pack
|
||||
(const Spotify__Login5__V3__UserInfo *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__login5__v3__user_info__pack_to_buffer
|
||||
(const Spotify__Login5__V3__UserInfo *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Login5__V3__UserInfo *
|
||||
spotify__login5__v3__user_info__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__login5__v3__user_info__free_unpacked
|
||||
(Spotify__Login5__V3__UserInfo *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Login5__V3__UserInfo_Closure)
|
||||
(const Spotify__Login5__V3__UserInfo *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__login5__v3__user_info__descriptor;
|
||||
extern const ProtobufCEnumDescriptor spotify__login5__v3__user_info__gender__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_login5_5fuser_5finfo_2eproto__INCLUDED */
|
22
src/inputs/librespot-c/src/proto/login5_user_info.proto
Normal file
22
src/inputs/librespot-c/src/proto/login5_user_info.proto
Normal file
@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.login5.v3;
|
||||
|
||||
message UserInfo {
|
||||
string name = 1;
|
||||
string email = 2;
|
||||
bool email_verified = 3;
|
||||
string birthdate = 4;
|
||||
|
||||
Gender gender = 5;
|
||||
enum Gender {
|
||||
UNKNOWN = 0;
|
||||
MALE = 1;
|
||||
FEMALE = 2;
|
||||
NEUTRAL = 3;
|
||||
}
|
||||
|
||||
string phone_number = 6;
|
||||
bool phone_number_verified = 7;
|
||||
bool email_already_registered = 8;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message MergedProfileRequest {
|
||||
}
|
||||
|
||||
message MergedProfileReply {
|
||||
optional string username = 0x1;
|
||||
optional string artistid = 0x2;
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "playlist4ops.proto";
|
||||
import "playlist4meta.proto";
|
||||
import "playlist4content.proto";
|
||||
import "playlist4issues.proto";
|
||||
|
||||
message ChangeInfo {
|
||||
optional string user = 0x1;
|
||||
optional int32 timestamp = 0x2;
|
||||
optional bool admin = 0x3;
|
||||
optional bool undo = 0x4;
|
||||
optional bool redo = 0x5;
|
||||
optional bool merge = 0x6;
|
||||
optional bool compressed = 0x7;
|
||||
optional bool migration = 0x8;
|
||||
}
|
||||
|
||||
message Delta {
|
||||
optional bytes base_version = 0x1;
|
||||
repeated Op ops = 0x2;
|
||||
optional ChangeInfo info = 0x4;
|
||||
}
|
||||
|
||||
message Merge {
|
||||
optional bytes base_version = 0x1;
|
||||
optional bytes merge_version = 0x2;
|
||||
optional ChangeInfo info = 0x4;
|
||||
}
|
||||
|
||||
message ChangeSet {
|
||||
optional Kind kind = 0x1;
|
||||
enum Kind {
|
||||
KIND_UNKNOWN = 0x0;
|
||||
DELTA = 0x2;
|
||||
MERGE = 0x3;
|
||||
}
|
||||
optional Delta delta = 0x2;
|
||||
optional Merge merge = 0x3;
|
||||
}
|
||||
|
||||
message RevisionTaggedChangeSet {
|
||||
optional bytes revision = 0x1;
|
||||
optional ChangeSet change_set = 0x2;
|
||||
}
|
||||
|
||||
message Diff {
|
||||
optional bytes from_revision = 0x1;
|
||||
repeated Op ops = 0x2;
|
||||
optional bytes to_revision = 0x3;
|
||||
}
|
||||
|
||||
message ListDump {
|
||||
optional bytes latestRevision = 0x1;
|
||||
optional int32 length = 0x2;
|
||||
optional ListAttributes attributes = 0x3;
|
||||
optional ListChecksum checksum = 0x4;
|
||||
optional ListItems contents = 0x5;
|
||||
repeated Delta pendingDeltas = 0x7;
|
||||
}
|
||||
|
||||
message ListChanges {
|
||||
optional bytes baseRevision = 0x1;
|
||||
repeated Delta deltas = 0x2;
|
||||
optional bool wantResultingRevisions = 0x3;
|
||||
optional bool wantSyncResult = 0x4;
|
||||
optional ListDump dump = 0x5;
|
||||
repeated int32 nonces = 0x6;
|
||||
}
|
||||
|
||||
message SelectedListContent {
|
||||
optional bytes revision = 0x1;
|
||||
optional int32 length = 0x2;
|
||||
optional ListAttributes attributes = 0x3;
|
||||
optional ListChecksum checksum = 0x4;
|
||||
optional ListItems contents = 0x5;
|
||||
optional Diff diff = 0x6;
|
||||
optional Diff syncResult = 0x7;
|
||||
repeated bytes resultingRevisions = 0x8;
|
||||
optional bool multipleHeads = 0x9;
|
||||
optional bool upToDate = 0xa;
|
||||
repeated ClientResolveAction resolveAction = 0xc;
|
||||
repeated ClientIssue issues = 0xd;
|
||||
repeated int32 nonces = 0xe;
|
||||
optional string owner_username =0x10;
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "playlist4meta.proto";
|
||||
import "playlist4issues.proto";
|
||||
|
||||
message Item {
|
||||
optional string uri = 0x1;
|
||||
optional ItemAttributes attributes = 0x2;
|
||||
}
|
||||
|
||||
message ListItems {
|
||||
optional int32 pos = 0x1;
|
||||
optional bool truncated = 0x2;
|
||||
repeated Item items = 0x3;
|
||||
}
|
||||
|
||||
message ContentRange {
|
||||
optional int32 pos = 0x1;
|
||||
optional int32 length = 0x2;
|
||||
}
|
||||
|
||||
message ListContentSelection {
|
||||
optional bool wantRevision = 0x1;
|
||||
optional bool wantLength = 0x2;
|
||||
optional bool wantAttributes = 0x3;
|
||||
optional bool wantChecksum = 0x4;
|
||||
optional bool wantContent = 0x5;
|
||||
optional ContentRange contentRange = 0x6;
|
||||
optional bool wantDiff = 0x7;
|
||||
optional bytes baseRevision = 0x8;
|
||||
optional bytes hintRevision = 0x9;
|
||||
optional bool wantNothingIfUpToDate = 0xa;
|
||||
optional bool wantResolveAction = 0xc;
|
||||
repeated ClientIssue issues = 0xd;
|
||||
repeated ClientResolveAction resolveAction = 0xe;
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message ClientIssue {
|
||||
optional Level level = 0x1;
|
||||
enum Level {
|
||||
LEVEL_UNKNOWN = 0x0;
|
||||
LEVEL_DEBUG = 0x1;
|
||||
LEVEL_INFO = 0x2;
|
||||
LEVEL_NOTICE = 0x3;
|
||||
LEVEL_WARNING = 0x4;
|
||||
LEVEL_ERROR = 0x5;
|
||||
}
|
||||
optional Code code = 0x2;
|
||||
enum Code {
|
||||
CODE_UNKNOWN = 0x0;
|
||||
CODE_INDEX_OUT_OF_BOUNDS = 0x1;
|
||||
CODE_VERSION_MISMATCH = 0x2;
|
||||
CODE_CACHED_CHANGE = 0x3;
|
||||
CODE_OFFLINE_CHANGE = 0x4;
|
||||
CODE_CONCURRENT_CHANGE = 0x5;
|
||||
}
|
||||
optional int32 repeatCount = 0x3;
|
||||
}
|
||||
|
||||
message ClientResolveAction {
|
||||
optional Code code = 0x1;
|
||||
enum Code {
|
||||
CODE_UNKNOWN = 0x0;
|
||||
CODE_NO_ACTION = 0x1;
|
||||
CODE_RETRY = 0x2;
|
||||
CODE_RELOAD = 0x3;
|
||||
CODE_DISCARD_LOCAL_CHANGES = 0x4;
|
||||
CODE_SEND_DUMP = 0x5;
|
||||
CODE_DISPLAY_ERROR_MESSAGE = 0x6;
|
||||
}
|
||||
optional Initiator initiator = 0x2;
|
||||
enum Initiator {
|
||||
INITIATOR_UNKNOWN = 0x0;
|
||||
INITIATOR_SERVER = 0x1;
|
||||
INITIATOR_CLIENT = 0x2;
|
||||
}
|
||||
}
|
||||
|
@ -1,52 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message ListChecksum {
|
||||
optional int32 version = 0x1;
|
||||
optional bytes sha1 = 0x4;
|
||||
}
|
||||
|
||||
message DownloadFormat {
|
||||
optional Codec codec = 0x1;
|
||||
enum Codec {
|
||||
CODEC_UNKNOWN = 0x0;
|
||||
OGG_VORBIS = 0x1;
|
||||
FLAC = 0x2;
|
||||
MPEG_1_LAYER_3 = 0x3;
|
||||
}
|
||||
}
|
||||
|
||||
message ListAttributes {
|
||||
optional string name = 0x1;
|
||||
optional string description = 0x2;
|
||||
optional bytes picture = 0x3;
|
||||
optional bool collaborative = 0x4;
|
||||
optional string pl3_version = 0x5;
|
||||
optional bool deleted_by_owner = 0x6;
|
||||
optional bool restricted_collaborative = 0x7;
|
||||
optional int64 deprecated_client_id = 0x8;
|
||||
optional bool public_starred = 0x9;
|
||||
optional string client_id = 0xa;
|
||||
}
|
||||
|
||||
message ItemAttributes {
|
||||
optional string added_by = 0x1;
|
||||
optional int64 timestamp = 0x2;
|
||||
optional string message = 0x3;
|
||||
optional bool seen = 0x4;
|
||||
optional int64 download_count = 0x5;
|
||||
optional DownloadFormat download_format = 0x6;
|
||||
optional string sevendigital_id = 0x7;
|
||||
optional int64 sevendigital_left = 0x8;
|
||||
optional int64 seen_at = 0x9;
|
||||
optional bool public = 0xa;
|
||||
}
|
||||
|
||||
message StringAttribute {
|
||||
optional string key = 0x1;
|
||||
optional string value = 0x2;
|
||||
}
|
||||
|
||||
message StringAttributes {
|
||||
repeated StringAttribute attribute = 0x1;
|
||||
}
|
||||
|
@ -1,103 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
import "playlist4meta.proto";
|
||||
import "playlist4content.proto";
|
||||
|
||||
message Add {
|
||||
optional int32 fromIndex = 0x1;
|
||||
repeated Item items = 0x2;
|
||||
optional ListChecksum list_checksum = 0x3;
|
||||
optional bool addLast = 0x4;
|
||||
optional bool addFirst = 0x5;
|
||||
}
|
||||
|
||||
message Rem {
|
||||
optional int32 fromIndex = 0x1;
|
||||
optional int32 length = 0x2;
|
||||
repeated Item items = 0x3;
|
||||
optional ListChecksum list_checksum = 0x4;
|
||||
optional ListChecksum items_checksum = 0x5;
|
||||
optional ListChecksum uris_checksum = 0x6;
|
||||
optional bool itemsAsKey = 0x7;
|
||||
}
|
||||
|
||||
message Mov {
|
||||
optional int32 fromIndex = 0x1;
|
||||
optional int32 length = 0x2;
|
||||
optional int32 toIndex = 0x3;
|
||||
optional ListChecksum list_checksum = 0x4;
|
||||
optional ListChecksum items_checksum = 0x5;
|
||||
optional ListChecksum uris_checksum = 0x6;
|
||||
}
|
||||
|
||||
message ItemAttributesPartialState {
|
||||
optional ItemAttributes values = 0x1;
|
||||
repeated ItemAttributeKind no_value = 0x2;
|
||||
|
||||
enum ItemAttributeKind {
|
||||
ITEM_UNKNOWN = 0x0;
|
||||
ITEM_ADDED_BY = 0x1;
|
||||
ITEM_TIMESTAMP = 0x2;
|
||||
ITEM_MESSAGE = 0x3;
|
||||
ITEM_SEEN = 0x4;
|
||||
ITEM_DOWNLOAD_COUNT = 0x5;
|
||||
ITEM_DOWNLOAD_FORMAT = 0x6;
|
||||
ITEM_SEVENDIGITAL_ID = 0x7;
|
||||
ITEM_SEVENDIGITAL_LEFT = 0x8;
|
||||
ITEM_SEEN_AT = 0x9;
|
||||
ITEM_PUBLIC = 0xa;
|
||||
}
|
||||
}
|
||||
|
||||
message ListAttributesPartialState {
|
||||
optional ListAttributes values = 0x1;
|
||||
repeated ListAttributeKind no_value = 0x2;
|
||||
|
||||
enum ListAttributeKind {
|
||||
LIST_UNKNOWN = 0x0;
|
||||
LIST_NAME = 0x1;
|
||||
LIST_DESCRIPTION = 0x2;
|
||||
LIST_PICTURE = 0x3;
|
||||
LIST_COLLABORATIVE = 0x4;
|
||||
LIST_PL3_VERSION = 0x5;
|
||||
LIST_DELETED_BY_OWNER = 0x6;
|
||||
LIST_RESTRICTED_COLLABORATIVE = 0x7;
|
||||
}
|
||||
}
|
||||
|
||||
message UpdateItemAttributes {
|
||||
optional int32 index = 0x1;
|
||||
optional ItemAttributesPartialState new_attributes = 0x2;
|
||||
optional ItemAttributesPartialState old_attributes = 0x3;
|
||||
optional ListChecksum list_checksum = 0x4;
|
||||
optional ListChecksum old_attributes_checksum = 0x5;
|
||||
}
|
||||
|
||||
message UpdateListAttributes {
|
||||
optional ListAttributesPartialState new_attributes = 0x1;
|
||||
optional ListAttributesPartialState old_attributes = 0x2;
|
||||
optional ListChecksum list_checksum = 0x3;
|
||||
optional ListChecksum old_attributes_checksum = 0x4;
|
||||
}
|
||||
|
||||
message Op {
|
||||
optional Kind kind = 0x1;
|
||||
enum Kind {
|
||||
KIND_UNKNOWN = 0x0;
|
||||
ADD = 0x2;
|
||||
REM = 0x3;
|
||||
MOV = 0x4;
|
||||
UPDATE_ITEM_ATTRIBUTES = 0x5;
|
||||
UPDATE_LIST_ATTRIBUTES = 0x6;
|
||||
}
|
||||
optional Add add = 0x2;
|
||||
optional Rem rem = 0x3;
|
||||
optional Mov mov = 0x4;
|
||||
optional UpdateItemAttributes update_item_attributes = 0x5;
|
||||
optional UpdateListAttributes update_list_attributes = 0x6;
|
||||
}
|
||||
|
||||
message OpList {
|
||||
repeated Op ops = 0x1;
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message PopcountRequest {
|
||||
}
|
||||
|
||||
message PopcountResult {
|
||||
optional sint64 count = 0x1;
|
||||
optional bool truncated = 0x2;
|
||||
repeated string user = 0x3;
|
||||
repeated sint64 subscriptionTimestamps = 0x4;
|
||||
repeated sint64 insertionTimestamps = 0x5;
|
||||
}
|
||||
|
@ -1,94 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message PlaylistPublishedState {
|
||||
optional string uri = 0x1;
|
||||
optional int64 timestamp = 0x2;
|
||||
}
|
||||
|
||||
message PlaylistTrackAddedState {
|
||||
optional string playlist_uri = 0x1;
|
||||
optional string track_uri = 0x2;
|
||||
optional int64 timestamp = 0x3;
|
||||
}
|
||||
|
||||
message TrackFinishedPlayingState {
|
||||
optional string uri = 0x1;
|
||||
optional string context_uri = 0x2;
|
||||
optional int64 timestamp = 0x3;
|
||||
optional string referrer_uri = 0x4;
|
||||
}
|
||||
|
||||
message FavoriteAppAddedState {
|
||||
optional string app_uri = 0x1;
|
||||
optional int64 timestamp = 0x2;
|
||||
}
|
||||
|
||||
message TrackStartedPlayingState {
|
||||
optional string uri = 0x1;
|
||||
optional string context_uri = 0x2;
|
||||
optional int64 timestamp = 0x3;
|
||||
optional string referrer_uri = 0x4;
|
||||
}
|
||||
|
||||
message UriSharedState {
|
||||
optional string uri = 0x1;
|
||||
optional string message = 0x2;
|
||||
optional int64 timestamp = 0x3;
|
||||
}
|
||||
|
||||
message ArtistFollowedState {
|
||||
optional string uri = 0x1;
|
||||
optional string artist_name = 0x2;
|
||||
optional string artist_cover_uri = 0x3;
|
||||
optional int64 timestamp = 0x4;
|
||||
}
|
||||
|
||||
message DeviceInformation {
|
||||
optional string os = 0x1;
|
||||
optional string type = 0x2;
|
||||
}
|
||||
|
||||
message GenericPresenceState {
|
||||
optional int32 type = 0x1;
|
||||
optional int64 timestamp = 0x2;
|
||||
optional string item_uri = 0x3;
|
||||
optional string item_name = 0x4;
|
||||
optional string item_image = 0x5;
|
||||
optional string context_uri = 0x6;
|
||||
optional string context_name = 0x7;
|
||||
optional string context_image = 0x8;
|
||||
optional string referrer_uri = 0x9;
|
||||
optional string referrer_name = 0xa;
|
||||
optional string referrer_image = 0xb;
|
||||
optional string message = 0xc;
|
||||
optional DeviceInformation device_information = 0xd;
|
||||
}
|
||||
|
||||
message State {
|
||||
optional int64 timestamp = 0x1;
|
||||
optional Type type = 0x2;
|
||||
enum Type {
|
||||
PLAYLIST_PUBLISHED = 0x1;
|
||||
PLAYLIST_TRACK_ADDED = 0x2;
|
||||
TRACK_FINISHED_PLAYING = 0x3;
|
||||
FAVORITE_APP_ADDED = 0x4;
|
||||
TRACK_STARTED_PLAYING = 0x5;
|
||||
URI_SHARED = 0x6;
|
||||
ARTIST_FOLLOWED = 0x7;
|
||||
GENERIC = 0xb;
|
||||
}
|
||||
optional string uri = 0x3;
|
||||
optional PlaylistPublishedState playlist_published = 0x4;
|
||||
optional PlaylistTrackAddedState playlist_track_added = 0x5;
|
||||
optional TrackFinishedPlayingState track_finished_playing = 0x6;
|
||||
optional FavoriteAppAddedState favorite_app_added = 0x7;
|
||||
optional TrackStartedPlayingState track_started_playing = 0x8;
|
||||
optional UriSharedState uri_shared = 0x9;
|
||||
optional ArtistFollowedState artist_followed = 0xa;
|
||||
optional GenericPresenceState generic = 0xb;
|
||||
}
|
||||
|
||||
message StateList {
|
||||
repeated State states = 0x1;
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message Subscription {
|
||||
optional string uri = 0x1;
|
||||
optional int32 expiry = 0x2;
|
||||
optional int32 status_code = 0x3;
|
||||
}
|
||||
|
@ -1,58 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message RadioRequest {
|
||||
repeated string uris = 0x1;
|
||||
optional int32 salt = 0x2;
|
||||
optional int32 length = 0x4;
|
||||
optional string stationId = 0x5;
|
||||
repeated string lastTracks = 0x6;
|
||||
}
|
||||
|
||||
message MultiSeedRequest {
|
||||
repeated string uris = 0x1;
|
||||
}
|
||||
|
||||
message Feedback {
|
||||
optional string uri = 0x1;
|
||||
optional string type = 0x2;
|
||||
optional double timestamp = 0x3;
|
||||
}
|
||||
|
||||
message Tracks {
|
||||
repeated string gids = 0x1;
|
||||
optional string source = 0x2;
|
||||
optional string identity = 0x3;
|
||||
repeated string tokens = 0x4;
|
||||
repeated Feedback feedback = 0x5;
|
||||
}
|
||||
|
||||
message Station {
|
||||
optional string id = 0x1;
|
||||
optional string title = 0x2;
|
||||
optional string titleUri = 0x3;
|
||||
optional string subtitle = 0x4;
|
||||
optional string subtitleUri = 0x5;
|
||||
optional string imageUri = 0x6;
|
||||
optional double lastListen = 0x7;
|
||||
repeated string seeds = 0x8;
|
||||
optional int32 thumbsUp = 0x9;
|
||||
optional int32 thumbsDown = 0xa;
|
||||
}
|
||||
|
||||
message Rules {
|
||||
optional string js = 0x1;
|
||||
}
|
||||
|
||||
message StationResponse {
|
||||
optional Station station = 0x1;
|
||||
repeated Feedback feedback = 0x2;
|
||||
}
|
||||
|
||||
message StationList {
|
||||
repeated Station stations = 0x1;
|
||||
}
|
||||
|
||||
message LikedPlaylist {
|
||||
optional string uri = 0x1;
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message SearchRequest {
|
||||
optional string query = 0x1;
|
||||
optional Type type = 0x2;
|
||||
enum Type {
|
||||
TRACK = 0x0;
|
||||
ALBUM = 0x1;
|
||||
ARTIST = 0x2;
|
||||
PLAYLIST = 0x3;
|
||||
USER = 0x4;
|
||||
}
|
||||
optional int32 limit = 0x3;
|
||||
optional int32 offset = 0x4;
|
||||
optional bool did_you_mean = 0x5;
|
||||
optional string spotify_uri = 0x2;
|
||||
repeated bytes file_id = 0x3;
|
||||
optional string url = 0x4;
|
||||
optional string slask_id = 0x5;
|
||||
}
|
||||
|
||||
message Playlist {
|
||||
optional string uri = 0x1;
|
||||
optional string name = 0x2;
|
||||
repeated Image image = 0x3;
|
||||
}
|
||||
|
||||
message User {
|
||||
optional string username = 0x1;
|
||||
optional string full_name = 0x2;
|
||||
repeated Image image = 0x3;
|
||||
optional sint32 followers = 0x4;
|
||||
}
|
||||
|
||||
message SearchReply {
|
||||
optional sint32 hits = 0x1;
|
||||
repeated Track track = 0x2;
|
||||
repeated Album album = 0x3;
|
||||
repeated Artist artist = 0x4;
|
||||
repeated Playlist playlist = 0x5;
|
||||
optional string did_you_mean = 0x6;
|
||||
repeated User user = 0x7;
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message DecorationData {
|
||||
optional string username = 0x1;
|
||||
optional string full_name = 0x2;
|
||||
optional string image_url = 0x3;
|
||||
optional string large_image_url = 0x5;
|
||||
optional string first_name = 0x6;
|
||||
optional string last_name = 0x7;
|
||||
optional string facebook_uid = 0x8;
|
||||
}
|
||||
|
@ -1,49 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message CountReply {
|
||||
repeated int32 counts = 0x1;
|
||||
}
|
||||
|
||||
message UserListRequest {
|
||||
optional string last_result = 0x1;
|
||||
optional int32 count = 0x2;
|
||||
optional bool include_length = 0x3;
|
||||
}
|
||||
|
||||
message UserListReply {
|
||||
repeated User users = 0x1;
|
||||
optional int32 length = 0x2;
|
||||
}
|
||||
|
||||
message User {
|
||||
optional string username = 0x1;
|
||||
optional int32 subscriber_count = 0x2;
|
||||
optional int32 subscription_count = 0x3;
|
||||
}
|
||||
|
||||
message ArtistListReply {
|
||||
repeated Artist artists = 0x1;
|
||||
}
|
||||
|
||||
message Artist {
|
||||
optional string artistid = 0x1;
|
||||
optional int32 subscriber_count = 0x2;
|
||||
}
|
||||
|
||||
message StringListRequest {
|
||||
repeated string args = 0x1;
|
||||
}
|
||||
|
||||
message StringListReply {
|
||||
repeated string reply = 0x1;
|
||||
}
|
||||
|
||||
message TopPlaylistsRequest {
|
||||
optional string username = 0x1;
|
||||
optional int32 count = 0x2;
|
||||
}
|
||||
|
||||
message TopPlaylistsReply {
|
||||
repeated string uris = 0x1;
|
||||
}
|
||||
|
149
src/inputs/librespot-c/src/proto/storage_resolve.pb-c.c
Normal file
149
src/inputs/librespot-c/src/proto/storage_resolve.pb-c.c
Normal file
@ -0,0 +1,149 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: storage_resolve.proto */
|
||||
|
||||
/* Do not generate deprecated warnings for self */
|
||||
#ifndef PROTOBUF_C__NO_DEPRECATED
|
||||
#define PROTOBUF_C__NO_DEPRECATED
|
||||
#endif
|
||||
|
||||
#include "storage_resolve.pb-c.h"
|
||||
void spotify__download__proto__storage_resolve_response__init
|
||||
(Spotify__Download__Proto__StorageResolveResponse *message)
|
||||
{
|
||||
static const Spotify__Download__Proto__StorageResolveResponse init_value = SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__INIT;
|
||||
*message = init_value;
|
||||
}
|
||||
size_t spotify__download__proto__storage_resolve_response__get_packed_size
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__download__proto__storage_resolve_response__descriptor);
|
||||
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
|
||||
}
|
||||
size_t spotify__download__proto__storage_resolve_response__pack
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
uint8_t *out)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__download__proto__storage_resolve_response__descriptor);
|
||||
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
|
||||
}
|
||||
size_t spotify__download__proto__storage_resolve_response__pack_to_buffer
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
ProtobufCBuffer *buffer)
|
||||
{
|
||||
assert(message->base.descriptor == &spotify__download__proto__storage_resolve_response__descriptor);
|
||||
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
|
||||
}
|
||||
Spotify__Download__Proto__StorageResolveResponse *
|
||||
spotify__download__proto__storage_resolve_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data)
|
||||
{
|
||||
return (Spotify__Download__Proto__StorageResolveResponse *)
|
||||
protobuf_c_message_unpack (&spotify__download__proto__storage_resolve_response__descriptor,
|
||||
allocator, len, data);
|
||||
}
|
||||
void spotify__download__proto__storage_resolve_response__free_unpacked
|
||||
(Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
ProtobufCAllocator *allocator)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
assert(message->base.descriptor == &spotify__download__proto__storage_resolve_response__descriptor);
|
||||
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
|
||||
}
|
||||
static const ProtobufCEnumValue spotify__download__proto__storage_resolve_response__result__enum_values_by_number[3] =
|
||||
{
|
||||
{ "CDN", "SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__CDN", 0 },
|
||||
{ "STORAGE", "SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__STORAGE", 1 },
|
||||
{ "RESTRICTED", "SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__RESTRICTED", 3 },
|
||||
};
|
||||
static const ProtobufCIntRange spotify__download__proto__storage_resolve_response__result__value_ranges[] = {
|
||||
{0, 0},{3, 2},{0, 3}
|
||||
};
|
||||
static const ProtobufCEnumValueIndex spotify__download__proto__storage_resolve_response__result__enum_values_by_name[3] =
|
||||
{
|
||||
{ "CDN", 0 },
|
||||
{ "RESTRICTED", 2 },
|
||||
{ "STORAGE", 1 },
|
||||
};
|
||||
const ProtobufCEnumDescriptor spotify__download__proto__storage_resolve_response__result__descriptor =
|
||||
{
|
||||
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
|
||||
"spotify.download.proto.StorageResolveResponse.Result",
|
||||
"Result",
|
||||
"Spotify__Download__Proto__StorageResolveResponse__Result",
|
||||
"spotify.download.proto",
|
||||
3,
|
||||
spotify__download__proto__storage_resolve_response__result__enum_values_by_number,
|
||||
3,
|
||||
spotify__download__proto__storage_resolve_response__result__enum_values_by_name,
|
||||
2,
|
||||
spotify__download__proto__storage_resolve_response__result__value_ranges,
|
||||
NULL,NULL,NULL,NULL /* reserved[1234] */
|
||||
};
|
||||
static const ProtobufCFieldDescriptor spotify__download__proto__storage_resolve_response__field_descriptors[3] =
|
||||
{
|
||||
{
|
||||
"result",
|
||||
1,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_ENUM,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Download__Proto__StorageResolveResponse, result),
|
||||
&spotify__download__proto__storage_resolve_response__result__descriptor,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"cdnurl",
|
||||
2,
|
||||
PROTOBUF_C_LABEL_REPEATED,
|
||||
PROTOBUF_C_TYPE_STRING,
|
||||
offsetof(Spotify__Download__Proto__StorageResolveResponse, n_cdnurl),
|
||||
offsetof(Spotify__Download__Proto__StorageResolveResponse, cdnurl),
|
||||
NULL,
|
||||
&protobuf_c_empty_string,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
{
|
||||
"fileid",
|
||||
4,
|
||||
PROTOBUF_C_LABEL_NONE,
|
||||
PROTOBUF_C_TYPE_BYTES,
|
||||
0, /* quantifier_offset */
|
||||
offsetof(Spotify__Download__Proto__StorageResolveResponse, fileid),
|
||||
NULL,
|
||||
NULL,
|
||||
0, /* flags */
|
||||
0,NULL,NULL /* reserved1,reserved2, etc */
|
||||
},
|
||||
};
|
||||
static const unsigned spotify__download__proto__storage_resolve_response__field_indices_by_name[] = {
|
||||
1, /* field[1] = cdnurl */
|
||||
2, /* field[2] = fileid */
|
||||
0, /* field[0] = result */
|
||||
};
|
||||
static const ProtobufCIntRange spotify__download__proto__storage_resolve_response__number_ranges[2 + 1] =
|
||||
{
|
||||
{ 1, 0 },
|
||||
{ 4, 2 },
|
||||
{ 0, 3 }
|
||||
};
|
||||
const ProtobufCMessageDescriptor spotify__download__proto__storage_resolve_response__descriptor =
|
||||
{
|
||||
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
|
||||
"spotify.download.proto.StorageResolveResponse",
|
||||
"StorageResolveResponse",
|
||||
"Spotify__Download__Proto__StorageResolveResponse",
|
||||
"spotify.download.proto",
|
||||
sizeof(Spotify__Download__Proto__StorageResolveResponse),
|
||||
3,
|
||||
spotify__download__proto__storage_resolve_response__field_descriptors,
|
||||
spotify__download__proto__storage_resolve_response__field_indices_by_name,
|
||||
2, spotify__download__proto__storage_resolve_response__number_ranges,
|
||||
(ProtobufCMessageInit) spotify__download__proto__storage_resolve_response__init,
|
||||
NULL,NULL,NULL /* reserved[123] */
|
||||
};
|
81
src/inputs/librespot-c/src/proto/storage_resolve.pb-c.h
Normal file
81
src/inputs/librespot-c/src/proto/storage_resolve.pb-c.h
Normal file
@ -0,0 +1,81 @@
|
||||
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
|
||||
/* Generated from: storage_resolve.proto */
|
||||
|
||||
#ifndef PROTOBUF_C_storage_5fresolve_2eproto__INCLUDED
|
||||
#define PROTOBUF_C_storage_5fresolve_2eproto__INCLUDED
|
||||
|
||||
#include <protobuf-c/protobuf-c.h>
|
||||
|
||||
PROTOBUF_C__BEGIN_DECLS
|
||||
|
||||
#if PROTOBUF_C_VERSION_NUMBER < 1003000
|
||||
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
|
||||
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
|
||||
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct Spotify__Download__Proto__StorageResolveResponse Spotify__Download__Proto__StorageResolveResponse;
|
||||
|
||||
|
||||
/* --- enums --- */
|
||||
|
||||
typedef enum _Spotify__Download__Proto__StorageResolveResponse__Result {
|
||||
SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__CDN = 0,
|
||||
SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__STORAGE = 1,
|
||||
SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__RESTRICTED = 3
|
||||
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT)
|
||||
} Spotify__Download__Proto__StorageResolveResponse__Result;
|
||||
|
||||
/* --- messages --- */
|
||||
|
||||
struct Spotify__Download__Proto__StorageResolveResponse
|
||||
{
|
||||
ProtobufCMessage base;
|
||||
Spotify__Download__Proto__StorageResolveResponse__Result result;
|
||||
size_t n_cdnurl;
|
||||
char **cdnurl;
|
||||
ProtobufCBinaryData fileid;
|
||||
};
|
||||
#define SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__INIT \
|
||||
{ PROTOBUF_C_MESSAGE_INIT (&spotify__download__proto__storage_resolve_response__descriptor) \
|
||||
, SPOTIFY__DOWNLOAD__PROTO__STORAGE_RESOLVE_RESPONSE__RESULT__CDN, 0,NULL, {0,NULL} }
|
||||
|
||||
|
||||
/* Spotify__Download__Proto__StorageResolveResponse methods */
|
||||
void spotify__download__proto__storage_resolve_response__init
|
||||
(Spotify__Download__Proto__StorageResolveResponse *message);
|
||||
size_t spotify__download__proto__storage_resolve_response__get_packed_size
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message);
|
||||
size_t spotify__download__proto__storage_resolve_response__pack
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
uint8_t *out);
|
||||
size_t spotify__download__proto__storage_resolve_response__pack_to_buffer
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
ProtobufCBuffer *buffer);
|
||||
Spotify__Download__Proto__StorageResolveResponse *
|
||||
spotify__download__proto__storage_resolve_response__unpack
|
||||
(ProtobufCAllocator *allocator,
|
||||
size_t len,
|
||||
const uint8_t *data);
|
||||
void spotify__download__proto__storage_resolve_response__free_unpacked
|
||||
(Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
ProtobufCAllocator *allocator);
|
||||
/* --- per-message closures --- */
|
||||
|
||||
typedef void (*Spotify__Download__Proto__StorageResolveResponse_Closure)
|
||||
(const Spotify__Download__Proto__StorageResolveResponse *message,
|
||||
void *closure_data);
|
||||
|
||||
/* --- services --- */
|
||||
|
||||
|
||||
/* --- descriptors --- */
|
||||
|
||||
extern const ProtobufCMessageDescriptor spotify__download__proto__storage_resolve_response__descriptor;
|
||||
extern const ProtobufCEnumDescriptor spotify__download__proto__storage_resolve_response__result__descriptor;
|
||||
|
||||
PROTOBUF_C__END_DECLS
|
||||
|
||||
|
||||
#endif /* PROTOBUF_C_storage_5fresolve_2eproto__INCLUDED */
|
15
src/inputs/librespot-c/src/proto/storage_resolve.proto
Normal file
15
src/inputs/librespot-c/src/proto/storage_resolve.proto
Normal file
@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package spotify.download.proto;
|
||||
|
||||
message StorageResolveResponse {
|
||||
Result result = 1;
|
||||
enum Result {
|
||||
CDN = 0;
|
||||
STORAGE = 1;
|
||||
RESTRICTED = 3;
|
||||
}
|
||||
|
||||
repeated string cdnurl = 2;
|
||||
bytes fileid = 4;
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message Track {
|
||||
optional bytes gid = 0x1;
|
||||
optional string name = 0x2;
|
||||
optional bytes image = 0x3;
|
||||
repeated string artist_name = 0x4;
|
||||
repeated bytes artist_gid = 0x5;
|
||||
optional uint32 rank = 0x6;
|
||||
}
|
||||
|
||||
message Artist {
|
||||
optional bytes gid = 0x1;
|
||||
optional string name = 0x2;
|
||||
optional bytes image = 0x3;
|
||||
optional uint32 rank = 0x6;
|
||||
}
|
||||
|
||||
message Album {
|
||||
optional bytes gid = 0x1;
|
||||
optional string name = 0x2;
|
||||
optional bytes image = 0x3;
|
||||
repeated string artist_name = 0x4;
|
||||
repeated bytes artist_gid = 0x5;
|
||||
optional uint32 rank = 0x6;
|
||||
}
|
||||
|
||||
message Playlist {
|
||||
optional string uri = 0x1;
|
||||
optional string name = 0x2;
|
||||
optional string image_uri = 0x3;
|
||||
optional string owner_name = 0x4;
|
||||
optional string owner_uri = 0x5;
|
||||
optional uint32 rank = 0x6;
|
||||
}
|
||||
|
||||
message Suggestions {
|
||||
repeated Track track = 0x1;
|
||||
repeated Album album = 0x2;
|
||||
repeated Artist artist = 0x3;
|
||||
repeated Playlist playlist = 0x4;
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
syntax = "proto2";
|
||||
|
||||
message Toplist {
|
||||
repeated string items = 0x1;
|
||||
}
|
||||
|
1
src/inputs/librespot-c/tests/.gitignore
vendored
1
src/inputs/librespot-c/tests/.gitignore
vendored
@ -1 +1,2 @@
|
||||
test1
|
||||
test2
|
||||
|
@ -7,4 +7,8 @@ test1_SOURCES = test1.c
|
||||
test1_LDADD = $(top_builddir)/librespot-c.a -lpthread $(TEST_LIBS)
|
||||
test1_CFLAGS = $(TEST_CFLAGS)
|
||||
|
||||
check_PROGRAMS = test1
|
||||
test2_SOURCES = test2.c
|
||||
test2_LDADD = $(top_builddir)/librespot-c.a -lpthread $(TEST_LIBS)
|
||||
test2_CFLAGS = $(TEST_CFLAGS)
|
||||
|
||||
check_PROGRAMS = test1 test2
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -75,64 +76,6 @@ logmsg(const char *fmt, ...)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static size_t
|
||||
https_write_cb(char *data, size_t size, size_t nmemb, void *userdata)
|
||||
{
|
||||
char **body;
|
||||
size_t realsize;
|
||||
|
||||
realsize = size * nmemb;
|
||||
body = (char **)userdata;
|
||||
|
||||
*body = malloc(realsize + 1);
|
||||
memcpy(*body, data, realsize);
|
||||
(*body)[realsize] = 0;
|
||||
|
||||
return realsize;
|
||||
}
|
||||
|
||||
static int
|
||||
https_get(char **body, const char *url)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
long response_code;
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (!curl)
|
||||
{
|
||||
printf("Could not initialize CURL\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, https_write_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, body);
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK)
|
||||
{
|
||||
printf("CURL could not make request (%d)\n", (int)res);
|
||||
goto error;
|
||||
}
|
||||
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
if (response_code != 200)
|
||||
{
|
||||
printf("HTTP response code %d\n", (int)response_code);
|
||||
goto error;
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
curl_easy_cleanup(curl);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
tcp_connect(const char *address, unsigned short port)
|
||||
{
|
||||
@ -223,7 +166,6 @@ audio_read_cb(int fd, short what, void *arg)
|
||||
|
||||
struct sp_callbacks callbacks =
|
||||
{
|
||||
.https_get = https_get,
|
||||
.tcp_connect = tcp_connect,
|
||||
.tcp_disconnect = tcp_disconnect,
|
||||
|
||||
@ -241,20 +183,15 @@ main(int argc, char * argv[])
|
||||
struct sp_credentials credentials;
|
||||
struct sp_metadata metadata;
|
||||
struct event *read_ev;
|
||||
uint8_t stored_cred[256];
|
||||
size_t stored_cred_len;
|
||||
// struct event *stop_ev;
|
||||
// struct timeval tv = { 0 };
|
||||
int ret;
|
||||
|
||||
if (argc != 4)
|
||||
{
|
||||
printf("%s spotify_path username password|token\n", argv[0]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
test_file = open("testfile.ogg", O_CREAT | O_RDWR, 0664);
|
||||
if (test_file < 0)
|
||||
{
|
||||
printf("Error opening file: %s\n", strerror(errno));
|
||||
printf("%s spotify_path username access_token\n", argv[0]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@ -268,17 +205,14 @@ main(int argc, char * argv[])
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (strlen(argv[3]) < 100)
|
||||
session = librespotc_login_password(argv[2], argv[3]);
|
||||
else
|
||||
session = librespotc_login_token(argv[2], argv[3]); // Length of token should be 194
|
||||
session = librespotc_login_token(argv[2], argv[3]);
|
||||
if (!session)
|
||||
{
|
||||
printf("Error logging in: %s\n", librespotc_last_errmsg());
|
||||
printf("Error logging in with token: %s\n", librespotc_last_errmsg());
|
||||
goto error;
|
||||
}
|
||||
|
||||
printf("\n --- Login OK --- \n");
|
||||
printf("\n--- Login with token OK ---\n\n");
|
||||
|
||||
ret = librespotc_credentials_get(&credentials, session);
|
||||
if (ret < 0)
|
||||
@ -287,7 +221,30 @@ main(int argc, char * argv[])
|
||||
goto error;
|
||||
}
|
||||
|
||||
printf("Username is %s\n", credentials.username);
|
||||
printf("=== CREDENTIALS ===\n");
|
||||
printf("Username:\n%s\n", credentials.username);
|
||||
hexdump("Stored credentials:\n", credentials.stored_cred, credentials.stored_cred_len);
|
||||
printf("===================\n");
|
||||
|
||||
// "Store" the credentials
|
||||
stored_cred_len = credentials.stored_cred_len;
|
||||
if (stored_cred_len > sizeof(stored_cred))
|
||||
{
|
||||
printf("Unexpected length of stored credentials\n");
|
||||
goto error;
|
||||
}
|
||||
memcpy(stored_cred, credentials.stored_cred, stored_cred_len);
|
||||
|
||||
librespotc_logout(session);
|
||||
|
||||
session = librespotc_login_stored_cred(argv[2], stored_cred, stored_cred_len);
|
||||
if (!session)
|
||||
{
|
||||
printf("Error logging in with stored credentials: %s\n", librespotc_last_errmsg());
|
||||
goto error;
|
||||
}
|
||||
|
||||
printf("\n--- Login with stored credentials OK ---\n\n");
|
||||
|
||||
audio_fd = librespotc_open(argv[1], session);
|
||||
if (audio_fd < 0)
|
||||
@ -312,6 +269,13 @@ main(int argc, char * argv[])
|
||||
goto error;
|
||||
}
|
||||
|
||||
test_file = open("testfile.ogg", O_CREAT | O_RDWR, 0664);
|
||||
if (test_file < 0)
|
||||
{
|
||||
printf("Error opening testfile.ogg: %s\n", strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
|
||||
evbase = event_base_new();
|
||||
audio_buf = evbuffer_new();
|
||||
|
||||
@ -329,14 +293,14 @@ main(int argc, char * argv[])
|
||||
// event_free(stop_ev);
|
||||
event_free(read_ev);
|
||||
|
||||
close(test_file);
|
||||
|
||||
evbuffer_free(audio_buf);
|
||||
|
||||
event_base_free(evbase);
|
||||
|
||||
librespotc_close(audio_fd);
|
||||
|
||||
close(test_file);
|
||||
|
||||
librespotc_logout(session);
|
||||
|
||||
librespotc_deinit();
|
||||
@ -344,10 +308,10 @@ main(int argc, char * argv[])
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (audio_fd >= 0)
|
||||
librespotc_close(audio_fd);
|
||||
if (test_file >= 0)
|
||||
close(test_file);
|
||||
if (audio_fd >= 0)
|
||||
librespotc_close(audio_fd);
|
||||
if (session)
|
||||
librespotc_logout(session);
|
||||
|
||||
|
283
src/inputs/librespot-c/tests/test2.c
Normal file
283
src/inputs/librespot-c/tests/test2.c
Normal file
@ -0,0 +1,283 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h> // for isprint()
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
|
||||
// For file output
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <event2/event.h>
|
||||
#include <event2/buffer.h>
|
||||
|
||||
#include "librespot-c.h"
|
||||
|
||||
static int audio_fd = -1;
|
||||
static int test_file = -1;
|
||||
static struct event_base *evbase;
|
||||
static struct evbuffer *audio_buf;
|
||||
|
||||
static int total_bytes;
|
||||
|
||||
static void
|
||||
hexdump(const char *msg, uint8_t *mem, size_t len)
|
||||
{
|
||||
int i, j;
|
||||
int hexdump_cols = 16;
|
||||
|
||||
if (msg)
|
||||
printf("%s", msg);
|
||||
|
||||
for (i = 0; i < len + ((len % hexdump_cols) ? (hexdump_cols - len % hexdump_cols) : 0); i++)
|
||||
{
|
||||
if(i % hexdump_cols == 0)
|
||||
printf("0x%06x: ", i);
|
||||
|
||||
if (i < len)
|
||||
printf("%02x ", 0xFF & ((char*)mem)[i]);
|
||||
else
|
||||
printf(" ");
|
||||
|
||||
if (i % hexdump_cols == (hexdump_cols - 1))
|
||||
{
|
||||
for (j = i - (hexdump_cols - 1); j <= i; j++)
|
||||
{
|
||||
if (j >= len)
|
||||
putchar(' ');
|
||||
else if (isprint(((char*)mem)[j]))
|
||||
putchar(0xFF & ((char*)mem)[j]);
|
||||
else
|
||||
putchar('.');
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
logmsg(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
static int
|
||||
tcp_connect(const char *address, unsigned short port)
|
||||
{
|
||||
struct addrinfo hints = { 0 };
|
||||
struct addrinfo *servinfo;
|
||||
struct addrinfo *ptr;
|
||||
char strport[8];
|
||||
int fd;
|
||||
int ret;
|
||||
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
||||
snprintf(strport, sizeof(strport), "%hu", port);
|
||||
ret = getaddrinfo(address, strport, &hints, &servinfo);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("Could not connect to %s (port %u): %s\n", address, port, gai_strerror(ret));
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (ptr = servinfo; ptr; ptr = ptr->ai_next)
|
||||
{
|
||||
fd = socket(ptr->ai_family, SOCK_STREAM, ptr->ai_protocol);
|
||||
if (fd < 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = connect(fd, ptr->ai_addr, ptr->ai_addrlen);
|
||||
if (ret < 0)
|
||||
{
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
freeaddrinfo(servinfo);
|
||||
|
||||
if (!ptr)
|
||||
{
|
||||
printf("Could not connect to '%s' (port %u): %s\n", address, port, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Connected to %s (port %u)\n", address, port);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
static void
|
||||
tcp_disconnect(int fd)
|
||||
{
|
||||
if (fd < 0)
|
||||
return;
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
static void
|
||||
progress_cb(int fd, void *arg, size_t received, size_t len)
|
||||
{
|
||||
printf("Progress on fd %d is %zu/%zu\n", fd, received, len);
|
||||
}
|
||||
|
||||
// This thread
|
||||
static void
|
||||
audio_read_cb(int fd, short what, void *arg)
|
||||
{
|
||||
int got;
|
||||
|
||||
got = evbuffer_read(audio_buf, fd, -1);
|
||||
if (got <= 0)
|
||||
{
|
||||
printf("Playback ended (%d)\n", got);
|
||||
event_base_loopbreak(evbase);
|
||||
return;
|
||||
}
|
||||
|
||||
total_bytes += got;
|
||||
|
||||
printf("Got %d bytes of audio, total received is %d bytes\n", got, total_bytes);
|
||||
|
||||
evbuffer_write(audio_buf, test_file);
|
||||
}
|
||||
|
||||
struct sp_callbacks callbacks =
|
||||
{
|
||||
.tcp_connect = tcp_connect,
|
||||
.tcp_disconnect = tcp_disconnect,
|
||||
|
||||
.thread_name_set = NULL,
|
||||
|
||||
.hexdump = hexdump,
|
||||
.logmsg = logmsg,
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char * argv[])
|
||||
{
|
||||
struct sp_session *session = NULL;
|
||||
struct sp_sysinfo sysinfo = { 0 };
|
||||
// struct sp_credentials credentials;
|
||||
struct sp_metadata metadata;
|
||||
struct event *read_ev;
|
||||
FILE *f_stored_cred = NULL;
|
||||
uint8_t stored_cred[256];
|
||||
size_t stored_cred_len;
|
||||
// struct event *stop_ev;
|
||||
// struct timeval tv = { 0 };
|
||||
int ret;
|
||||
|
||||
if (argc != 4)
|
||||
{
|
||||
printf("%s spotify_path username stored_credentials_file\n", argv[0]);
|
||||
goto error;
|
||||
}
|
||||
|
||||
snprintf(sysinfo.device_id, sizeof(sysinfo.device_id), "622682995d5c1db29722de8dd85f6c3acd6fc592");
|
||||
|
||||
ret = librespotc_init(&sysinfo, &callbacks);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("Error initializing Spotify: %s\n", librespotc_last_errmsg());
|
||||
goto error;
|
||||
}
|
||||
|
||||
f_stored_cred = fopen(argv[3], "rb");
|
||||
if (!f_stored_cred)
|
||||
{
|
||||
printf("Error opening file with stored credentials\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
stored_cred_len = fread(stored_cred, 1, sizeof(stored_cred), f_stored_cred);
|
||||
if (stored_cred_len == 0)
|
||||
{
|
||||
printf("Stored credentials file is empty\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
session = librespotc_login_stored_cred(argv[2], stored_cred, stored_cred_len);
|
||||
if (!session)
|
||||
{
|
||||
printf("Error logging in with stored credentials: %s\n", librespotc_last_errmsg());
|
||||
goto error;
|
||||
}
|
||||
|
||||
printf("\n--- Login with stored credentials OK ---\n\n");
|
||||
|
||||
audio_fd = librespotc_open(argv[1], session);
|
||||
if (audio_fd < 0)
|
||||
{
|
||||
printf("Error opening file: %s\n", librespotc_last_errmsg());
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = librespotc_metadata_get(&metadata, audio_fd);
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("Error getting track metadata: %s\n", librespotc_last_errmsg());
|
||||
goto error;
|
||||
}
|
||||
|
||||
printf("File is open, length is %zu\n", metadata.file_len);
|
||||
|
||||
test_file = open("testfile.ogg", O_CREAT | O_RDWR, 0664);
|
||||
if (test_file < 0)
|
||||
{
|
||||
printf("Error opening testfile.ogg: %s\n", strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
|
||||
evbase = event_base_new();
|
||||
audio_buf = evbuffer_new();
|
||||
|
||||
read_ev = event_new(evbase, audio_fd, EV_READ | EV_PERSIST, audio_read_cb, NULL);
|
||||
event_add(read_ev, NULL);
|
||||
|
||||
librespotc_write(audio_fd, progress_cb, NULL);
|
||||
|
||||
// stop_ev = evtimer_new(evbase, stop, &audio_fd);
|
||||
// tv.tv_sec = 2;
|
||||
// event_add(stop_ev, &tv);
|
||||
|
||||
event_base_dispatch(evbase);
|
||||
|
||||
// event_free(stop_ev);
|
||||
event_free(read_ev);
|
||||
|
||||
close(test_file);
|
||||
|
||||
evbuffer_free(audio_buf);
|
||||
event_base_free(evbase);
|
||||
|
||||
error:
|
||||
if (audio_fd >= 0)
|
||||
librespotc_close(audio_fd);
|
||||
if (session)
|
||||
librespotc_logout(session);
|
||||
if (f_stored_cred)
|
||||
fclose(f_stored_cred);
|
||||
|
||||
librespotc_deinit();
|
||||
return ret;
|
||||
}
|
@ -72,14 +72,14 @@ spotify_deinit(void)
|
||||
}
|
||||
|
||||
int
|
||||
spotify_login_token(const char *username, const char *token, const char **errmsg)
|
||||
spotify_login(const char *username, const char *token, const char **errmsg)
|
||||
{
|
||||
struct spotify_backend *backend = backend_set();
|
||||
|
||||
if (!backend || !backend->login_token)
|
||||
if (!backend || !backend->login)
|
||||
return -1;
|
||||
|
||||
return backend->login_token(username, token, errmsg);
|
||||
return backend->login(username, token, errmsg);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -16,8 +16,7 @@ struct spotify_backend
|
||||
{
|
||||
int (*init)(void);
|
||||
void (*deinit)(void);
|
||||
int (*login)(const char *username, const char *password, const char **errmsg);
|
||||
int (*login_token)(const char *username, const char *token, const char **errmsg);
|
||||
int (*login)(const char *username, const char *token, const char **errmsg);
|
||||
void (*logout)(void);
|
||||
int (*relogin)(void);
|
||||
void (*uri_register)(const char *uri);
|
||||
@ -31,7 +30,7 @@ void
|
||||
spotify_deinit(void);
|
||||
|
||||
int
|
||||
spotify_login_token(const char *username, const char *token, const char **errmsg);
|
||||
spotify_login(const char *username, const char *token, const char **errmsg);
|
||||
|
||||
void
|
||||
spotify_logout(void);
|
||||
|
@ -217,40 +217,6 @@ progress_cb(int fd, void *cb_arg, size_t received, size_t len)
|
||||
DPRINTF(E_SPAM, L_SPOTIFY, "Progress %zu/%zu\n", received, len);
|
||||
}
|
||||
|
||||
static int
|
||||
https_get_cb(char **out, const char *url)
|
||||
{
|
||||
struct http_client_ctx ctx = { 0 };
|
||||
char *body;
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
ctx.url = url;
|
||||
ctx.input_body = evbuffer_new();
|
||||
|
||||
ret = http_client_request(&ctx, NULL);
|
||||
if (ret < 0 || ctx.response_code != HTTP_OK)
|
||||
{
|
||||
DPRINTF(E_LOG, L_SPOTIFY, "Failed to get AP list from '%s' (return %d, error code %d)\n", ctx.url, ret, ctx.response_code);
|
||||
goto error;
|
||||
}
|
||||
|
||||
len = evbuffer_get_length(ctx.input_body);
|
||||
body = malloc(len + 1);
|
||||
|
||||
evbuffer_remove(ctx.input_body, body, len);
|
||||
body[len] = '\0'; // For safety
|
||||
|
||||
*out = body;
|
||||
|
||||
evbuffer_free(ctx.input_body);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
evbuffer_free(ctx.input_body);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
tcp_connect(const char *address, unsigned short port)
|
||||
{
|
||||
@ -289,7 +255,6 @@ hexdump_cb(const char *msg, uint8_t *data, size_t data_len)
|
||||
/* ------------------------ librespot-c initialization ---------------------- */
|
||||
|
||||
struct sp_callbacks callbacks = {
|
||||
.https_get = https_get_cb,
|
||||
.tcp_connect = tcp_connect,
|
||||
.tcp_disconnect = tcp_disconnect,
|
||||
|
||||
@ -641,40 +606,7 @@ struct input_definition input_spotify =
|
||||
/* Called from other threads than the input thread */
|
||||
|
||||
static int
|
||||
login(const char *username, const char *password, const char **errmsg)
|
||||
{
|
||||
struct global_ctx *ctx = &spotify_ctx;
|
||||
int ret;
|
||||
|
||||
pthread_mutex_lock(&spotify_ctx_lock);
|
||||
|
||||
ctx->session = librespotc_login_password(username, password);
|
||||
if (!ctx->session)
|
||||
goto error;
|
||||
|
||||
ret = postlogin(ctx);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
pthread_mutex_unlock(&spotify_ctx_lock);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (ctx->session)
|
||||
librespotc_logout(ctx->session);
|
||||
ctx->session = NULL;
|
||||
|
||||
if (errmsg)
|
||||
*errmsg = librespotc_last_errmsg();
|
||||
|
||||
pthread_mutex_unlock(&spotify_ctx_lock);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
login_token(const char *username, const char *token, const char **errmsg)
|
||||
login(const char *username, const char *token, const char **errmsg)
|
||||
{
|
||||
struct global_ctx *ctx = &spotify_ctx;
|
||||
int ret;
|
||||
@ -782,7 +714,6 @@ status_get(struct spotify_status *status)
|
||||
struct spotify_backend spotify_librespotc =
|
||||
{
|
||||
.login = login,
|
||||
.login_token = login_token,
|
||||
.logout = logout,
|
||||
.relogin = relogin,
|
||||
.status_get = status_get,
|
||||
|
@ -2088,7 +2088,7 @@ spotifywebapi_oauth_callback(struct evkeyvalq *param, const char *redirect_uri,
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
ret = spotify_login_token(spotify_credentials.user, spotify_credentials.access_token, errmsg);
|
||||
ret = spotify_login(spotify_credentials.user, spotify_credentials.access_token, errmsg);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user