blob: 4231b52dff1b1b57693cb4b30386969bcbca0984 (
plain) (
blame)
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
|
package main
import (
"context"
"log"
"net"
"github.com/jackc/pgx/v5"
"sinanmohd.com/redq/bpf"
"sinanmohd.com/redq/db"
)
func main() {
iface, err := net.InterfaceByName("wlan0")
if err != nil {
log.Fatalf("lookup network: %s", err)
}
ctx := context.Background()
conn, err := pgx.Connect(ctx, "user=redq_ebpf dbname=redq_ebpf")
if err != nil {
log.Fatalf("connecting database: %s", err)
}
defer conn.Close(ctx)
queries := db.New(conn)
bpf.Run(iface, queries, ctx)
}
|