#81 win32 networking

added_in_v1.4
closed
Win32 only (17)
5
2012-10-15
2001-10-05
No

I made this feature request to track the progress of win32 networking. I'm having
trouble getting misc/niclist.c to list the NICs I can use. I downloaded WinPCap 2.2
Auto-installer (driver + DLLs), and tried compiling niclist.c in cygwin.

$ gcc -o niclist niclist.c
$ ./niclist

$

So niclist is printing one newline and that's all. So I tried compiling it with VC++

dos> cl niclist.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler
etc etc
dos> niclist

1.)

dos>
In other words, it prints 1.) with no name after it. Still, I don't know what I should type in bochsrc
as the interface name. Do you have any suggestions?

My windows version is windows 98, second edition 4.10.2222 A.

Discussion

  • Bryce Denney
    Bryce Denney
    2001-10-05

    Logged In: YES
    user_id=185114

    I traced into niclist using the VC++ 6.0 compiler and debugger. It loads the packet library fine, gets the
    windows version and goes into the section (win95) section. It calls
    PacketGetAdapterNames(AdapterNameA,&AdapterLength);
    and when it returns, AdapterLength is 1 and AdapterNameA is a string starting with bytes 0, 0, -52, -52, -52,
    .... for a long time. Because of the nulls at the start of the string, the

    while ((tempA!='\0')||((tempA-1)!='\0')) { }

    quickly exits and AdapterNum=0, so it doesn't print any adapters.

     
  • Bryce Denney
    Bryce Denney
    2001-10-05

    Logged In: YES
    user_id=185114

    I also can't compile eth_win32.cc with cygwin right now.

    cygwin$ make
    g++ -c -mno-cygwin -DWIN32 -O6 -march=pentium -mpentium -I.. -I../../iodev/.. -I../instrument/stubs
    -I../../iodev/../instrument/stubs ../../iodev/eth_win32.cc -o eth_win32.o
    ../../iodev/eth_win32.cc: In method bx_win32_pktmover_c::bx_win32_pktmover_c(const char *, const char *, void (*)(void *, const void *, unsigned int), void *)': ../../iodev/eth_win32.cc:388: warning: converting NULL to non-pointer type ../../iodev/eth_win32.cc:389: passingshort unsigned int ' as argument 5 of
    `MultiByteToWideChar(unsigned int, long unsigned int, const CHAR
    , int, WCHAR , int)'
    make:
    ** [eth_win32.o] Error 1

     
  • Donald Becker
    Donald Becker
    2001-10-05

    Logged In: YES
    user_id=33082

    The problem in Cygwin is that wsprintf doesnt work right or
    something. I had that fixed right after I emailed you the
    original.

    The code should compile in Cygwin or in the Visual C++
    environment, but I am having the same trouble compiling it
    with cl directly. The IDE calls cl to compile it, but
    oviously adds some options or something.

    I am going to change the MultiByteToWideChar function to use
    stdlib functions instead. It will be replaced by mbtowcs
    (something like that). This should hopefully help the
    compiles in CygWin.

     
  • Bryce Denney
    Bryce Denney
    2001-11-01

    Logged In: YES
    user_id=185114

    Volker Ruppert contributed a patch to fix cygwin
    compilation. However he reports that it compiles but
    doesn't actually work. See the download link below,
    labelled patch.volker-oct-03.

     
  • Bryce Denney
    Bryce Denney
    2001-11-01

    patch.volker-oct-03

     
    Attachments
  • Donald Becker
    Donald Becker
    2001-11-01

    Logged In: YES
    user_id=33082

    Yeah, it will work fine though if you do a debug build...
    that s what I dont get.

     
  • Bryce Denney
    Bryce Denney
    2001-12-06

    Logged In: YES
    user_id=185114

    There are still some unsolved issues here, but I don't
    expect any more updates before the 1.3 release, so I'm
    marking this as "postponed". Hopefully after the release,
    we'll get some more users to try win32 networking and get
    more feedback.

     
  • Bryce Denney
    Bryce Denney
    2002-03-09

    Logged In: YES
    user_id=185114

    Networking is working very well for me now under windows 98. I ran the new niclist, set up the bochsrc line,
    booted up DLX linux, and set up networking in the guest os. Then, I could ping,telnet,ftp,name lookup, etc
    to the internet and to other machines on the local net. I had trouble talking to the local host, as I do on
    every platform because we're using packet filtering. I think we can treat that as a separate issue, and close
    this one.

    Great job!