iptrap 1.0.9

A fast, stateless TCP sinkhole
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub trait StrSliceEscape {
    fn escape_default_except_lf(&self) -> String;
}

impl StrSliceEscape for String {
    fn escape_default_except_lf(&self) -> String {
        let mut out = String::with_capacity(self.len());
        for c in self.chars() {
            out.push(match c {
                '\r' | '\n' | '\t' | '\x20'..='\x7e' => c,
                _ => '?',
            })
        }
        out
    }
}