-
Notifications
You must be signed in to change notification settings - Fork 156
/
Copy pathlibvma.conf
165 lines (162 loc) · 7.2 KB
/
libvma.conf
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# libvma.conf - configuration file for libvma
#
# $Id$
#
# Comments are starts with # and cause the entire line after it to be ignored.
# Any beginning whitespace is skipped. Any line that is empty is also skipped.
#
# There are 3 main types of statements supported by this configuration file:
# - application-id - which specifies the proccess to whom all the
# statments which appear between it and the next "application-id" statment
# (if any) are apllied to.
# - "use" - which defines the transport to be used for the sockets that
# match the line.
# - "log" - for setting logging related configuration. As the log settings
# takes immidiate effect we define these straight after the "application-id".
#
##############################################################################
# DEAFUALT SETTINGS:
# Please do not forget to comment if you want to change these.
# (the rest of this file explains the syntax and give examples)
#
#
# By default apply the statments to any application with any ID
application-id * *
#
# By default DNS server-side protocol (UDP, port 53) is handled by OS
use os udp_connect *:53
#
##############################################################################
#
# SPECIFICATION OF THE TARGET PROCCESS
# ------------------------------
# The target proccess statment specify the proccess which has to follow the
# control statments which appear below this directive and till the next
# target proccess statment.
# Each statement specifies a matching rule that all its
# subexpressions must evaluate as true (logical and) to apply.
#
# The format of this statment is :
# application-id <program-name|*> <user-defined-id| *>
#
# <program-name|*> field:
# Defines the program name (not including the path) the statments, which
# appears below that directive, apply to.
# Wildcards with same semantics as "ls" are supported (* and ?).
# So db2* would match on any program with a name starting with db2.
# t?cp would match on ttcp, etc.
# If not provided (default) the statement matches all programs.
#
#<user-defined-id|*> field:
# Specify the proccess ID the statments which appears below that directive,
# apply to.
# In order to configure user-defined-id besides specifying it in
# configuration files, also needed to set the
# VMA_APPLICATION_ID environment variable to the same value which
# appears in user-defined-id filed of the application-id statment.
#
##############################################################################
#
# LOG CONFIGURATION: NOT FULLY SUPPORTED YET !
# ------------------
# The log directive allows the user to specify which and where debug and error
# messages get sent. The log statement format is:
# log [destination stderr|syslog|file <filename>] [min-level <1-9>]
#
# destination - defines the destination of the log messages:
# stderr - messages will be forwarded to the stderr
# syslog - messages sent to the syslog service
# file <filename> - messages will be written to the file /var/log/<filename> for root.
# for regular user, if full path is requsted <filename with path>.<uid>
# or /tmp/<filename>.<uid> if no path is requested
#
# min-level - defines the verbosity of the log:
# 9 - only errors are printed
# 8 - warnings
# 7 - connect and listen summary (useful for tracking SDP usage)
# 4 - positive match summary (useful for config file debug)
# 3 - negative match summary (useful for config file debug)
# 2 - function calls and return values
# 1 - debug messages
#
##############################################################################
#
# SOCKET TRANSPORT CONTROL:
# ------------------------------
# The socket control statements allows the user to specify when libvma will
# offload AF_INET/SOCK_STREAM or AF_INET/SOCK_DATAGRAM sockets.
# Each control statement specifies a matching rule that all its
# subexpressions must evaluate as true (logical and) to apply.
#
# The statements that control which type transport to use are made
# of the following:
# use <transport> <role> <address|*>:<port range|*>[:<address|*>:<port range|*>]
#
# <transport> can be one of:
# "vma" - for specifying when VMA should be used.
# "os" - for specifying when socket should handled by os network stack.
#
# <role> can be one of:
# 1. "tcp_server".
# 2. "tcp_client"
# 3. "udp_sender"
# 4. "udp_receiver"
# 5. "udp_connect"
#
# <address|*> means:
# Either the local address the server is bind to or the remote server
# address the client connects to. Syntax for address matching is:
# <IPv4 address>[/<prefix_length>]|*
# IPv4 address = [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ each sub number < 255
# prefix_length = [0-9]+ and with value <= 32. A prefix_length of 24
# matches the subnet mask 255.255.255.0 . A prefix_length of 32
# requires matching of the exact IP.
#
# <port range> is:
# start-port[-end-port] where port numbers are >0 and < 65536
#
# Rules are evaluated in order of definition. So the first match wins.
# If no match is made vma will default to "vma".
#
# Detailed explanation:
#
# udp_receiver - local_ip:local_port
# udp_sender - remote_ip:remote_port
# udp_connect - remote_ip:remote_port:local_ip:local_port
# tcp_server - local_ip:local_port
# tcp_client - remote_ip:remote_port:local_ip:local_port
#
# For TCP, the socket must be either all (recv & send / listen) offloaded or all not offloaded.
# For UDP, the recv and send from/to each address are independent, and can be separately defined as offloaded or not.
#
# For TCP connected socket - use tcp_client with 5 tuple specification starting from remote and ending with local address.
# For TCP listen socket - use tcp_server with the local address to listen on.
# For TCP accepted sockets - offloading is determined by the listen socket it was accepted through.
# If the listen socket is offloaded, all accepted sockets are offloaded and if it is not offloaded, all accepted sockets are not offloaded.
# Therefore, no special rule is available for accepted sockets.
#
# For UDP receive - use udp_receiver with local address. For MC, use MC ip and port.
# For UDP send - use udp_sender with remote address. For MC, use MC ip and port.
# For UDP connect - use 5 tuple specification starting from remote and ending with local address.
# UDP connect rule will only affect UDP sockets which connect() have been called on.
# A "use os udp_connect" rule will pass the socket to be handled exclusively by OS (no more offloaded traffic).
# A "use vma udp_connect" rule still leave the socket to be impacted by udp_sender and udp_receiver rules (which makes it practically useless).
#
#############################################################################
#
# Examples:
#-------------------------------
# Apply the rules to program tcp_lat with ID B1, also don't forget to set
# the VMA_APPLICATION_ID: export VMA_APPLICATION_ID=B1
# application user defined id
# application-id tcp_lat B1
#
# Use VMA by TCP clients on any local interface connecting to machines that belongs to subnet 192.168.1.*
# transport role address:port[-range]
# use vma tcp_client 192.168.1.0/24:*:*:*
#
# Use OS by when TCP server listens to port 5001 of any machine
# family role address:port[-range]
# use os tcp_server *:5001
#
###############################################################################