Osmocom Remote SIM Software Suite https://osmocom.org/projects/osmo-remsim
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.
 
 
 
 
 
 

39 lines
674 B

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <asn1defs.h>
#include "rspro.h"
static void transcode(const uint8_t *buf, unsigned int len)
{
ASN1Error err;
struct RsproPDU *pdu;
int rc;
char *gserbuf;
rc = asn1_ber_decode((void **)&pdu, asn1_type_RsproPDU, buf, len, &err);
printf("rc=%d\n", rc);
rc = asn1_gser_encode((uint8_t **) &gserbuf, asn1_type_RsproPDU, pdu);
printf("rc=%d\n", rc);
printf("%s\n", gserbuf);
}
int main(int argc, char **argv)
{
uint8_t buf[2048];
int fd, rc;
fd = open(argv[1], O_RDONLY);
if (fd < 0)
exit(1);
rc = read(fd, buf, sizeof(buf));
close(fd);
transcode(buf, rc);
}