File: _impl.pyi

package info (click to toggle)
python-netfilterqueue 1.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: python: 598; sh: 38; makefile: 5
file content (47 lines) | stat: -rw-r--r-- 1,338 bytes parent folder | download
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
import socket
from enum import IntEnum
from typing import Callable, Dict, Optional, Tuple

COPY_NONE: int
COPY_META: int
COPY_PACKET: int

class Packet:
    hook: int
    hw_protocol: int
    id: int
    mark: int
    # These are ifindexes, pass to socket.if_indextoname() to get names:
    indev: int
    outdev: int
    physindev: int
    physoutdev: int
    def get_hw(self) -> Optional[bytes]: ...
    def get_payload(self) -> bytes: ...
    def get_payload_len(self) -> int: ...
    def get_timestamp(self) -> float: ...
    def get_mark(self) -> int: ...
    def set_payload(self, payload: bytes) -> None: ...
    def set_mark(self, mark: int) -> None: ...
    def retain(self) -> None: ...
    def accept(self) -> None: ...
    def drop(self) -> None: ...
    def repeat(self) -> None: ...

class NetfilterQueue:
    def __new__(self, *, af: int = ..., sockfd: int = ...) -> NetfilterQueue: ...
    def bind(
        self,
        queue_num: int,
        user_callback: Callable[[Packet], None],
        max_len: int = ...,
        mode: int = COPY_PACKET,
        range: int = ...,
        sock_len: int = ...,
    ) -> None: ...
    def unbind(self) -> None: ...
    def get_fd(self) -> int: ...
    def run(self, block: bool = ...) -> None: ...
    def run_socket(self, s: socket.socket) -> None: ...

PROTOCOLS: Dict[int, str]