Dateien hochladen nach „lib“

This commit is contained in:
julian
2020-04-19 14:42:09 +02:00
parent 7a5fda055a
commit 3fdd1b36fc
5 changed files with 96 additions and 0 deletions

24
lib/CMakeLists.txt Normal file
View File

@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.4.1)
include_directories( curve25519 ed25519 playfair plist/plist )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -march=native -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g")
aux_source_directory(. play_src)
set(DIR_SRCS ${play_src})
add_library( airplay
STATIC
${DIR_SRCS}
)
target_link_libraries( airplay
pthread
curve25519
ed25519
playfair
plist )
find_package(OpenSSL REQUIRED)
target_link_libraries( airplay OpenSSL::Crypto )
target_link_libraries( airplay dns_sd )

14
lib/fairplay.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef FAIRPLAY_H
#define FAIRPLAY_H
#include "logger.h"
typedef struct fairplay_s fairplay_t;
fairplay_t *fairplay_init(logger_t *logger);
int fairplay_setup(fairplay_t *fp, const unsigned char req[16], unsigned char res[142]);
int fairplay_handshake(fairplay_t *fp, const unsigned char req[164], unsigned char res[32]);
int fairplay_decrypt(fairplay_t *fp, const unsigned char input[72], unsigned char output[16]);
void fairplay_destroy(fairplay_t *fp);
#endif

10
lib/global.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef GLOBAL_H
#define GLOBAL_H
#define GLOBAL_FEATURES 0x7
#define GLOBAL_MODEL "AppleTV2,1"
#define GLOBAL_VERSION "130.14"
#define MAX_HWADDR_LEN 6
#endif

25
lib/netutils.h Normal file
View File

@@ -0,0 +1,25 @@
/**
* Copyright (C) 2011-2012 Juho Vähä-Herttua
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef NETUTILS_H
#define NETUTILS_H
int netutils_init();
void netutils_cleanup();
int netutils_init_socket(unsigned short *port, int use_ipv6, int use_udp);
unsigned char *netutils_get_address(void *sockaddr, int *length);
int netutils_parse_address(int family, const char *src, void *dst, int dstlen);
#endif

23
lib/utils.h Normal file
View File

@@ -0,0 +1,23 @@
/**
* Copyright (C) 2011-2012 Juho Vähä-Herttua
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
#ifndef UTILS_H
#define UTILS_H
char *utils_strsep(char **stringp, const char *delim);
int utils_read_file(char **dst, const char *pemstr);
int utils_hwaddr_raop(char *str, int strlen, const char *hwaddr, int hwaddrlen);
int utils_hwaddr_airplay(char *str, int strlen, const char *hwaddr, int hwaddrlen);
char *utils_parse_hex(const char *str, int str_len, int *data_len);
#endif