diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-12-29 05:43:57 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-12-29 08:38:12 +0100 |
commit | 46a920c36ce90f3ab5443ffb02aa1b4503a75d5f (patch) | |
tree | bea3fd6fb0b8def8e78f6970ea5156e5a700b5d1 /openbsc/src/ipaccess/ipaccess-firmware.c | |
parent | 615e650fd457430e9b4685231725d7f1a47b625f (diff) |
[ipaccess] Do not pick in the wrong headers...
I must have picked in the wrong section of these
files... There are some kind of header entries
that are all 138 byte long and this is the total
length...
Diffstat (limited to 'openbsc/src/ipaccess/ipaccess-firmware.c')
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-firmware.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/openbsc/src/ipaccess/ipaccess-firmware.c index 8fdc2e9a4..5cf99d428 100644 --- a/openbsc/src/ipaccess/ipaccess-firmware.c +++ b/openbsc/src/ipaccess/ipaccess-firmware.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <string.h> +#define PART_LENGTH 138 struct sdp_firmware { char magic[4]; @@ -36,12 +37,7 @@ struct sdp_firmware { unsigned int file_length; char sw_part[20]; char text1[122]; - u_int8_t no_idea_1[4]; - char text2[64]; - char time[8]; - u_int8_t no_idea_2[4]; - char date[8]; - u_int8_t no_idea_3[6]; + unsigned int short part_length; /* stuff i don't know */ } __attribute__((packed)); @@ -77,10 +73,9 @@ static void analyze_file(int fd) printf("header_length: %u\n", ntohl(firmware_header->header_length)); printf("file_length: %u\n", ntohl(firmware_header->file_length)); printf("sw_part: %.20s\n", firmware_header->sw_part); - printf("text1: %.122s\n", firmware_header->text1); - printf("text2: %.64s\n", firmware_header->text2); - printf("time: %.8s\n", firmware_header->time); - printf("date: %.8s\n", firmware_header->date); + printf("text1: %.120s\n", firmware_header->text1); + printf("items: %u (rest %u)\n", ntohs(firmware_header->part_length) / PART_LENGTH, + ntohs(firmware_header->part_length) % PART_LENGTH); /* verify the file */ if (fstat(fd, &stat) == -1) { |