Line | Count | Source |
1 | /* -*- mode: c; c-file-style: "openbsd" -*- */ | |
2 | ||
3 | #include "lldpd.h" | |
4 | ||
5 | static int privileged, unprivileged; | |
6 | void | |
7 | priv_privileged_fd(int fd) | |
8 | 0 | { |
9 | 0 | privileged = fd; |
10 | 0 | } |
11 | void | |
12 | priv_unprivileged_fd(int fd) | |
13 | 0 | { |
14 | 0 | unprivileged = fd; |
15 | 0 | } |
16 | int | |
17 | priv_fd(enum priv_context ctx) | |
18 | 0 | { |
19 | 0 | switch (ctx) { |
20 | 0 | case PRIV_PRIVILEGED: |
21 | 0 | return privileged; |
22 | 0 | case PRIV_UNPRIVILEGED: |
23 | 0 | return unprivileged; |
24 | 0 | } |
25 | 0 | return -1; /* Not possible */ |
26 | 0 | } |