diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-12-29 08:09:54 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-12-29 08:38:12 +0100 |
commit | 07a4026b38a6661edfafb4742cf243121ab1ee6b (patch) | |
tree | fa838dad7bad7a66a5bb3f8d97120097319fa724 /openbsc/src/ipaccess | |
parent | c823c89c766829c738db19ccebb690b7fb5cfd71 (diff) |
[ipaccess] Start figuring out what the header entry is meaning..
Diffstat (limited to 'openbsc/src/ipaccess')
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-firmware.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-firmware.c b/openbsc/src/ipaccess/ipaccess-firmware.c index 806e6be5c..345de0618 100644 --- a/openbsc/src/ipaccess/ipaccess-firmware.c +++ b/openbsc/src/ipaccess/ipaccess-firmware.c @@ -44,7 +44,16 @@ struct sdp_firmware { } __attribute__((packed)); struct sdp_header_entry { - u_int8_t entry[138]; + u_int16_t something1; + char text1[64]; + char time[12]; + char date[14]; + char text2[10]; + char text3[20]; + u_int32_t something2; + u_int32_t addr1; + u_int32_t addr2; + u_int32_t something3; } __attribute__((packed)); static_assert(sizeof(struct sdp_header_entry) == 138, right_entry); @@ -58,7 +67,7 @@ static void analyze_file(int fd) struct sdp_firmware *firmware_header; struct stat stat; char buf[4096]; - int rc; + int rc, i; rc = read(fd, buf, sizeof(*firmware_header)); if (rc < 0) { @@ -100,6 +109,12 @@ static void analyze_file(int fd) fprintf(stderr, "The part length seems to be wrong.\n"); return; } + + /* look into each firmware now */ + for (i = 0; i < ntohs(firmware_header->part_length) % PART_LENGTH; ++i) { + unsigned int offset = sizeof(struct sdp_firmware); + offset += i * 138; + } } int main(int argc, char** argv) |