Debian Codegraph @

src/tun_win.c

raw symbols SCIP
1 /* librist. Copyright © 2026 SipRadius LLC. All right reserved.
2 * Author: Sergio Ammirata, Ph.D. <[email protected]>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7 /*
8 * Windows TUN implementation using WinTUN (wintun.dll).
9 *
10 * This is a stub — full implementation requires:
11 * 1. wintun.h from https://www.wintun.net/
12 * 2. Loading wintun.dll at runtime
13 * 3. Using WintunCreateAdapter / WintunStartSession
14 * 4. IP Helper API (SetUnicastIpAddressEntry) for address config
15 */
16
17 #ifdef _WIN32
18
19 #include "librist/tun.h"
20 #include <stdio.h>
21
22 int rist_tun_open(const char *requested_name, char *actual_name, size_t name_len)
23 {
24 (void)requested_name;
25 (void)actual_name;
26 (void)name_len;
27 fprintf(stderr, "librist: Windows TUN support not yet implemented\n");
28 return -1;
29 }
30
31 void rist_tun_close(int fd)
32 {
33 (void)fd;
34 }
35
36 int rist_tun_read(int fd, uint8_t *buf, size_t len)
37 {
38 (void)fd;
39 (void)buf;
40 (void)len;
41 return -1;
42 }
43
44 int rist_tun_write(int fd, const uint8_t *buf, size_t len)
45 {
46 (void)fd;
47 (void)buf;
48 (void)len;
49 return -1;
50 }
51
52 int rist_tun_set_ip(const char *dev, const char *ip, int prefix_len)
53 {
54 (void)dev;
55 (void)ip;
56 (void)prefix_len;
57 fprintf(stderr, "librist: Windows IP config not yet implemented\n");
58 return -1;
59 }
60
61 int rist_tun_set_mtu(const char *dev, int mtu)
62 {
63 (void)dev;
64 (void)mtu;
65 return -1;
66 }
67
68 int rist_tun_bring_up(const char *dev)
69 {
70 (void)dev;
71 return -1;
72 }
73
74 #endif /* _WIN32 */