From 7903477a741ba2b8a0b1294a82ade614c7473d40 Mon Sep 17 00:00:00 2001 From: ffs Upstream Date: Fri, 21 Aug 2020 18:23:31 -0400 Subject: [PATCH] ffs 2020-08-21 (c8dd2544) Code extracted from: https://github.com/GTkorvo/ffs.git at commit c8dd25449861ff8237cdc2807b011ffcfc7d5692 (master). Upstream Shortlog ----------------- --- ffs/output_dir/context_test_output.osx.bin | Bin 0 -> 16683 bytes ffs/output_dir/file_output.osx.bin | Bin 0 -> 14289 bytes ffs/output_dir/index_output.osx.bin | Bin 0 -> 16081 bytes fm/fm_formats.c | 281 +++++++++++++++++---- fm/fm_internal.h | 55 +++- fm/progs/server.c | 4 +- 6 files changed, 280 insertions(+), 60 deletions(-) create mode 100755 ffs/output_dir/context_test_output.osx.bin create mode 100755 ffs/output_dir/file_output.osx.bin create mode 100755 ffs/output_dir/index_output.osx.bin diff --git a/ffs/output_dir/context_test_output.osx.bin b/ffs/output_dir/context_test_output.osx.bin new file mode 100755 index 0000000000000000000000000000000000000000..bd2afa847b464da8a96fabbc8dba858f08d2f534 GIT binary patch literal 16683 zcmeHO3wTu3wcZmD@rBVUMT>U8M-f!=07VozfdB!51T-`lFqvddl7Y!gm`r&2LQuh~ z6{^)(TgB(CO1;!tFP~4Ue#&R9qTbf`qt#lqmdo|C^@V!>fA6)=*)s`FYt`@T{kp!a zS$nOs&VH=D_FDVwb5f+#o=T~o7AZCSl_$HO?%Z|tpVd!Q1Tv-8M^rUPAK)Nh|G`D- zG7uEiTwp7(FBw1@cm|Lci7SB@16ffquqBb{%tl+%nf6##B~n?x)z3s*5`HpnITcTL zH6?u!wj|R~Y;KELEf!Ia3+UIdoPOit08u#Pg%8hKaL+DYh49eBI3o(w`@@}=JTvM? zYwttfB6^_lh&mE_EH?r<&N>-qCHUz;j-Sw(&2%+qyE1+}8p~v2%j}SR%_+aV$&bhV zc>SpPMnCwytfwv4NE@|Kng>MRG{o_{2xx7&6y>vpr!8$GDv@hI^evHU6$2VZ#f^$F zC+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WWTXH)HCwKh0Zn96S|__ z@SBBtml(cE=vtxOLQB?}>!XC$37xmjTdxdk7W%4Ck~r{9tjB6}b}QEFC`{BQ?0E)D ztmE}9KyF{G-bU!|M+X3Kc`!`#T#&jcAj9KIAn$t$_#*HPAnV}!dJi~F>U$S$?*R5g zo$SLLU?Xq=knP+BdT}EeK z9acX0t*L$Sk2n~bDvCz5FGEdvK&}%gq6bQS4D1Uf3`qmlkJ?{&%J}Wx;llF< z2!AB_-=b{&xdi;1;NJy~L79lpjAN73bo$4_w9Z0D=Uu6^R_&-BfpH(G4m>+wg253Bo?I4~z%f&GOdA?6m%RmQ#m{9?+0gfoE`0Xa6xE(7vNk>ljp z?*Tpn>anZM3pWPb_{gg1w5LG5r`!dR& z@a@5WfS(>s#^eu^xI(UD+ooZyP)im&>z^{_C>L@cV30%Qy8YhM_QQUgQz_ReCsqr8 zk|U>2%@MxNkux?o3g6_&>0=9oPdak$iL=6Y357^QxWx(gHsPk`AAe-rD)ql0lw%;g cCOr3P1Oy(vX7&=p46p{$SO4ipMuzAA1C(zM<^TWy literal 0 HcmV?d00001 diff --git a/ffs/output_dir/file_output.osx.bin b/ffs/output_dir/file_output.osx.bin new file mode 100755 index 0000000000000000000000000000000000000000..7aba841f4a76a1b5703299bc0528cef67098d650 GIT binary patch literal 14289 zcmeHO33Qaz6@HVTLR^Se5UkcAZYXM)2?)X@zK{e0BoG3L5yWJY`LmG83`{0rk)nVK zR#8ODQWa5adt8sTw&l1WwXJZFy0&%S>sm#Q?WspSm45fV`~G<|$z+gP&+#1Z$({S& z{qO&l``%st_x~xW-FHWp5Qhoj34l)D_E_`boAL&(@C1ZM06e2Sq5?Dj=h0TO{tZI5BT?n-dP1ng~U^ z8p94Vo5N8EHnj$g6cy2qx1zFcHR#$lfDKk8>|w?StfwE!WHI0JH2ZUB=0>sbG#s80pbx)5~6V_i-0u9y?@ z24k_{VxwwD)r8a0=!8N}XwIm)THgJ=zULZ4zqEv+26zDwV^a{q?*brQBwPf%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SEbfxq+Fj-&AWl#I=CM5H8gA# z#^ZENuz?x#n07H;&h%=gH!{78=|fC+GgW&bI)6b-xTQ|37`Mw^NtN#8+QO9TqSX50 I9*ia8zoXFSEdT%j literal 0 HcmV?d00001 diff --git a/ffs/output_dir/index_output.osx.bin b/ffs/output_dir/index_output.osx.bin new file mode 100755 index 0000000000000000000000000000000000000000..b34f00ac2be6b4fcfeebd94b1df9914112c8c2ff GIT binary patch literal 16081 zcmeHO3v`v$l|FfhfIK1!2GsTvA4QRdB!uTB{(%Gn1bN2@Vsew*JRrFjZft#zjAvS`)LjIa7C)z(h6tj?_IvRxzdedp}+|L5M^%f;4q zP1ka-?0a7Oy!JWg+xtKNpVGAktWmO?|9cfKQ6UUbP@xfsf!RW-VCPx8%6&$NG||$T}Zvj zL|<#NFA;4EMG}d~W~=I`PN`^5OSG*m+O}%aY9sIeezE@=L%&=?wE}!O7-Q4ahTrvI z7LqrCuaP*{*mk12QWq9u>xy;A!kUC?Ga_c0QP(BzH_)A~PPQV$?zLu?`c&kJyz27v z7#ZlXqZP} z0C*gj%Y_oH%D+c?H`q>LAL87?93t}`2LAwTRr?g;|0Zdw_BHUYB+VuN0Q@1CQwf2s zijQ}`dOPC@9Kn<`*B$p4Mh=bNl$Nurb)rY}d<>}A>KEf8g_mh{e!R0;H8=zcFVkb* z5b5sAc!tYxj9OAPMgdtnm{e62GCj<;V3B<^ zl^9J}+BaGOa2S|Hz-{aAt%=AWbesupDH@Jnv$q(gLrF5)o5Z%oe&PZQ`8IxdGO!)3 z={lKaF4a_^GuL#Pqh#d=o+0wSY2b!+<;{Nf<>%&VpC&RG&p?jxxTch6Ngp{K4tx{c z|8{ik9X}sfu=s6cWi)L92UA@=@;s*NQ8$U7bUjM_eh_}DR9M+IIU)#+5 zcnCe|PeN#bt{}AO0ZPu=iJ4l;;+CX#>emjR0NzirOHmsve-@>}FP*BbL)spofiSp! zdM&of$>380935(L)IaCxIL!)y{IJnT5O=f6^DGCrJM2ox{@1Uby5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SVg^L%o<4m{QnQw)o-ip6P|HC}5F7)Wmyi&DDo^uy_6{J5d7C&c+ z_wMs0uYK6CRQ#P~-fkR+#~)fIe$R4mJ{_WAD?B{*<8dIr2%-NXA-_mIh$_s}AA<5~ zfId0z`8S#C3Psqs1T5~pYCwE7Sj!=--GC2@8q|hpYg4zr;kI|~D$0@#A`ormTf z7~9}`(Gu z%{=iyg?v%$T*~{=EDF%ek#>)7M~;r6g90b|n9m7*W7CR?_Hgm?aUE~<8)P}F71p*_<4UK z%3T}`qDIQag;8zMc5;XQ>9o!5ap!b1s@SpFW6&(k*!)gOi$|%}Nm@Js{qJ1N;_8yF z)xYMtmr+iU-j@#N+OSU2b@NPq-MslSU%W#Iwi`RQ17Tw%s}E17loHoYEtIslNa_kn zo7d?2cdar(w+(yzNX#neeOE!RqYXPztDtM8U7NpM(pCXGB|S*OeG>9soAjUw^!+uX zk4xHu%kz>RDxoN-zrs?>=gnVWGJJ(DsMi@zTC2!SUm{9>)K&U7QO!=yDtnxCmcIF# zC7%mLT5kgXpX6?mG(nVP9Y%cFu$C|CC5-!#bwO;s6HU1B-jqZV$Bjq2>IMAJsfEL8 z0XfWm36TCV4$5Y}CS?J*>CeWe9LZki|0htJMa-*q=gBu;b_d#>yAKm1*?hYb?aq8$ zmzp;#jM|-OcjjACZg=KUN%IC(lOQW^N=bGVZ2uuCKh+fbJ9>V4`cK)(Xd`83142{N zi__Cf(#n@CmD9ktPX4BN0}We+$vAxoYL<*O681@WorGVI@E!>tknsBw9+ps_h4{Ml e3FXInooLdH_oXB@q^35eB{!v~H}}ifqW%w2{vKNZ literal 0 HcmV?d00001 diff --git a/fm/fm_formats.c b/fm/fm_formats.c index 9312dc91aa..cadbb39d8e 100755 --- a/fm/fm_formats.c +++ b/fm/fm_formats.c @@ -428,6 +428,22 @@ void *buffer; } break; } + case 3: + { + UINT4 rep_len = ((version_3_format_ID*) buffer)->rep_len; + rep_len += (((version_3_format_ID*) buffer)->top_byte_rep_len) << 16; + /* shortcut on comparisons. check likely difference first */ + for (i = fmc->reg_format_count - 1; i >= 0; i--) { + version_3_format_ID* id = (version_3_format_ID*) + fmc->format_list[i]->server_ID.value; + if (rep_len != id->rep_len) continue; + if (memcmp(buffer, fmc->format_list[i]->server_ID.value, + fmc->format_list[i]->server_ID.length) == 0) { + return fmc->format_list[i]; + } + } + break; + } default: for (i = fmc->reg_format_count - 1; i >= 0; i--) { if (memcmp(buffer, fmc->format_list[i]->server_ID.value, @@ -486,6 +502,22 @@ char *buffer; } break; } + case 3: + { + UINT4 rep_len = ((version_3_format_ID*) buffer)->rep_len; + rep_len += (((version_3_format_ID*) buffer)->top_byte_rep_len) << 16; + /* shortcut on comparisons. check likely difference first */ + for (i = fmc->reg_format_count - 1; i >= 0; i--) { + version_3_format_ID* id = (version_3_format_ID*) + fmc->format_list[i]->server_ID.value; + if (rep_len != id->rep_len) continue; + if (memcmp(buffer, fmc->format_list[i]->server_ID.value, + fmc->format_list[i]->server_ID.length) == 0) { + return fmc->format_list[i]; + } + } + break; + } default: for (i = fmc->reg_format_count - 1; i >= 0; i--) { if (memcmp(buffer, fmc->format_list[i]->server_ID.value, @@ -1190,7 +1222,7 @@ FMFormat *formats; free(fmformat->field_subformats); new_var_list = (FMVarInfoList) malloc((size_t) sizeof(FMVarInfoStruct) * field_count); - fmformat->field_subformats = malloc(sizeof(FMFormat) * field_count); + fmformat->field_subformats = calloc(sizeof(FMFormat), field_count); fmformat->var_list = new_var_list; for (field = 0; field < field_count; field++) { long elements; @@ -1252,14 +1284,14 @@ char *super_rep; int *super_rep_size; { int byte_reversal = fmformat->byte_reversal; - int rep_size = (sizeof(struct _field_wire_format) * + int rep_size = (sizeof(struct _field_wire_format_1) * (fmformat->field_count)); int i; int opt_info_count = 0; struct _subformat_wire_format *rep; char *string_base; int cur_offset; - struct _field_wire_format *fields; + struct _field_wire_format_1 *fields; int OUR_BYTE_ORDER = WORDS_BIGENDIAN; int OTHER_BYTE_ORDER = (WORDS_BIGENDIAN ? 0 : 1); @@ -1269,7 +1301,7 @@ int *super_rep_size; rep_size += strlen(fmformat->field_list[i].field_type) + 1; } - rep_size += sizeof(struct _subformat_wire_format_0); + rep_size += sizeof(struct _subformat_wire_format_1); rep_size = (rep_size + 3) & -4; /* round up by even 4 */ while (fmformat->opt_info && @@ -1282,46 +1314,46 @@ int *super_rep_size; super_rep = realloc(super_rep, *super_rep_size + rep_size+4); /* little extra */ rep = (struct _subformat_wire_format *) (super_rep + *super_rep_size); - cur_offset = (sizeof(struct _subformat_wire_format_0) + - (sizeof(struct _field_wire_format) * + cur_offset = (sizeof(struct _subformat_wire_format_1) + + (sizeof(struct _field_wire_format_1) * (fmformat->field_count))); - rep->f.f0.server_rep_version = 0; - rep->f.f0.header_size = sizeof(struct _subformat_wire_format_0); + rep->f.f1.server_rep_version = 1; + rep->f.f1.header_size = sizeof(struct _subformat_wire_format_1); - rep->f.f0.column_major_arrays = fmformat->column_major_arrays; - rep->f.f0.alignment = fmformat->alignment; - rep->f.f0.opt_info_offset = 0; /* will be set later */ + rep->f.f1.column_major_arrays = fmformat->column_major_arrays; + rep->f.f1.alignment = fmformat->alignment; + rep->f.f1.opt_info_offset = 0; /* will be set later */ string_base = (char *) rep; - rep->f.f0.name_offset = cur_offset; - if (byte_reversal) byte_swap((char*) &rep->f.f0.name_offset, 2); + rep->f.f1.name_offset = cur_offset; + if (byte_reversal) byte_swap((char*) &rep->f.f1.name_offset, 4); strcpy(string_base + cur_offset, fmformat->format_name); cur_offset += strlen(fmformat->format_name) + 1; - rep->f.f0.field_count = fmformat->field_count; - if (byte_reversal) byte_swap((char*) &rep->f.f0.field_count, 2); - rep->f.f0.record_length = fmformat->record_length; - if (byte_reversal) byte_swap((char*) &rep->f.f0.record_length, 4); - rep->f.f0.record_byte_order = fmformat->byte_reversal ? + rep->f.f1.field_count = fmformat->field_count; + if (byte_reversal) byte_swap((char*) &rep->f.f1.field_count, 4); + rep->f.f1.record_length = fmformat->record_length; + if (byte_reversal) byte_swap((char*) &rep->f.f1.record_length, 4); + rep->f.f1.record_byte_order = fmformat->byte_reversal ? OTHER_BYTE_ORDER : OUR_BYTE_ORDER; - rep->f.f0.pointer_size = fmformat->pointer_size; - rep->f.f0.floating_point_rep = fmformat->float_format; + rep->f.f1.pointer_size = fmformat->pointer_size; + rep->f.f1.floating_point_rep = fmformat->float_format; - fields = (struct _field_wire_format *) ((char*) rep + - rep->f.f0.header_size); + fields = (struct _field_wire_format_1 *) ((char*) rep + + rep->f.f1.header_size); for (i = 0; i < fmformat->field_count; i++) { fields[i].field_size = fmformat->field_list[i].field_size; if (byte_reversal) byte_swap((char*) &fields[i].field_size, 4); fields[i].field_offset = fmformat->field_list[i].field_offset; if (byte_reversal) byte_swap((char*) &fields[i].field_offset, 4); fields[i].field_name_offset = cur_offset; - if (byte_reversal) byte_swap((char*) &fields[i].field_name_offset, 2); + if (byte_reversal) byte_swap((char*) &fields[i].field_name_offset, 4); strcpy(string_base + cur_offset, fmformat->field_list[i].field_name); cur_offset += strlen(fmformat->field_list[i].field_name) + 1; fields[i].field_type_offset = cur_offset; - if (byte_reversal) byte_swap((char*) &fields[i].field_type_offset, 2); + if (byte_reversal) byte_swap((char*) &fields[i].field_type_offset, 4); strcpy(string_base + cur_offset, fmformat->field_list[i].field_type); cur_offset += strlen(fmformat->field_list[i].field_type) +1; @@ -1334,8 +1366,8 @@ int *super_rep_size; while ((cur_offset & 0x3) != 0) { *(string_base + cur_offset++) = 0; } - rep->f.f0.opt_info_offset = cur_offset; - if (byte_reversal) byte_swap((char*) &rep->f.f0.opt_info_offset, 2); + rep->f.f1.opt_info_offset = cur_offset; + if (byte_reversal) byte_swap((char*) &rep->f.f1.opt_info_offset, 2); info_base = cur_offset +string_base; cur_offset += (opt_info_count + 1) * sizeof(struct _opt_info_wire_format); @@ -1369,7 +1401,10 @@ int *super_rep_size; *(string_base + cur_offset++) = 0; } assert(cur_offset == rep_size); - rep->f.f0.subformat_rep_length = htons(rep_size); + rep->f.f1.subformat_rep_length = htons(rep_size); + rep->f.f1.top_bytes_subformat_rep_length = htons(rep_size>>16); + rep->f.f1.unused0_f1 = 0; + rep->f.f1.unused1_f1 = 0; *super_rep_size += rep_size; return (format_rep) super_rep; } @@ -1396,14 +1431,13 @@ FMFormat fmformat; add_server_subformat_rep(subformats[i], (char*)rep, &rep_size); } - rep->f.f0.format_rep_length = htons(rep_size); - rep->f.f0.record_byte_order = fmformat->byte_reversal ? + rep->f.f1.format_rep_length = htons(rep_size & 0xffff); + rep->f.f1.record_byte_order = fmformat->byte_reversal ? OTHER_BYTE_ORDER : OUR_BYTE_ORDER; - rep->f.f0.server_rep_version = 0; - rep->f.f0.subformat_count = subformat_count; - rep->f.f0.recursive_flag = 0; /* GSE must set right */ - rep->f.f0.unused1_in_format_0 = 0; - rep->f.f0.unused2_in_format_0 = 0; + rep->f.f1.server_rep_version = 1; + rep->f.f1.subformat_count = subformat_count; + rep->f.f1.recursive_flag = 0; /* GSE must set right */ + rep->f.f1.top_bytes_format_rep_length = htons(rep_size>>16); return (format_rep) rep; } @@ -1425,6 +1459,9 @@ FMFormat fmformat; return NULL; } search_rep_length = ntohs(fmformat->server_format_rep->format_rep_length); + if (fmformat->server_format_rep->server_rep_version > 0) { + search_rep_length += (ntohs(fmformat->server_format_rep->top_bytes_format_rep_length) >> 16); + } /* search locally first */ for (i = 0; i < fmc->reg_format_count; i++) { @@ -1927,20 +1964,24 @@ extern void hashlittle2( extern void -generate_format2_server_ID(server_ID_type *server_ID, - struct _format_wire_format_0 *server_format_rep) +generate_format3_server_ID(server_ID_type *server_ID, + struct _format_wire_format_1 *server_format_rep) { INT4 hash1 = 0, hash2 = 0; + UINT4 server_format_rep_length = ntohs(server_format_rep->format_rep_length); + if (server_format_rep->server_rep_version > 0) { + server_format_rep_length += (ntohs(server_format_rep->top_bytes_format_rep_length) >> 16); + } + if (server_format_rep_length > (1 << 26)) fprintf(stderr, "Format rep too long in generate_format_server_ID\n"); server_ID->length = 12; server_ID->value = malloc(12); - ((version_2_format_ID *) server_ID->value)->version = 2; - ((version_2_format_ID *) server_ID->value)->unused = 0; + ((version_3_format_ID *) server_ID->value)->version = 2; hashlittle2((int*)server_format_rep, - ntohs(server_format_rep->format_rep_length), + server_format_rep_length, &hash1, &hash2); if (get_format_server_verbose()) { unsigned char *tmp = (unsigned char*)server_format_rep; - int size = ntohs(server_format_rep->format_rep_length); + int size = server_format_rep_length; int i; printf("Server rep is : "); for (i=0; i< size; i++) { @@ -1948,10 +1989,12 @@ generate_format2_server_ID(server_ID_type *server_ID, } printf("\n"); } - ((version_2_format_ID *) server_ID->value)->rep_len = - htons(ntohs(server_format_rep->format_rep_length) >> 2); - ((version_2_format_ID *) server_ID->value)->hash1 = htonl(hash1); - ((version_2_format_ID *) server_ID->value)->hash2 = htonl(hash2); + ((version_3_format_ID *) server_ID->value)->rep_len = + htons(server_format_rep_length >> 2); // Mod length by 4 + ((version_3_format_ID *) server_ID->value)->top_byte_rep_len = + htons(server_format_rep_length >> 18); // Essentially, we capture the top 26 bytes of the server length + ((version_3_format_ID *) server_ID->value)->hash1 = htonl(hash1); + ((version_3_format_ID *) server_ID->value)->hash2 = htonl(hash2); } static int @@ -1974,7 +2017,7 @@ FMFormat fmformat; } server_format_rep = fmformat->server_format_rep; - generate_format2_server_ID(&fmformat->server_ID, server_format_rep); + generate_format3_server_ID(&fmformat->server_ID, server_format_rep); if (get_format_server_verbose()) { printf("Registering %s to locally-issued format ID ", fmformat->format_name); @@ -3375,12 +3418,12 @@ FMFormat format; return stringify_field_type(format->format_name, format, buffer, size); } -extern FMFormat -expand_subformat_from_rep(rep) +static FMFormat +expand_subformat_from_rep_0(rep) struct _subformat_wire_format *rep; { FMFormat format = new_FMFormat(); - struct _field_wire_format *fields; + struct _field_wire_format_0 *fields; int field; UINT2 tmp; INT4 tmp2; @@ -3418,15 +3461,15 @@ struct _subformat_wire_format *rep; format->var_list = NULL; if (rep->f.f0.server_rep_version == 0) { - fields = (struct _field_wire_format *) + fields = (struct _field_wire_format_0 *) ((char*)rep + sizeof(struct _subformat_wire_format_0)); } else { - fields = (struct _field_wire_format *) + fields = (struct _field_wire_format_0 *) ((char*) rep + rep->f.f0.header_size); } for (field = 0; field < format->field_count; field++) { FMField *fmfield = &(format->field_list[field]); - struct _field_wire_format *wire = &fields[field]; + struct _field_wire_format_0 *wire = &fields[field]; tmp = wire->field_name_offset; if (byte_reversal) byte_swap((char*)&tmp, 2); fmfield->field_name = malloc(strlen((char *) rep + tmp) + 1); @@ -3488,6 +3531,132 @@ struct _subformat_wire_format *rep; } +static FMFormat +expand_subformat_from_rep_1(rep) +struct _subformat_wire_format *rep; +{ + FMFormat format = new_FMFormat(); + struct _field_wire_format_1 *fields; + int field; + UINT2 tmp; + INT4 tmp2; + int OUR_BYTE_ORDER = WORDS_BIGENDIAN; + int OTHER_BYTE_ORDER = (WORDS_BIGENDIAN ? 0 : 1); + int byte_reversal = ((rep->f.f1.record_byte_order & 0x1) != OUR_BYTE_ORDER); + + tmp2 = rep->f.f1.name_offset; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + format->format_name = malloc(strlen((char *) rep + tmp2) + 1); + strcpy(format->format_name, (char *) rep + tmp2); + tmp2 = rep->f.f1.field_count; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + format->field_count = tmp2; + format->variant = 0; + tmp2 = rep->f.f1.record_length; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + format->record_length = tmp2; + format->byte_reversal = ((rep->f.f1.record_byte_order & 0x1) != OUR_BYTE_ORDER); + format->pointer_size = rep->f.f1.pointer_size; + tmp = rep->f.f1.floating_point_rep; + if (byte_reversal) byte_swap((char*)&tmp, 2); + format->float_format = (FMfloat_format) tmp; + if (format->float_format == Format_Unknown) { + /* old data must be pure-endian IEEE 754*/ + if (rep->f.f1.record_byte_order == 1) { + /* bigendian */ + format->float_format = Format_IEEE_754_bigendian; + } else { + format->float_format = Format_IEEE_754_littleendian; + } + } + format->field_list = (FMFieldList) malloc(sizeof(FMField) * + (format->field_count + 1)); + format->var_list = NULL; + + if (rep->f.f1.server_rep_version == 0) { + fields = (struct _field_wire_format_1 *) + ((char*)rep + sizeof(struct _subformat_wire_format_1)); + } else { + fields = (struct _field_wire_format_1 *) + ((char*) rep + rep->f.f1.header_size); + } + for (field = 0; field < format->field_count; field++) { + FMField *fmfield = &(format->field_list[field]); + struct _field_wire_format_1 *wire = &fields[field]; + tmp2 = wire->field_name_offset; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + fmfield->field_name = malloc(strlen((char *) rep + tmp2) + 1); + strcpy((char*)fmfield->field_name, (char *) rep + tmp2); + tmp2 = wire->field_type_offset; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + fmfield->field_type = malloc(strlen((char *) rep + tmp2) + 1); + strcpy((char*)fmfield->field_type, (char *) rep + tmp2); + fmfield->field_size = wire->field_size; + if (byte_reversal) byte_swap((char*)&fmfield->field_size, 4); + fmfield->field_offset = wire->field_offset; + if (byte_reversal) byte_swap((char*)&fmfield->field_offset, 4); + } + format->field_list[format->field_count].field_size = 0; + format->field_list[format->field_count].field_offset = 0; + format->field_list[format->field_count].field_name = NULL; + format->field_list[format->field_count].field_type = NULL; + format->column_major_arrays = 0; + { + struct _opt_info_wire_format tmp_info; + int offset, info_count = 0; + + format->alignment = rep->f.f1.alignment; + format->column_major_arrays = rep->f.f1.column_major_arrays; + tmp = rep->f.f1.opt_info_offset; + if (byte_reversal) byte_swap((char*)&tmp, 2); + + if (tmp != 0) { + offset = tmp; + format->opt_info = malloc(sizeof(FMOptInfo)); + do { + memcpy(&tmp_info, offset + (char*) rep, sizeof(tmp_info)); + if (tmp_info.info_type != 0) { + format->opt_info = + realloc(format->opt_info, + sizeof(FMOptInfo) * (info_count + 2)); + tmp2 = tmp_info.info_type; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + format->opt_info[info_count].info_type = tmp2; + + tmp2 = tmp_info.info_len; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + format->opt_info[info_count].info_len = tmp2; + + tmp2 = tmp_info.info_offset; + if (byte_reversal) byte_swap((char*)&tmp2, 4); + format->opt_info[info_count].info_block = + (char*)rep + tmp2; + info_count++; + offset += sizeof(tmp_info); + } + } while (tmp_info.info_type != 0); + format->opt_info[info_count].info_type = 0; + format->opt_info[info_count].info_len = 0; + format->opt_info[info_count].info_block = 0; + } + } + return format; +} + + +static FMFormat +expand_subformat_from_rep(rep) +struct _subformat_wire_format *rep; +{ + if (rep->f.f0.server_rep_version == 0) { + return expand_subformat_from_rep_0(rep); + } else if (rep->f.f0.server_rep_version == 1) { + return expand_subformat_from_rep_1(rep); + } else { + return NULL; + } +} + extern FMFormat expand_format_from_rep(rep) format_rep rep; @@ -3499,13 +3668,16 @@ format_rep rep; int i; struct _subformat_wire_format *subrep = (struct _subformat_wire_format*) - (((char*)rep ) + sizeof(struct _format_wire_format_0)); + (((char*)rep ) + sizeof(struct _format_wire_format_1)); format_count = rep->subformat_count; top_format = expand_subformat_from_rep(subrep); subformats = malloc(sizeof(subformats[0]) * (format_count + 1)); master_struct_list = malloc(sizeof(master_struct_list[0]) * (format_count+2)); for (i = 0; i < format_count; i++) { - UINT2 last_subrep_size = ntohs(subrep->f.f0.subformat_rep_length); + UINT4 last_subrep_size = ntohs(subrep->f.f1.subformat_rep_length); + if (subrep->f.f1.server_rep_version > 0) { + last_subrep_size += (ntohs(subrep->f.f1.top_bytes_subformat_rep_length) << 16); + } subrep = (struct _subformat_wire_format*)(((char*)subrep) + last_subrep_size); subformats[i] = expand_subformat_from_rep(subrep); master_struct_list[i+1].format_name = subformats[i]->format_name; @@ -4014,6 +4186,9 @@ int *rep_length; build_server_format_rep(format); } *rep_length = ntohs(format->server_format_rep->format_rep_length); + if (format->server_format_rep->server_rep_version > 0) { + *rep_length += (ntohs(format->server_format_rep->top_bytes_format_rep_length) << 16); + } return (char*)format->server_format_rep; } diff --git a/fm/fm_internal.h b/fm/fm_internal.h index 988420cc0c..aafbeb6191 100755 --- a/fm/fm_internal.h +++ b/fm/fm_internal.h @@ -45,8 +45,8 @@ typedef struct _FMVarInfoStruct { typedef struct _xml_output_info *xml_output_info; -struct _format_wire_format_0; -typedef struct _format_wire_format_0 *format_rep; +struct _format_wire_format_1; +typedef struct _format_wire_format_1 *format_rep; typedef struct _server_ID_struct { int length; @@ -131,18 +131,26 @@ typedef struct _format_server *format_server; #if SIZEOF_INT == 4 #define INT4 int +#define UINT4 unsigned int #endif #define INT2 short #define UINT2 unsigned short -struct _field_wire_format { /* 12 bytes total */ +struct _field_wire_format_0 { /* 16 bytes total */ UINT2 field_name_offset; UINT2 field_type_offset; INT4 field_size; INT4 field_offset; }; +struct _field_wire_format_1 { /* 16 bytes total */ + UINT4 field_name_offset; + UINT4 field_type_offset; + INT4 field_size; + INT4 field_offset; +}; + struct _opt_info_wire_format { /* 12 bytes total */ INT4 info_type; INT4 info_len; @@ -159,6 +167,15 @@ struct _format_wire_format_0 { /*byte 7*/ unsigned char unused2_in_format_0; }; +struct _format_wire_format_1 { +/*byte 0*/ UINT2 format_rep_length; /* transmitted in net byte order */ +/*byte 2*/ unsigned char record_byte_order; +/*byte 3*/ unsigned char server_rep_version; +/*byte 4*/ unsigned char subformat_count; +/*byte 5*/ unsigned char recursive_flag; +/*byte 6*/ UINT2 top_bytes_format_rep_length; /* transmitted in net byte order */ +}; + struct _subformat_wire_format_0 { /* 20 bytes for base */ /*byte 0*/ UINT2 subformat_rep_length; /* transmitted in net byte order */ /*byte 2*/ unsigned char server_rep_version; @@ -174,15 +191,35 @@ struct _subformat_wire_format_0 { /* 20 bytes for base */ /*byte 19*/ unsigned char alignment; }; +struct _subformat_wire_format_1 { /* 28 bytes for base */ +/*byte 0*/ UINT2 subformat_rep_length; /* transmitted in net byte order */ +/*byte 2*/ unsigned char server_rep_version; +/*byte 3*/ unsigned char record_byte_order; +/*byte 4*/ UINT4 name_offset; /* native host byte order */ +/*byte 8*/ UINT4 field_count; +/*byte 12*/ INT4 record_length; +/*byte 16*/ unsigned char pointer_size; +/*byte 17*/ unsigned char header_size; +/*byte 18*/ UINT2 floating_point_rep; +/*byte 20*/ UINT2 opt_info_offset; +/*byte 22*/ unsigned char column_major_arrays; /* false for C, true for Fortran */ +/*byte 23*/ unsigned char alignment; +/*byte 24*/ UINT2 top_bytes_subformat_rep_length; /* transmitted in net byte order */ +/*byte 26*/ unsigned char unused0_f1; +/*byte 27*/ unsigned char unused1_f1; +}; + struct _format_wire_format { union { struct _format_wire_format_0 f0; + struct _format_wire_format_1 f1; }f; }; struct _subformat_wire_format { union { struct _subformat_wire_format_0 f0; + struct _subformat_wire_format_1 f1; }f; }; @@ -202,6 +239,14 @@ typedef struct { unsigned INT4 hash2; } version_2_format_ID; +typedef struct { + unsigned char version; + unsigned char top_byte_rep_len; + unsigned INT2 rep_len; + unsigned INT4 hash1; + unsigned INT4 hash2; +} version_3_format_ID; + #define DEFAULT_FS_PORT 5347 #if SIZEOF_LONG_DOUBLE != 0 && SIZEOF_LONG_DOUBLE != SIZEOF_DOUBLE @@ -262,8 +307,8 @@ extern int FFS_gen_authentication (unsigned char *outbuf); extern int serverAtomicRead(void *fd, void *buffer, int length); extern void stringify_server_ID(unsigned char *ID, char *buffer, int len); extern void -generate_format2_server_ID(server_ID_type *server_ID, - struct _format_wire_format_0 *server_format_rep); +generate_format3_server_ID(server_ID_type *server_ID, + struct _format_wire_format_1 *server_format_rep); extern void add_format_to_iofile(FMContext fmc, FMFormat ioformat, int id_size, void *id_buffer, int index); diff --git a/fm/progs/server.c b/fm/progs/server.c index d0cb488f26..325a963a5a 100755 --- a/fm/progs/server.c +++ b/fm/progs/server.c @@ -862,10 +862,10 @@ int requested_id_version; break; case 2: if (!ioformat->server_ID.value) { - generate_format2_server_ID(&ioformat->server_ID, ioformat->server_format_rep); + generate_format3_server_ID(&ioformat->server_ID, ioformat->server_format_rep); } else { server_ID_type tmp; - generate_format2_server_ID(&tmp, ioformat->server_format_rep); + generate_format3_server_ID(&tmp, ioformat->server_format_rep); if (tmp.length != ioformat->server_ID.length) { LOG(fs, "Version 2 IDs differ in length\n"); }