Announcement

Collapse
No announcement yet.

packet.dll header files for pb

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • packet.dll header files for pb

    Hello,

    I'm wondering if anyone has converted the 4 key header files for packet.dll
    to powerbasic.. These are DEVIOCTL.H, NTDDPACK.H, PACKET32.H and NTDDNDIS.H.

    If anyone has wrote an app to parse them and output pb code, that may be of help also!

    All the best!

    - Nathan

  • #2
    What is packet.dll and what does it do? Sounds kinky


    ------------------
    -

    Comment


    • #3
      I'm glad you ask..

      Packet.dll is the brains behind the PCap Library (see: http://netgroup-serv.polito.it/winpcap/)



      Thanks!

      - Nathan

      Comment


      • #4

        nathan, this may be of help...

        http://www.powerbasic.com/support/pb...ad.php?t=27849


        regards,


        ------------------
        kev g peel
        kgp software, bridgwater, uk.
        mailto:[email protected][email protected]</a> http://www.kgpsoftware.com
        kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

        Comment


        • #5
          Kev,

          I gave your util' a go.. It works with some header files i have, but the particular ones
          i'm hoping to convert in seconds :P it doesn't like. It comments out many lines.. i'm assuming because,
          like me, it doesn't understand them

          I think i'm going to have do convert them manually

          Thanks!!

          - Nathan

          ------------------

          Comment


          • #6
            Ah, WINPCAP!!
            Yes, if anyone gets any PB code working with that, I'd be extremely interested.


            ------------------
            -

            Comment


            • #7

              Comment


              • #8

                Nathan,

                Sorry to hear it doesn't work on particular files!

                But, as Hdr2Inc progresses, it will be able to convert nearly all C '.H' files

                If you want to convert C 'structs' to UDTs, or functions to PB, then just look at the 32BIT.TXT that is included, for reference (it contains PB equivalents of C datatypes).



                ------------------
                Kev G Peel
                KGP Software, Bridgwater, UK.
                mailto:[email protected][email protected]</A> http://www.kgpsoftware.com
                kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                Comment


                • #9
                  Kev, Hdr2Inc looks very promising! I hope you get the time to build on it some more, its a true gem

                  I know this is off-topic as its C++, but I just pulled packet.dll/winpcap out again and I just compiled testapp.c (that came with an old winpcap download, im sure other people have it), it compiles fine in MS VC++ (it comes with a .dsw and .dsp file as well as the .c file), but as its ANSI C id like to compile it in LCC-Win32. Im one error away from compiling it, can anybody point me in the right direction for a possible fix?
                  Here's what I get when I compile:
                  Code:
                  C:\lccproj\winpcap>make
                     c:\lcc\bin\lcc.exe -c -Ic:\lcc\include  -O  c:\lccproj\winpcap\winpcap.c
                  cpp: c:\lcc\include\devioctl.h:86 c:\lcc\include\ntddpack.h:4 c:\lcc\include\pac
                  ket32.h:25 c:\lccproj\winpcap\winpcap.c:27 Macro redefinition of FILE_READ_ACCES
                  S
                  cpp: c:\lcc\include\devioctl.h:87 c:\lcc\include\ntddpack.h:4 c:\lcc\include\pac
                  ket32.h:25 c:\lccproj\winpcap\winpcap.c:27 Macro redefinition of FILE_WRITE_ACCE
                  SS
                  Error c:\lccproj\winpcap\winpcap.c: c:\lcc\include\ntddndis.h: 1401  illegal cha
                  racter `\032'
                  Warning winpcap.c: 86  assignment of pointer to char to pointer to unsigned shor
                  t
                  Warning winpcap.c: 103  missing prototype for wprintf
                  1 errors, 2 warnings
                  make: Error code 1
                  I dont know why its complaining about ntddndis.h, it doesnt contain the string "\032" and i dont think it even needs to be included with the compile..?
                  Here's my makefile:
                  Code:
                  CFLAGS=-Ic:\lcc\include  -O 
                  CC=c:\lcc\bin\lcc.exe
                  LINKER=c:\lcc\bin\lcclnk.exe
                  OBJS=\
                  	winpcap.obj
                  
                  LIBS=c:\lcc\lib\packet.lib
                  
                  c:\lccproj\winpcap\winpcap.exe:	$(OBJS) Makefile
                  	$(LINKER)  -s -subsystem console -o c:\lccproj\winpcap\winpcap.exe $(OBJS) $(LIBS)
                  
                  # Build WINPCAP.C
                  WINPCAP_C=\
                  
                  winpcap.obj: $(CRC32_C) c:\lccproj\winpcap\winpcap.c
                  	$(CC) -c $(CFLAGS) c:\lccproj\winpcap\winpcap.c
                  
                  link:
                  	$(LINKER)  -s -subsystem console -o c:\lccproj\winpcap\winpcap.exe $(OBJS) $(LIBS)
                  Any help is very much appreciated


                  ------------------
                  -

                  Comment


                  • #10
                    Wayne,

                    I'm not sure if you're wanting to edit the samples in C code itself,but i
                    downloaded a fresh copy of Pcaplib today, and all the sample projects are precompiled.

                    They worked first time on my machine - and now i'm just pondering whether i should spend a day or two
                    getting these Header files converted or keep prowling around on the net in some vain hope of finding them
                    in any language other than C!



                    - Nathan

                    [This message has been edited by Nathan Evans (edited July 31, 2001).]

                    Comment


                    • #11
                      The '\032' is C's quaint octal way of saying CHR$(26), or Ctrl-Z, the old CP/M
                      end-of-file marker. My guess is, the .H file has acquired an unexpected EOF from
                      your editor. If you pull it into Notepad, this character should show up as a
                      graphic block, and you can readily delete it.

                      ------------------
                      Tom Hanlin
                      PowerBASIC Staff

                      Comment


                      • #12
                        Tom, bingo! I did a search for CHR26/&H1A, and sure enough at the end of the file was this byte sequence: 0D 0A 1A 0D 0A
                        So I stripped it out, saved it, recompiled, and wallah, that error was gone!
                        ... and replaced by another!:
                        Code:
                        winpcap.obj .text: undefined reference to '_PacketGetAdapterNames'
                        winpcap.obj .text: undefined reference to '_PacketOpenAdapter'
                        winpcap.obj .text: undefined reference to '_PacketSetHwFilter'
                        ...
                        i dont see how it can be undefined when im pointing the linker directly at packet.lib and packet32.h is #included in the source...


                        ------------------
                        -

                        Comment

                        Working...
                        X