Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Added possibility to force skb priority field (SO_PRIORITY). | 9b4b2a6b03ff7573041a7ed96c86e7bcda86c580 | Catalin(ux) M. BOIE | 2011-08-06 21:55:43 |
Added support for FWMARK. | 648b09b84fcd5bc17aaa7d6ba2bf2bfeeea583f7 | Catalin(ux) M. BOIE | 2011-08-06 21:35:23 |
Added support for IPv6 flowinfo (class + label). | c23cc6042893fb98986b5aa38c146b7aec488079 | Catalin(ux) M. BOIE | 2011-08-06 21:11:46 |
Added support for connecting clients (socket -> connect or socket -> sendto). | 8f94255890a99d4890206e53f031ffad79c55866 | Catalin(ux) M. BOIE | 2011-08-05 21:15:38 |
Bump version to 0.7. | 1a51b690a50c482c9e727b3e8e129bbc2890f600 | Catalin(ux) M. BOIE | 2011-06-21 17:06:25 |
Corrected description and license. | 708b98d98bb5704f3bd265928f07cc94c18bd212 | Catalin(ux) M. BOIE | 2011-06-21 17:06:04 |
Bump version to 0.6. | cb4ef5c142753802f9dcd2410d094f9914e8273c | Catalin(ux) M. BOIE | 2011-06-21 16:56:15 |
Added support for separate FORCE_ADDR for IPv4 and IPv6, MSS, TTL etc. | e32e97cafe360f192283168d76c327559282e24d | Catalin(ux) M. BOIE | 2011-06-21 16:55:12 |
Added TODO to %doc rpm section. | 086dbb2e078955dddf83cbfd65998334d6db81e4 | Catalin(ux) M. BOIE | 2010-12-19 19:46:20 |
Added MSS. | 9a5c3676567cb92e6c0b4106c2b97cd2da2273a5 | Catalin(ux) M. BOIE | 2010-12-14 17:00:37 |
Added TOS test script. | a4b1b05b27b3eaa06a4a71f656e1b80731d1b8ff | Catalin(ux) M. BOIE | 2010-12-14 16:55:03 |
Ignore Changelog-last file. | 1bfa5decd11f4fd95e4b002d88e2a2e04c747855 | Catalin(ux) M. BOIE | 2010-12-14 16:54:36 |
Added KA. | ec9b4556e51ca9a807400910f8ca6d698f9ad670 | Catalin(ux) M. BOIE | 2010-12-14 16:53:58 |
Bump up the version to 0.5. | f7ba7f0feb49ac4942d85903d31e085f1ffa6149 | Catalin(ux) M. BOIE | 2010-11-07 23:16:25 |
Duilder updates. | 4d3691f340591f68f9b0ae704da24b4352957f05 | Catalin(ux) M. BOIE | 2010-11-07 23:15:29 |
Added support to force TOS by using env var FORCE_NET_TOS. | 319cfbee315a0c6889791b122fdb8069aa2ffdf1 | Catalin(ux) M. BOIE | 2010-11-07 23:14:23 |
No need for duilder_release. I will use a global one. | 15a59294aa3922e58bff8aaa9de7cc06dc44fe1e | Catalin(ux) M. BOIE | 2010-10-27 20:43:15 |
TODO in. | 9ea8407b8a2767debcf7597bbfc1bddfe44c78eb | Catalin(ux) M. BOIE | 2010-10-27 20:21:13 |
Typo. | 2282d895e91cf2b02a7b67d933af2c68db5798b6 | Catalin(ux) M. BOIE | 2010-10-27 19:54:40 |
Aded license information to README file. | fe8071fd2d9f912136fb7fa22f289ddc63cf0f14 | Catalin(ux) M. BOIE | 2010-10-27 19:46:48 |
File | Lines added | Lines deleted |
---|---|---|
README | 8 | 0 |
force_bind.c | 27 | 0 |
test_client3.sh | 1 | 1 |
File README changed (mode: 100644) (index 04d6eb2..b207496) | |||
... | ... | Examples: | |
93 | 93 | export LD_PRELOAD=${LD_PRELOAD}:/usr/lib/force_bind.so | export LD_PRELOAD=${LD_PRELOAD}:/usr/lib/force_bind.so |
94 | 94 | your_program_here | your_program_here |
95 | 95 | ||
96 | 14: Force priority (between 0 and 6 for non-root users). You can | ||
97 | use 'tc' command from iproute to set-up 'prio' qdisc and to | ||
98 | assign prio to queues: | ||
99 | export FORCE_NET_VERBOSE=1 | ||
100 | export FORCE_NET_PRIO=2 | ||
101 | export LD_PRELOAD=${LD_PRELOAD}:/usr/lib/force_bind.so | ||
102 | your_program_here | ||
103 | |||
96 | 104 | Installation: | Installation: |
97 | 105 | - ./configure | - ./configure |
98 | 106 | - make | - make |
File force_bind.c changed (mode: 100644) (index 0258c5d..0fdac3c) | |||
... | ... | static unsigned int force_nodelay = 0, nodelay; | |
111 | 111 | static unsigned long long bw_limit_per_socket = 0; | static unsigned long long bw_limit_per_socket = 0; |
112 | 112 | static unsigned int force_flowinfo = 0, flowinfo; | static unsigned int force_flowinfo = 0, flowinfo; |
113 | 113 | static unsigned int force_fwmark = 0, fwmark; | static unsigned int force_fwmark = 0, fwmark; |
114 | static unsigned int force_prio = 0, prio; | ||
114 | 115 | static struct private bw_global; | static struct private bw_global; |
115 | 116 | static struct info fdinfo; | static struct info fdinfo; |
116 | 117 | static unsigned int verbose = 0; | static unsigned int verbose = 0; |
... | ... | static void init(void) | |
386 | 387 | fwmark); | fwmark); |
387 | 388 | } | } |
388 | 389 | ||
390 | /* prio */ | ||
391 | x = getenv("FORCE_NET_PRIO"); | ||
392 | if (x != NULL) { | ||
393 | force_prio = 1; | ||
394 | prio = strtoul(x, NULL, 0); | ||
395 | my_syslog(LOG_INFO, "force_bind: Force prio to %u.\n", | ||
396 | prio); | ||
397 | } | ||
398 | |||
389 | 399 | ||
390 | 400 | old_bind = dlsym(RTLD_NEXT, "bind"); | old_bind = dlsym(RTLD_NEXT, "bind"); |
391 | 401 | if (old_bind == NULL) { | if (old_bind == NULL) { |
... | ... | static int set_fwmark(int sockfd) | |
603 | 613 | return ret; | return ret; |
604 | 614 | } | } |
605 | 615 | ||
616 | static int set_prio(int sockfd) | ||
617 | { | ||
618 | int ret; | ||
619 | |||
620 | if (force_prio == 0) | ||
621 | return 0; | ||
622 | |||
623 | ret = old_setsockopt(sockfd, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio)); | ||
624 | my_syslog(LOG_INFO, "force_bind: changing fwmark to 0x%x (ret=%d(%s)) [%d].\n", | ||
625 | prio, ret, strerror(errno), sockfd); | ||
626 | |||
627 | return ret; | ||
628 | } | ||
629 | |||
606 | 630 | /* | /* |
607 | 631 | * Alters a struct sockaddr, based on environment variables | * Alters a struct sockaddr, based on environment variables |
608 | 632 | */ | */ |
... | ... | int setsockopt(int sockfd, int level, int optname, const void *optval, | |
753 | 777 | return set_reuseaddr(sockfd); | return set_reuseaddr(sockfd); |
754 | 778 | if (optname == SO_MARK) | if (optname == SO_MARK) |
755 | 779 | return set_fwmark(sockfd); | return set_fwmark(sockfd); |
780 | if (optname == SO_PRIORITY) | ||
781 | return set_prio(sockfd); | ||
756 | 782 | } | } |
757 | 783 | ||
758 | 784 | if (level == IPPROTO_IP) { | if (level == IPPROTO_IP) { |
... | ... | void socket_create_callback(const int sockfd, int domain, int type) | |
808 | 834 | set_reuseaddr(sockfd); | set_reuseaddr(sockfd); |
809 | 835 | set_nodelay(sockfd); | set_nodelay(sockfd); |
810 | 836 | set_fwmark(sockfd); | set_fwmark(sockfd); |
837 | set_prio(sockfd); | ||
811 | 838 | ||
812 | 839 | p.domain = domain; | p.domain = domain; |
813 | 840 | p.type = type; | p.type = type; |
File test_client3.sh copied from file test_client2.sh (similarity 81%) (mode: 100755) (index f988d19..32459ed) | |||
1 | 1 | #!/bin/sh | #!/bin/sh |
2 | 2 | ||
3 | 3 | export FORCE_NET_VERBOSE=1 | export FORCE_NET_VERBOSE=1 |
4 | export FORCE_NET_FWMARK=0x1234 | ||
4 | export FORCE_NET_PRIO=2 | ||
5 | 5 | ||
6 | 6 | export LD_PRELOAD="${LD_PRELOAD}:./force_bind.so" | export LD_PRELOAD="${LD_PRELOAD}:./force_bind.so" |
7 | 7 |