tsdecrypt reads and decrypts CSA encrypted incoming mpeg transport stream over UDP/RTP using code words obtained from OSCAM or similar CAM server. tsdecrypt communicates with CAM server using cs378x (camd35 over tcp) protocol or newcamd protocol. https://georgi.unixsol.org/programs/tsdecrypt/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.h 1.2KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Utility functions header
  3. * Copyright (C) 2011 Unix Solutions Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2
  7. * as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License (COPYING file) for more details.
  13. *
  14. */
  15. #ifndef UTIL_H
  16. #define UTIL_H
  17. #include <inttypes.h>
  18. #include <arpa/inet.h>
  19. unsigned long crc32(unsigned long crc, const uint8_t *buf, unsigned int len);
  20. int32_t boundary(int32_t exp, int32_t n);
  21. uint8_t *init_4b(uint32_t val, uint8_t *b);
  22. uint8_t *init_4l(uint32_t val, uint8_t *b);
  23. uint8_t *init_2b(uint32_t val, uint8_t *b);
  24. void set_thread_name(char *thread_name);
  25. int decode_hex_string(char *hex, uint8_t *bin, int asc_len);
  26. int64_t get_time(void);
  27. unsigned int file_hex2buf(char *filename, uint8_t *buffer, unsigned int buf_size);
  28. int parse_host_and_port(char *input, char **hostname, char **service, int *port_set);
  29. char *my_inet_ntop(int family, struct sockaddr *addr, char *dest, int dest_len);
  30. #endif