forked from sezero/watt32
-
Notifications
You must be signed in to change notification settings - Fork 8
/
changes
3595 lines (2610 loc) · 149 KB
/
changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
CHANGES (formerly readme.2nd)?
If you are programming with the Waterloo TCP library, the following notes
may prove helpful. Latest changes are added at the top.
- - -
******************* Changes by Juan Manuel Guerrero *********************
2019-12-18 Juan M. Guerrero <juan.guerrero@gmx.de>
* src/misc.c [__DJGPP__]: Provide an implementation for __readfsdword.
* src/cpumodel.h [__NO_INLINE__, __DJGPP__]: If __NO_INLINE__ is defined
no functions are provided at all, thus disable this exclusion for DJGPP.
2019-07-06 Juan M. Guerrero <juan.guerrero@gmx.de>
* inc/poll.h: New. POSIX requires (AFAIK) this file in a base-dir.
2018-09-01 Juan M. Guerrero <juan.guerrero@gmx.de>
* util/sysdep.h [__CYGWIN__]: Macros to replace non-standard functions
like stricmp and strnicmp.
2018-08-22 Juan M. Guerrero <juan.guerrero@gmx.de>
* bin/djgpp.mak: For gcc 5.N.N and higher versions add `-fgnu89-inline'
to the CFLAGS to ensure that always traditional GNU extern inline semantics
are used even if ISO C99 semantics have been specified. ISO C99 semantics
is always the default for gcc 5.N.N and higher versions.
Install target and prefix variable added.
* src/makefile.all: For gcc 5.N.N and higher versions add `-fgnu89-inline'
to the CFLAGS to ensure that always traditional GNU extern inline semantics
are used even if ISO C99 semantics have been specified. ISO C99 semantics
is always the default for gcc 5.N.N and higher versions.
Install target and prefix variable added.
* src/misc.c: stack_limit not used by DJGPP.
* src/pcarp.c [TEST_PROG]: Unused variables: num_okay and num_fail.
* src/pcsed.c (_eth_init): Initialize mac_tx_format and mac_transmit
to some sane default in case that no packet driver has been installed.
* src/sock_ini.c: Use FALSE instead of 0.
* src/tests/fsext.c (main): Avoid ordered comparison of pointer with
integer zero.
* src/tests/ttime2.c (main): Initialize lastsec before using it.
* src/tests/makefile.all: For gcc 5.N.N and higher versions add
`-fgnu89-inline' to the CFLAGS to ensure that always traditional GNU
extern inline semantics are used even if ISO C99 semantics have been
specified. ISO C99 semantics is always the default for gcc 5.N.N and
higher versions.
For DJGPP do not build neither swap.$(EXE) nor timeit_test.$(EXE).
******************* Changes version 2.2 dev.rel. 11 *********************
* The .\src build direcory layout is changed:
each generated makefile puts it's stuff under '.\src\build'.
Thus the layout is now:
%WATT_ROOT%\src\build\borland
%WATT_ROOT%\src\build\clang
%WATT_ROOT%\src\build\CygWin
%WATT_ROOT%\src\build\digmars
%WATT_ROOT%\src\build\djgpp
%WATT_ROOT%\src\build\HighC
%WATT_ROOT%\src\build\ladsoft
%WATT_ROOT%\src\build\lcc
%WATT_ROOT%\src\build\MinGW32
%WATT_ROOT%\src\build\MinGW64
%WATT_ROOT%\src\build\pellesc
%WATT_ROOT%\src\build\visualc
%WATT_ROOT%\src\build\VisualStudio
%WATT_ROOT%\src\build\watcom
* Removed all support for MS' Quick-C.
* Removed all code inside 'MAKE_TSR', 'USE_BIGENDIAN' and 'BIG_ENDIAN_MACHINE'.
Removed macros 'OLD_TURBOC', 'BORLAND_WIN32'.
Patches from Juan M. Guerrero <juan.guerrero@gmx.de>,
20 - 31 December 2015
* inc/sys/un.h: Definitions for UNIX domain sockets.
* src/tests/ttime2.c (main): Pacify compiler by initilizing variable.
* src/tests/configur.bat: Do never assume that the DJGPP build is
done on plain DOS only. This means allow to build on Windows OS too.
* inc/netinet/in.h: Define new type sa_family_t as unsigned short.
Use sa_family_t instead of unsigned short in sockaddr_in and sockaddr_storage
structs.
* src/get_ni.c (getnameinfo): Use sa_family_t.
* src/btree.c [TEST_PROG, __DJGPP__]: Include conio.h to provide
getch() prototype.
* inc/sys/socket.h: Define new type socklen_t as int.
Replace int by socklen_t in struct msghdr and in functions: accept,
bind, connect, getpeername, getsockname, getsockopt, recvfrom,
sendto and setsockopt.
* inc/netdb.h: Replace int by socklen_t in functions: gethostbyaddr
and getnameinfo.
* src/accept.c: Replace int by socklen_t in accept definition.
* src/bind.c: Replace int by socklen_t in bind definition.
* src/connect.c: Replace int by socklen_t in connect definition.
* src/getname.c: Replace int by socklen_t in getsockname and
getpeername definition.
* src/socket.c: Replace int by socklen_t in _sock_chk_sockaddr
definition.
* src/sockopt.c: Replace int by socklen_t in getsockopt and
setsockopt definition.
* src/receive.c: Replace int by socklen_t in recvfrom definition.
* src/transmit.c: Replace int by socklen_t in sendto definition.
* src/configur.bat: Do never assume that the DJGPP build is done
only on plain DOS. This means allow to build on Windows OS too.
-------------------------------------------------------------------------------------
* src/*.[ch]. Dropped all 'lint' symbols. Like '/*@unused*/' and
'#ifdef lint'.
* src/makefile.all, etc. Added support for CygWin64.
* src/makefile.all, etc. Dropped support for MS Quick-C.
* bin/htget.c: Added a "Host: " header for non-proxied requests.
* pcarp.[ch]: renamed _arp_add_cache() -> _arp_cache_add() and
renamed _arp_delete_cache() -> _arp_cache_del().
* Prelimitnary support for Watcom 32-bit DOS with the Flashtek X32VM extender.
Ref. x32vm.c.
* Dropped support for old Turbo-C.
* Redone language.l: The Flex generated lang.c is now included inside language.c.
This was need for Watcom C.
* Because the various make programs (notably Borland's maker) has all kinds
of troubles with source-files in several directories, all files formerly
in 'src\zlib' has been prefixed with 'z' and moved to 'src' directory.
Filenames kept 8+3 clean.
* Rearranged ifdef's like "#if !defined(WIN32)" into "#if defined(__MSDOS__)".
target.h ensures that all MSDOS compilers defines '__MSDOS__'.
* Removed all references to "djgpp_dxe" and "WATT32_DOS_DLL". Their motive
were futile.
* packet32.c changes for Win-Vista; Due to User Access restrictions in
Vista+, I could not access the "%WINDIR\system32\drivers\npf.sys" file to
retrieve the version information (GetFileVersion). Hence if '_watt_os_ver
>= 0x600' (Vista), we pretend the npf version is >= 4. So we use the right
method to get and set an event-handle (PacketSetReadEvt4xx).
* renamed pcmulti.[ch] to pcigmp.[ch].
* renamed udp_dom.[ch] to pcdns.[ch].
* dynip.c change: Set `get_req' to "/" if not present in "DYNIP.MY_IPADDRESS".
* sock_ini.c change: Added argument "time_t_size" to "watt_sock_init()".
Added "check_time_t()" to warn about incompatible 'time_t' size.
* target.h change: Print an "#error" if building with VC-9+ and we're not
building with "-D_USE_32BIT_TIME_T". Building with the default 64-bit
'time_t' will break ABI compatability (e.g. using a MSVC built DLL in
MingW).
Note: I've since reverted this change. The ABI-breakage doesn't seems to
happen.
* pcdbug.c change: Print a warning if receive-mode isn't sufficiently
high to receive all traffic when "filter.none" is used.
* util/vcc_err.exe rebuilt with Visual Studio 2008 (MSVC-9).
* Added Visual Studio solution and project files; src\VisualStudio\watt-32.sln
and src\VisualStudio\watt-32.vcproj. Silenced most potentially harmful
warnings when building with "cl -Wp64".
* Makefile.all, target.h changes for silent building with MS Visual Studio
2008. I.e. added `-D_CRT_SECURE_NO_WARNINGS' and suppress warnings 4244,
4267, 4312 and 4996 (those are harmless).
* inc/sys/werrno.h, src/neterr.c change: Renamed `strerror_s()' to
`strerror_s_()'. (due to MSVC-9 <string.h> uses same name').
* misc.* change: Changed 1st argument in 'valid_addr()' to `const void*'.
* sys/cdefs.h, sys/wtime.h change: MingW 3.10 added `struct timezone'
and `gettimeofday()' in it's <sys/time.h>. Added `W32_MINGW_VER' macro
to #ifdef around the definition.
* sys/ioctl.h change: Replaced "DJGPP" with "__DJGPP__".
* Made building with "define USE_UDP_ONLY" possible.
* pcqueue.h change: Increase `RX_BUFS' to 50 for Win32 targets.
* .\bin\ftpsrv\ftpsrv.c change: Philippe Meynard found a bug in
`SendDirectory()' triggered by building Watt-32 with a 2KByte `MAX_WINDOW'.
The easy fix was to replace `sock_fastwrite()' with `sock_write()'.
* .\inc\tcp.h change: Embed "old" macros inside "#ifndef WATT32_NO_OLDIES".
* pctcp.c change: In `_udp_cancel()' make sure a passive socket doesn't
gets closed (`udp_close()') upon receiving an ICMP-error packet.
* pcarp.[ch], config.h, version.c change: Removed all traces of code inside
`USE_SECURE_ARP'.
* pcsarp.[ch] removed from make process.
* timer.[ch] change: Moved profiler code (USE_PROFILER) to new files
profile.[ch].
* pcdhcp.c fixes: (1) ACK message options are parsed. (2) when a lease is
in renew, rebind, or has expired, a proper conversation with the DHCP
server is initiated and the transient config file is updated. And more
small fixes. Contributed by <duanev@io.com>.
* Fixed code for a silent compile using "gcc -Wcast-align".
* cpumodel.s / cpumodel.asm change: Chris Rodie <ccrodie@bellsouth.net>
contributed a fix for SG Microelectronic STPC processors.
* .\bin\country.c change: Rewritten `find_county_from_cname()' for version
2 of the Nerd.dk protocol.
* strings.c change: Return from `out*()' functions if `_outch' is NULL.
* sys/socket.h change: Added `MSG_NOSIGNAL' (0x80).
* New file .\bin\wc_win.mak for making samples with Watcom/Win32.
* pcmulti.h change: Decorate `_multicast_on', `join_mcast_group' and
`leave_mcast_group' for Win32 export.
* winpkt.c change: `pkt_get_drvr_ver()' now returns 4 components of version.
* pcpkt.c change: `pkt_get_drvr_ver()' now returns 2 components of version.
* packet32.* change: Recoded `PacketSetReadEvt()' for WinPcap 4.0.
* packet32.* change: Added `PacketSetLoopbackBehavior()' for WinPcap 4.0.
* pcpkt.c change: Removed support for "PKT.TXMODE = ASYNC" since no known
driver supports this. And the advantage would be questionable.
* pcdhcp.c fix: In the REQUESTING state, restart the send timer.
Contributed by Paul Suggs <Paul.Suggs@vgt.net>.
* printk.c fix: free the `printk_buf' memory in `printk_exit()'.
Contributed by Paul Suggs <Paul.Suggs@vgt.net>.
* pctcp.* change: Added new function `stopwattcpd()' to clear list of
running daemons. Contributed by Paul Suggs <Paul.Suggs@vgt.net>.
* sock_ini.c change: Added `stopwattcpd' daemon to run-down list. This
in order to be able to reinitialise the whole library cleanly.
Contributed by Paul Suggs <Paul.Suggs@vgt.net>.
* ./inc/sys change: Renamed "packon.h" to "pack_on.h" and "packoff,h" to
"pack_off.h".
* config.h change: Removed `#define USE_PPPOE'.
* <sys/cdefs.h> change: Moved `struct mbuf' to new file <sys/mbuf.h>.
* Fixes for OpenWatcom 1.5:
- sock_scn.c: Win32 targets have `vsscanf()'.
- inc/sys/werrno.h: don't prototype `strerror()' and `perror()'.
* misc.c fix: Added `O_BINARY' to `_sopen()' flags if `mode' contains "b".
* winpkt.h fix: `PDCLASS_FDDI' is not 3, but 2.
* timer.* change: Made `get_cpu_speed()' static. Only called from
`init_timers()'.
* Removed `USE_DYN_PACKET' and all code inside it. That in order to remove
support for Win-9x/ME (since no one has shown any interest in it).
* winpkt.* + packet32.c change: Moved `winpkt_trace()' stuff to winpkt.*.
* winpkt.c + wattcp.cfg change: Keyword "WINPCAP." changed to "WINPKT.".
* Added files SwsVpkt.[ch] for interfacing to Lawrence Rust's excellent
SwsVpkt for DOS *and* Windows. Ref. http://www.softsystem.co.uk/page7.html
* sock_ini.c/pcsed.c/pcrecv.c/tcp_fsm.c change: Don't test for `_eth_ndis3pkt'
for Win32 targets.
* winpkt.c change: Dump file renamed to "$(TEMP)\\winpkt_dump.txt".
* Renamed winpcap.* to winpkt.*. winpkt.c is now also an interface to
SwsVpkt driver for Win32 programs.
******************* Changes version 2.2 dev.rel.10 ******************
* makefile.all change: Added support for Borland on Win32 (preliminary, not
fully working. Only static library at the moment).
* ./util/mkmake.c changes for S-Lang 2.x; the preprocessor API was changed
in version 2.0.
* Added Pelles-C support (__POCC__) for Win32 targets.
Ref: http://www.smorgasbordet.com/pellesc/
* src/iconv/*.* change: Ran these sources through GNU `ident'.
* pcrecv.c change: For UDP sockets, drop packets looped back by NDIS3PKT
or SwsVpkt drivers under Windows.
* inc/sys/wtypes.h change: Include <stdint.h> for OpenWatcom 1.3 or later.
* ufortify.h change: Add `FORTIFY_GLOBAL_REPLACE' to debug `GlobalAllocPtr()'
and `GlobalFreePtr()'. Used by packet32.c.
* tcp_fsm.c changes: Carey Evans <carey.evans@gmail.com> rewrote the
TCP reassembly code in `tcp_process_data()'. Added functions
`append_out_of_order()', `prepend_out_of_order()' and `copy_in_order()'.
* cpumodel.* changes: Integrated some changes from Carey Evans
<carey.evans@gmail.com>.
* getnet.c fix: forgot to set `n2->n_addrtype = n->n_addrtype' in
`ReadNetworksFile()'.
* netaddr.* change: Renamed `inet_atoeth()' to `_inet_atoeth()'.
* Added ./bin/hx-dos.mak for making Watcom + HX-DOS sample programs.
* wdpmi.c change: Added detection of HX-DOS extended programs;
`dpmi_is_hxdos()'.
* sys/wtime.h change: Don't include <sys/times.h> for MingW. It's no
longer part of MingW.
* pcdhcp.c change: Call `setdomainname()' with `len+1'. Noted by
<flavm76@yahoo.com>.
* pctcp.h, <tcp.h> change: Renamed "mtu" and "mss" to "_mtu"/"_mss".
Due to clashes with OpenSSL etc.
* sys/ioctl.h change: Provide prototype for `ioctl()'.
* Added several typecasts to silence build with gcc 4.0.
* ioctl.c fixes: Carey Evans fixed setting and getting netmask;
case SIOCGIFNETMASK, SIOCSIFNETMASK and SIOCGIFCONF.
* config.h / packet32.* / winpcap.c change: Win32 only. Added USE_DYN_PACKET
to load packet.dll dynamically. Thus allowing Watt-32 to work with Win32
programs on Win-9x/ME.
* winpcap.c change: Replace `printf' with `(*_printf)' in `show_link_details()'.
* transmit.c change: `errno' changed from ENOTCONN to EPIPE if tcp-state
is wrong or `tcp_tick()' fails.
* receive.c change: `errno' changed from ENOTCONN to EPIPE if `tcp_tick()'
fails.
* makefile.all change: Use `ml' to assemble under Visual-C and Windows
(not `tasm').
* tcp_fsm.c bug fix: The detection of keepalive in `tcp_process_ack()'
was wrong; should be "SEQ = RCV.NXT". Moved that to `tcp_estab_state()'
and reply with an ACK if we didn't sent anything else.
* gethost.c, gethost6.c, getserv.c, getprot.c, getnet.c changes: Plug the
memory-leak in `endXent()' functions; only return if `_watt_fatal_error'
is set (possible on DOS only). Otherwise free the linked lists.
* pcsed.c change: `_eth_join_mcast_group()' tries to set RXMODE_MULTICAST1
if not already set. If `_pkt_rxmode' is multicast-2 or promiscous, there
is no need to set mcast-1 or retrieve the multicast list.
* pcpkt.c fix: Changed the `POKEL()' arguments for X32VM and POWERPAK
targets.
* makefile.all change: No need to use `%WATT_ROOT' for Watcom targets.
Output rule `$(LINKARG)' only for Win32 target.
* ioctl.c change: Handle `SIOCSIFFLAGS' command, but only for SOCK_PACKET
type sockets.
* select.c change: New function `handle_ready()' called from `read_select()'.
But for DOS only.
* misc.c change: In `watt_kbhit()', don't test the unget character (`_cbyte'
or `ungetchar'). That caused the function to produce fake kbhits after
`getch()' is called.
* Added test program: src\tests\packet.c for AF_PACKET testing.
* socket.c change: Redesigned Rx-pool logic for AF_PACKET sockets. It
now uses a `pkt_ringbuf' buffer of `MAX_PACKET_BUFS' (10) receive-
buffers. To-do: make the number configurable?.
* winmisc.c change: Added `WSAStartup()' for Winsock compatability.
* x32vm.c change: Save and restore ESI, EDI and EBX registers in some
places.
* tcp_fsm.c change: Limit the Tx buffer size to 6*MSS if using NDIS3PKT
driver. This is to bypass the limitated buffer count allocated for a
DOS-box.
* pcpkt.c change: Added config keyword "PKT.TXWAIT" (pkt_txwait).
This specifies how many msec to wait between retries if Tx fails.
If using NDIS3PKT, this value is at least 1.
******************* Changes version 2.2 dev.rel.9 *******************
* accept.c change: Added `_sock_sig_pending()' to be able to get out of
a stuck loop. Changed condition for connected slot; state >= ESTAB and
state < CLOSED.
* poll.c change: Adapted to handle `MAX_SOCKETS' file/socket handles.
Does not use djgpp's select(). Added `SOCK_DEBUGF()'.
* poll.h change: Moved this header to ".\inc\sys" since no targets have
it.
* select.c change: `read_select()' and `write_select()' now uses djgpp's
own select() when checking standard handles (0-2). This allow testing
if redirected handles are ready.
* udp_dom.c change: Host-names with a trailing '.' shall not cause resolve()
to do a recursive DNS lookup. E.g. resolve("foo.") should simply ask for
address of "foo" and not "foo.domain" etc.
* makefile.all change: Added support for LCC-Win32 compiler (experimental).
CFLAGS for Digital Mars changed; does not use options `-NS' and `-C'.
* pcpkt*.* change: Adapted for `USE_FAST_PKT' with Pharlap, PowerPak
and X32VM extenders. This is now default for all 32-bit targets
except Win32.
* netaddr.c change: `_inet_ntoa()' uses 2 buffers in round-robin if `s'
is NULL.
* bsdname.c change: Changed initial if-test; check that `s->tcp.hisaddr'
and `s->tcp.hisport' are non-zero.
* accept.c change: Protect accept-loop with `_sock_crit_start()' and
`_sock_crit_stop()'.
* socket.h change: `MAX_SOCKETS' increased to 5000. Not really effective
for djgpp since it is limited by max # of DOS handles that can be
created.
* config.h / socket.[ch] change: Removed `#define USE_SOCK_PACKET'. Code
inside it is now default for `USE_BSD_API' code.
* pcdhcp.c change: `set_gateway()' deletes any previous configured gate-
way if value in W32DHCP.TMP is non-zero.
* watt-32.rc change: Added BUILDER (compiler) to product-version field.
Removed watt-32.ico statement.
* winpcap.c change: Test if running Win-NT4 or later; winpcap.c doesn't
work for Win-9x/ME/CE.
* sock_ini.c change: Watcom can use register calls for Win32 targets;
I.e. don't generate an "#error" message. But a Watcom register-call
based watt-32.dll will not work with MSVC or MingW programs.
* misc.h change: Watcom uses 'i64' suffix for 64-bit values.
******************* Changes version 2.2 dev.rel.8 *******************
* pcmulti.c change: Fixed input length calculation. Protect against
multicast-reports looped back by driver (NDIS under Windows).
* sockopt.c change: Set `_multicast_on' if any multicast options are set
or queried. Added handling of `IP_MULTICAST_TTL' and `IP_MULTICAST_LOOP'
(allthough alway 0).
* bsddbug.c change: Change to enable use of `OutputDebugString()' under
Windows. Enabled by "SK_DEBUG.DEVICE = $ODS" in wattcp.cfg.
* pcdbug.c change: Added decoding of T_TXT records in `dns_resource()'.
* pcarp.c change: In `_arp_handler()', print an address conflict warning
if a duplicate IP is found on the network.
* pctcp.c change: Protect against nmap NULL scans. If we receive a TCP
segment to a closed port with all flags off, just drop it (don't answer
with a RST).
* pcdhcp.c change: Call `dhcp_open()' in `DHCP_read_config()' to allocate
a socket. This is needed by DHCP state functions BOUND and RENEWING
called in `eval_timers()'.
* pcsed.c change: Changed `_eth_arrived()' to allow being called with
"type == NULL".
* misc.h change: This file was becoming too big. Moved the timer.c
prototypes and macros to timer.h.
* packet32.* / winpcap.* changes: No need to have the WinPcap SDK installed.
Copied <NTDdNdis.h> WinPcap and added BPF structures to Packet.h.
`pkt_get_stats()' updated to return total statistics.
Added profiling code in `PacketRequest()'.
* misc.c change: New function `fopen_excl()' that on Windows opens a file
in share-mode but denying write by other processes. Uses `fdopen() on
file-descriptor.
* pcdbug.c change: Refined `is_looped()' to consider the case of Winsock
sending (with a different source IP-address). Don't consider that a
looped packet.
* poll.c change: `except' is a pseudo-reserved keyword in Digital-Mars on
Win32. Undefine it before use.
* pcstat.c change: `tcps_connattempt' is connection attemptes on *output*.
`tcps_accepts' is connection accepted on *input*. No counter AFAICS for
attempts to a closed socket (SYN scans).
******************* Changes version 2.2 dev.rel.7 *******************
* pcsed.c change: In `_eth_send()' change how IP loopback-addresses
should be handled; If "(loopback_mode & LBACK_MODE_WINSOCK)", send
to WinPcap driver and the packet is sent on the wire. A later vesion
will try to send to the Winsock loopback provider (a TDI?). The config
keyword "IP.LOOPBACK" thus changed to a bit-mask.
* ports.c change: Allocate `lport_inuse' from heap. Free in rundown
function `exit_localport()'.
* bsddebug.[ch] change: `_sock_enter_scope()', `_sock_leave_scope()' and
`_sock_dbug_flush()' are now macros.
Whole file only built if "USE_DEBUG" and "USE_BSD_API" are defined.
* udp_dom.c change: Optionally try querying the Windows DNS cache before
sending a query to the DNS server(s). Enabled by "DOMAIN.WINDNS = 1".
WIN32 only.
* New file winmisc.c for WIN32 stuff only. New functions `WinDnsQuery*()'
for querying the Windows global DNS cache for A and PTR records.
Controlled by `WINDNS_x' bits in `dns_windns'.
* misc.c change: Added `memdbg_init()' for controlled reporting of runtime
asserts from MSVC's CrtDbg (WIN) and Fortify's reporter. `crtdbg_report()'
traces to `stderr' and causes a breakpoint on assert failures. Hence the
debugger attaches to process and gives a stack backtrace. Later a stack-
walker will be added for finer details.
* misc.[ch] change: Renamed `errno_s' to `_w32_errno'. Increased # of
`exit_list[]' elements to 40.
* Renamed "WATT32_DLL" to "WATT32_DOS_DLL" to not confuse it with generation
of a Win32-DLL version. Renamed "USE_BSD_FUNC" to "USE_BSD_API".
* config.h change: Removed "USE_BSD_FORTIFY". Added "USE_CRTDBG" if MSVC
debug-mode is used. Include <crtdbg.h> in "wattcp.h" only.
Initialise malloc debugging in `memdbg_init()'. Due to data-segment
overflow in most program, USE_BSD_FUNC, USE_DHCP etc. are removed for
all large-models.
* wattcp.h change: Renamed "_DLL" to "WATT32_DLL" due to clash with Visual-C.
* pcpkt.c change: Added asynchronous transmit feature. If this fails in
`pkt_send()', revert back to normal sync transmit. Enabled by
"pkt.txmode = async,timeout" in WATTCP.CFG.
* gettod.c change: Test for `user_tick_active' set by `init_timer_isr()'
and return local-time.
* time.c change: (djgpp) Restore previous SIGALRM handler and interval
timer value in `exit_timer_isr()'.
* winpcap.c changes: Configuration keywords for Windows only:
"PCAP.DEVICE" -> NPF.SYS device-name to use. Default is none which
will selects the 1st suitable device found.
"PCAP.DUMPFILE" -> Filename for dumping WinPcap details.
"PCAP.TXRETRIES" -> # of transmit retries.
"PCAP.TXMODE" -> Select overlapping transmit mode (not yet).
"PCAP.RXMODE" -> Startup receive mode.
"PCAP.RXBUFS" -> Number of kernel buffers for NPF.SYS.
"PCAP.HIGHPRIO" -> Select real-time priority for the capture thread.
* New files packet32.[ch]: Heavily modified, simplified and ANSI-fied from
the WinPcap version. With this addition, Watt-32 on Windows actually works
very well !
* New files winpcap.[ch]: Added Windows and WinPcap support. WinPcap driver
and SDK is available from http://winpcap.polito.it/.
* configur.bat changes: "depend.wat" renamed to "watt32.dep".
* misc.c etc: Dropped use of `BIG_ENDIAN_MACHINE' define. Test only using
`USE_BIGENDIAN'.
* pcconfig.c / timer.c change: Splitted "PROFILE" into "PROFILE.ENABLE" and
"PROFILE.FILE". `profile_init()' now called from `tcp_post_init()'.
* pcdbug.c bug fix: DNS over TCP has a 2-byte length prefix. So call
`dns_dump()' on `data+2' in `tcp_dump()'.
* pcdbug.c change: Decode `T_MX' resource records in `dns_resource()'.
* gethost?.c change: `h->h_name' is now correctly replaced with CNAME if
present in udp_dom.c reply. The original query name is then placed in
`h->h_aliases[0]' (only supports 1 alias per node).
* gethost?.c / udp_dom.c change: Extract alternate list of addresses from
DNS reply; main address is taken from 1st Resource Record and the remaining
A-records is put in alternate list `dom_a4list[]' or `dom_a6list[]'. Used
by `getXbyY()' functions to build the `h->h_addr_list[]' in `fill_hostent()'.
* pcdbug.c change: Added dumping of WINS/WINS-R records in `dns_resource()'.
* connect.c change: Fixed timeout detection in `nblk_connect()'.
I.e. if there is no "ARP response", use a new `sock->nb_timer' to detect
this situation. `tcp_no_arp()' already have set the `sock->so_error'.
* New files dynip.[ch], implements a simple dynamic IP update client.
See ".\bin\dynip.cfg" for configuration. This file could be included from
"wattcp.cfg".
* sockopt.c change: setting TCP_MAXSEG never fails; asserts the value is
between MSS_MIN and MSS_MAX. Handle getting/setting SO_DONTLINGER.
* tcp.h change: Set `*statusptr' = -1 on `tcp_tick()' fail.
To be consistent with other `sock_wait_x' macros.
* tcp_fsm.c change: handle TCP options below. Doesn't do anything with them
though.
* pcdbug.c change: Print "Alternate Checksum Request/Data" TCP options.
TCPOPT_CHKSUM_REQ (14) and TCPOPT_CHKSUM_DAT (15) from RFC-1146.
* pcdhcp.c change: Make the default "W32DHCP.TMP" in %TEMP% directory (unless
overridden by DHCP.CONFIG). Fix for `DHCP_read_config()' returning when it
shouldn't. Reported by Doug Kaufman.
Renamed `_dodhcp' to `DHCP_do_boot'.
* strings.c fix: `strreplace()' didn't advance string in the while-loop.
Reported by Doug Kaufman.
* pcdbug.c change: Print MD5-signature TCP option.
* pctcp.c change: Added insertion and checking of TCP MD5-signature option
from RFC-2385.
* New file tcp_md5.c: Based on RFC-2385 and tcpdump sources, I made this
little extension. A single API function `tcp_md5_Secret()' is used to
calculate the MD5 fingr-print. No function for exchanging secrets with
other peers.
* shutdown.c change: Sets `socket->so_error = ESHUTDOWN'.
* pcpkt.c change: `release_real_mem()' didn't free DOS memory in the rare
case when `_pkt_inf->rm_mem.pm_offset' was 0 (Win9x/ME). Now tests that
`_pkt_inf->rm_mem.rm_offset' is zero before calling DPMI function 101h.
Reported by Doug Kaufman.
* get_ai.c change: Rewritten to plug a memory leak (`aplist' and `apbuf'
wasn't freed).
* New files iconv\*.h, idna.* and punycode.* to support internal characters
in domain-names. Function `IDNA_convert_to_ACE()' called from udp_dom.c
to convert a domain-name to ACE format. Function `IDNA_convert_from_ACE()'
called from udp_rev.c to convert result to native charset. Set WATTCP.CFG
keyword "domain.idna = 0" to disable.
* socket.c etc. change: Removed `USE_LIBPCAP' and added support for
`SOCK_PACKET' sockets (raw link-layer). Added header <net/if_packet.h>
from Linux 2.x. Effective only if "USE_SOCK_PACKET" is defined (default
for all 32-bit targets).
* pcicmp.c change: In `icmp_send_unreach()' limit sending to 20 messages
per second. Ref. RFC-1812.
* pctcp.c change: In `tcp_opt_timestamp()' send `TSval' as # msec since
`watt_sock_init()' was called (relative `start_time').
* pctcp.c change: If socket is listening (LF_IS_SERVER), `tcp_sockreset()'
resets various socket params and goes back to listening.
* pctcp.c fix: `sock_mode()' called with neither TCP_MODE_NAGLE nor
TCP_MODE_NONAGLE bits set was turning Nagle off.
* pcstat.c change: Added counter for `tcpstats.tcps_closed' when sending
FIN or RST.
* pctcp.c change: Fixed config keyword "TCP.TIMER.RESET_TO = 0" to mean
always send a reset for a connection to a closed port. Otherwise, send
RST maximum once per "TCP.TIMER.RESET_TO" time (default 100 msec).
* makefile.all change: Since some make program have problems with sources
in multiple directories I moved .c-sources from zlib/ to src/ and prefixed
with `zl_'.
* config.h change: Added options for zlib `Z_PREFIX' and `FASTEST'.
* pcconfig.* change: `ARG_ATON' renamed to `ARG_ATOIP'.
******************* Changes version 2.2 dev.rel.6 *******************
* pcintr.c change: Save and chain to previous SIGALRM handler (djgpp only).
* misc.h change: Printing a `double' does *not* use "lf" for small/large
models. Uses "f" as all others.
* timer.c change: Bernd Omenitch <Omenitsch@cashpoint.at> contributed code
for timer ISRs; init_timer_isr(), exit_timer_isr() and new_int_8().
Adapted for djgpp, Pharlap and PowerPak also.
* pcconfig.c change: Renamed some "DOMAIN" keywords:
"domain_list" -> "domain.suffix" (to agree what Windows et.al calls it).
"domain_to" -> "domain.timeout"
"domain_recurse" -> "domain.recurse"
Supports old keywords too, but with a deprecated warning (deprecated_key()).
New experimental keywords:
"domain.do_ipv6" and "domain.idna" : See wattcp.cfg.
* pctcp.c change: `_udp_cancel()' and `_tcp_cancel()' calls new function
`sock_reduce_mss()' to reduce MSS in case of an `ICMP_UNREACH_NEEDFRAG'
code. Has no effect on UDP sockets at the moment (not sure it should have).
* pcicmp.c change: Added test for `ICMP_UNREACH_NEEDFRAG' code. Get `next MTU'
from ICMP-packet (this is 0 if router doesn't support RFC-1191) and call
`_*_cancel()'.
* udp_dom.c / udp_rev.c change: Support national characters in DNS name
(forward and reverse) lookups. Only if compiled with `USE_IDNA' (ref.
config.h). This is experimental and may not be able to convert every
charsets to UTF-8 codepoints.
* res_send.c bugfix: Forgot to call `sock_close()' for UDP resolver socket.
This caused `udp_close()' in a new `udp_open()' to crash since socket
was free'd but memory was invalid (the wonders of paging under Windows).
* signal.c change: Rewritten to *not* use `setjmp()' and `longjmp()' as
this is safest when the application also traps SIGINT or ignores SIGINT
completely (`signal(SIGINT,SIG_IGN)'). Now does *not* trap SIGALRM since
we really only need to issue EINTR errors for SIGINT.
* select.c change: Now sets `errno' to `EINTR' if a signal was caught and
return -1. I.e. `_sock_sig_pending()' is non-zero.
* socket.c bugfix: `_TCP_open()' did set "->flags |= LF_NOCLOSE" on non-
blocking connections causing ECN/CWR flags to be sent in TCP-header.
Now AND with `tcp_flagMASK'. Should be "->locflags |= LF_NOCLOSE".
* ip4_out.c change: Added a `_ip4_dont_frag' flag (default FALSE) to control
default DF bit in IP-header. Changed from config via "IP.DONT_FRAG = 0/1".
* pcarp.c change: Make `arp_rexmit_to' configurable; "ARP.RETRANS_TO" in
WATTCP.CFG. Default is 250 msec.
* socket.c change: Refined `icmp_callback()' to set socket error to ENETUNREACH
if receiving "ICMP Network Unreachable". Otherwise EHOSTUNREACH on other
"ICMP Unreachable" codes or ECONNREFUSED on "ICMP Parameter Problem".
* pcdbug.c change: Decode SOA records in DNS debugger.
* pcdbug.c bug-fix: `struct DNS_Hdr' bit-fields was in wrong endian order.
Added printing of `s->recv_next' ("RCV.NXT") and `s->send-next' ("SND.NXT").
* fcntl.c/ioctl.c change: Non-blocking sockets should have infinite connect
timeout (or be controlled by calling application). Therefore reset the
timers `sock->timeout' and `sock->tcp_sock->timeout' when setting SS_NBIO
flag on socket.
* udp_dom.c change: Don't quit `lookup_domain()' on receiving the wrong
ID. That could be caused by two rapid requests and crossing responses.
E.g. called from `getaddrinfo()'.
* udp_rev.c change: `query_init_ip6()' now uses the "ip6.arpa" domain for
reverse lookup of IPv6 addresses.
* pcdbug.c changes:
- Prints some of transport layer header in `ip4_orig_dump()'.
- Prints "RTT-diff" in msec.
- Rewritten IP4-fragment printing.
- `write_pcap_packet()' now uses CPU-timestamp from `struct _eth_last'.
* udp_dom.c change: Rewritten `unpack_domain()' to safe-guard against
trashed DNS-server responses.
* gethost.c fix: Calling `netdb_init()' from `endhostent()' could cause
recursion problems if `sock_exit()' was called before `endhostent()'.
It now only checks file and filename. Return if either is NULL.
* tcp_fsm.c / pctcp.c change: Added `tcp_reasm' config-variable to work
around a bug (?) in TCP reassembly logic. Setting "tcp.reasm = 0"
(default) prevents inserting a possibly overlapping fragment into the
receive buffer. Ref. `tcp_ProcessData()'.
* pctcp.c change: In `tcp_options()'; don't send a Timestamp option in a
FIN segment.
* pcpkt.c change: Fixed the `loadds' pragma for Watcom in `pkt_release()'.
Previously it had no effect. Now it loads the default DS register.
* chksum.h change: `inchksum()' renamed to `in_checksum()' and
`inchksum_fast()' renamed to `in_checksum_fast()'. Renamed `*_chksum()'
to `*_hecksum()' everywhere.
* receive.c change: Added function `recvmsg()' for Linux compatibility.
* tranmsit.c change: Added function `sendmsg()' for Linux compatibility.
* misc.c change: Added function `rundown_add()' and `rundown_run()' for
controlled calling of "atexit" functions. There is now only one `atexit()'
function (`sock_exit()') which in normal exits calls `rundown_run()' to
call all registered rundown functions. Exceptions and signals are
handled a bit differently.
* misc.c change: Rewrote the `WATT_ASSERT()' macro to call new function
`assert_fail()'. Which stores assert cause in a buffer which is also
printed to debug-file at exit.
* pc_cbrk.* change: Renamed `watcbroke' to `_watt_cbroke' and
`wathndlcbrk' to `_watt_handle_cbreak'. Added compatibility macros to
<tcp.h>. Ignore BREAK checking for djgpp-version under Windows (i.e.
for DOS-versions 7.0+ (Win-9x/ME) or 5.5 (Win-NT+). This seems to trap
SIGINT generation more reliably. If BREAK checking was on, NTVDM is
very quick to terminate running program without SIGINT beeing caught.
* signal.c fix: SIGALRM (for djgpp) should be blocked while we're in loops
in `recv()', `connect()' etc. Use `_sock_sigalrm_pending()' to check if
SIGALRM was generated and pending and return -1 with `EINTR' set.
* misc.c change: Detect true DOS-version (store to `_watt_os_ver').
* pcicmp.* change: Renamed some structures to make it possible to include
both "pcicmp.h" and <netinet/ip_icmp.h> in same file (tftp.c).
* socket.* change: `SK_FIRST' is now 3 for all targets to avoid confusing
socket with standard handles.
* select.c change: It's now possible to call `select_s()' on stdin, stdout
and stderr (redirected handles not handled, should test with `isatty()'?).
* transmit.c fix: SOCK_DGRAM sockets couldn't be used in `write_s()' and
`writev_s()'. Now takes `to' address from `socket->remote_addr'.
* pctcp.* change: Removed `_tcp_syn_hook' etc. Added BSD-socket operations
(BSO_xx) called via `_bsd_socket_hook' instead.
* wattcp.h change: Renamed `sol_callb' to `icmp_callb' since this callback
is only used for ICMP events.
* gethost6.c change: Added functions `ReverseHosts6List()' and
`DumpHosts6Cache()' which is called from `_sock_dbug_exit()' at program
exit (Only if `USE_DEBUG' is defined).
* gethost.c change: Added functions `ReverseHostsList()' and
`DumpHostsCache()' which is called from `_sock_dbug_exit()' at program
exit (Only if `USE_DEBUG' is defined).
* pcdhcp.c fixes: `BROADCAST_FLAG' was set in wrong (host) endian format.
Added flag `dhcp_did_gratuitous_arp' checked from `_arp_check_gateways()'.
`setdomainname()' was truncating the last character. I.e. use `len+1'
since DHCP uses Pascal style strings and `setdomainname()' expects max
`len' to make room for 0-terminator. Same applies to `DHCP_TFTP_SERVER'
and `DHCP_BOOT_FILENAME' tags.
* sock_ini.c change: Don't call `_get_machine_name()' unless hostname
is the default ("random-pc").
* pcsed.c change: Added `_eth_mac_len' which is true length of an MAC-
address (6 for Ethernet, 7 for AX25 etc).
* Added ".\inc\err.h" file for Net/FreeBSD compatibility. Simply includes
<sys/werrno.h>.
* inc\netinet\in.h change: Added `ss_len' to `struct sockaddr_storage'.
Not used in Watt-32 library, but some Net/FreeBSD programs requires it.
* pcconfig.c change: Default value for `sock_data_timeout' (DATATIMEOUT
in WATTCP.CFG) set to zero. Too much confusion caused by the old
default value of 120 sec.
* strings.h change: Added printf argument check on `_printf'. Needs
gcc 3.x I think.
* pcstat.c change: New counter for Window update ACKs (tcps_sndwinup).
* tcp_fsm.c change: Fix for closed TCP-window (on our receiving side).
Added `s->locflag' LF_WINUPDATE. Tested in `tcp_Retransmitter()'.
* pcicmp.c change: Assert there's enough TCP-header data in `orig_ip'
before calling `tcp_cancel()' for an ICMP_UNREACH message.
* src\tftp.c, bin\tftp\tftp.c and \inc\arpa\tftp.h changes: Fixes for
receiving > 32 MByte files. Thanks to Alexander Starostin <assur@esc.ru>
for a patch.
* Fixes from Doug Kaufman:
- Move the `priorityname[]' and `facilityname[]' out of <sys/syslog.h>
and into src\syslog.c.
- Fixed some gcc warning in <sys/cdefs.h>, src\pcdbug.c, src\transmit.c.
- Fixed name clashes with <sys/syslog.h> in bin\talk program.
- Various long-file names fixes in some djgpp makefiles and mtr/bping.
* pctcp.c change: Fixed yet again the detection of a reset connection.
The RST is accepted if SEQ >= RCV.NXT and SEQ <= RCV.NXT-RCV.RWIN+1.
Note: The RST is checked again in `tcp_estab_state()'
* pctcp.h change: New hook pointer `_bsd_socket_hook' replaces `_ip4_raw_hook',
`_ip6_raw_hook', `_tcp_syn_hook' and `_tcp_find_hook'.
* socket.c change: New function `socket_op_demux' set in `socket()'.
Calls various functions for each operation `op'.
* udp_rev.c change: `reverse_resolve*()' now takes an extra parameter
`size'.
* udp_dom.* change: Rewritten to avoid module-global variables. Renamed
some structures. Moved udp_rev.h into udp_dom.h. Fixed `extract_cname()'.
* pcconfig.c change: Added `dns_do_ipv6' to config-table.
* misc.c change: Rewrote `intel16()' and `intel()' without the `SWAP*()'
macros (to prevent gcc 3.3.x warnings).
* udp_dom.c change: Added `dns_do_ipv6' to optionally disable use of
AAAA records. Handy for programs using `getaddrinfo()' with unspecified
hints. This causes slowdown because AAAA records are sent before A
records. Very few host's have an IPv6 address at time beeing.
* udp_rev.c change: Return length of request from `qinit_ip?()' and
use that in `sock_write()'. Bug fix in `qinit_ip6()'.
* config.h change: Removed USE_ETHERS and merged in USE_BSD_FUNC.
* bsdbug.c change: Compile file with "USE_BSD_FUNC || USE_DEBUG"
Reported by Nagy Daniel.
* get_xby.h change: Put internal functions in "_w32_" namespace.
******************* Changes version 2.2 dev.rel.5 *******************
* File name changes: Moved all network address functions from udp_nds.c
and pcbsd.c into netaddr.c. Moved rest of pcbsd.c to gethost.c.
Renamed udp_nds.h to netaddr.h.
Renamed pcbsd.h to get_xby.h.
Renamed gxby_r.c to get_xbyr.c.
* wdpmi.c change: Disabled use of `dpmi_except_handler()'. It's supposed
to work only wih Causeway DOSX, but doesn't. Due to lack of a good
Watcom debugger, I've failed to find of why. Any takers?
* getprot.c / getserv.c changes: Sets `h_errno = NETDB_SUCCESS' on success
and `h_errno = NO_DATA' on fail.
* makefile.all change: Add option `-zc' for Watcom small/large models.
This puts constants in the code segment to free up the DGROUP for other
data.
* pcdbug.c change: Experimental support for gzip'ed pcap capture files.
* pctcp.c change: `tcp_write()' speedup; call `tcp_send()' immediately if
Tx-queue length is above minimum of socket max_seg or MSS. Should ideally
be the real Path MTU - 40.
* pcdhcp.c change: In `make_boot_header()': Only set `dh_ciaddr' to non-
zero in BOUND, RENEWING or REBINDING states.
* netaddr.c change: `inet_aton()' no longer checks for non-NULL `adr'
argument. Return value changed to `int'. Return 1 on success.
* pcarp.c change: Send a gratiotous ARP on startup (in _arp_check_gateways()).
Controlled by "ARP.GRATIOTOUS = 1" (default is 0).