Skip to content

Commit

Permalink
Pulling in ODIN SOCKADDR
Browse files Browse the repository at this point in the history
  • Loading branch information
Pix committed Jul 1, 2023
1 parent 5f8ae83 commit 4fcf487
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
libpcap.A.dylib
tests/tests
odin-libpcap
**.o

12 changes: 6 additions & 6 deletions libpcap.odin
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package odin_libpcap

import "core:os"

// TODO: Add a when for each system - Linux, Windows etc.
when ODIN_OS == .Windows {
foreign import libpcap "system:npcap" // 99% sure this is wrong, but placeholder
Expand Down Expand Up @@ -79,10 +81,10 @@ PCAP_IF_CONNECTION_STATUS_NOT_APPLICABLE :: 0x00000030 // not applicable
// Representation of an interface address
pcap_addr :: struct {
next: ^pcap_addr,
addr: ^sockaddr,
netmask: ^sockaddr,
broadaddr: ^sockaddr,
dstaddr: ^sockaddr,
addr: ^os.SOCKADDR,
netmask: ^os.SOCKADDR,
broadaddr: ^os.SOCKADDR,
dstaddr: ^os.SOCKADDR,
}

// Error codes for PCAP API
Expand Down Expand Up @@ -149,8 +151,6 @@ pcap_stat :: struct {

// TODO: MSDOS - PCAP_STATS_EX

sockaddr :: struct {}

pcap_rmtauth :: struct {
type: _c.int,
username: cstring,
Expand Down

0 comments on commit 4fcf487

Please sign in to comment.