SolarCapture C Bindings
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
stream.h
Go to the documentation of this file.
1 
10 #ifndef __SOLAR_CAPTURE_STREAM_H__
11 #define __SOLAR_CAPTURE_STREAM_H__
12 
13 
28 struct sc_stream;
29 
30 struct sc_attr;
31 struct sc_session;
32 
42 extern int sc_stream_alloc(struct sc_stream** stream_out,
43  const struct sc_attr* attr, struct sc_session* scs);
51 extern int sc_stream_free(struct sc_stream* stream);
52 
58 extern int sc_stream_reset(struct sc_stream* stream);
59 
60 #if SC_API_VER >= 2
61 
90 extern int sc_stream_set_str(struct sc_stream* stream, const char* str);
91 #endif
92 
101 extern int sc_stream_all(struct sc_stream* stream);
102 
111 extern int sc_stream_mismatch(struct sc_stream* stream);
112 
124 extern int sc_stream_ip_dest_hostport(struct sc_stream* stream, int protocol,
125  const char* dhost, const char* dport);
126 
137 extern int sc_stream_ip_source_hostport(struct sc_stream* stream,
138  const char* shost, const char* sport);
147 extern int sc_stream_eth_dhost(struct sc_stream* stream, const uint8_t* mac_addr);
148 
157 extern int sc_stream_eth_vlan_id(struct sc_stream* stream, int vlan_id);
158 
159 #if SC_API_VER >= 1
160 
168 extern int sc_stream_eth_shost(struct sc_stream* stream, const uint8_t* mac_addr);
169 
178 extern int sc_stream_eth_type(struct sc_stream* stream, uint16_t eth_type);
179 
180 
189 extern int sc_stream_ip_dest_host(struct sc_stream* stream, const char* dhost);
190 
199 extern int sc_stream_ip_dest_port(struct sc_stream* stream, const char* dport);
200 
209 extern int sc_stream_ip_source_host(struct sc_stream* stream, const char* shost);
210 
219 extern int sc_stream_ip_source_port(struct sc_stream* stream, const char* sport);
220 
230 extern int sc_stream_ip_protocol(struct sc_stream* stream, int protocol);
231 #endif
232 
233 
234 #endif /* __SOLAR_CAPTURE_STREAM_H__ */
235 
int sc_stream_eth_vlan_id(struct sc_stream *stream, int vlan_id)
Configure this stream to capture all packets with the matching VLAN ID.
Attribute object.
int sc_stream_ip_source_host(struct sc_stream *stream, const char *shost)
Configure this stream to capture all packets with matching source hostname.
int sc_stream_reset(struct sc_stream *stream)
Remove all stream filters.
int sc_stream_alloc(struct sc_stream **stream_out, const struct sc_attr *attr, struct sc_session *scs)
Create a new stream object for this session.
int sc_stream_ip_source_hostport(struct sc_stream *stream, const char *shost, const char *sport)
Configure this stream to capture all packets with the matching protocol, source hostname and source p...
int sc_stream_set_str(struct sc_stream *stream, const char *str)
Configure the stream to capture all packets matching the specified filter string. This is the preferr...
int sc_stream_mismatch(struct sc_stream *stream)
Configure this stream to capture all packets that haven't been caught by another stream and are not r...
int sc_stream_eth_type(struct sc_stream *stream, uint16_t eth_type)
Configrue this stream to capture all packets with the matching ethernet type.
int sc_stream_ip_dest_hostport(struct sc_stream *stream, int protocol, const char *dhost, const char *dport)
Configure this stream to capture all packets with the matching protocol, destination hostname and des...
int sc_stream_free(struct sc_stream *stream)
Free a previously created stream.
int sc_stream_eth_shost(struct sc_stream *stream, const uint8_t *mac_addr)
Configure this stream to capture all packets with the matching source MAC address.
int sc_stream_ip_protocol(struct sc_stream *stream, int protocol)
Configure this stream to capture all packets with matching IP protocol.
int sc_stream_eth_dhost(struct sc_stream *stream, const uint8_t *mac_addr)
Configure this stream to capture all packets with the matching destination MAC address.
int sc_stream_all(struct sc_stream *stream)
Configure this stream to capture all packets that haven't been caught by another stream.
int sc_stream_ip_source_port(struct sc_stream *stream, const char *sport)
Configure this stream to capture all packets with matching source port.
int sc_stream_ip_dest_port(struct sc_stream *stream, const char *dport)
Configure this stream to capture all packets with matching destination port.
int sc_stream_ip_dest_host(struct sc_stream *stream, const char *dhost)
Configure this stream to capture all packets with matching destination hostname.