#! @LOCALPREFIX@/bin/perl # # $NetBSD: scriptdump.pl,v 1.3 2001/09/07 04:12:10 itojun Exp $ # if ($< != 0) { print STDERR "must be root to invoke this\n"; exit 1; } $mode = 'add'; while ($i = shift @ARGV) { if ($i eq '-d') { $mode = 'delete'; } else { print STDERR "usage: scriptdump [-d]\n"; exit 1; } } open(IN, "setkey -D |") || die; foreach $_ () { if (/^[^\t]/) { ($src, $dst) = split(/\s+/, $_); } elsif (/^\t(esp|ah) mode=(\S+) spi=(\d+).*reqid=(\d+)/) { ($proto, $ipsecmode, $spi, $reqid) = ($1, $2, $3, $4); } elsif (/^\tE: (\S+) (.*)/) { $ealgo = $1; $ekey = $2; $ekey =~ s/\s//g; $ekey =~ s/^/0x/g; } elsif (/^\tA: (\S+) (.*)/) { $aalgo = $1; $akey = $2; $akey =~ s/\s//g; $akey =~ s/^/0x/g; } elsif (/^\tseq=(0x\d+) replay=(\d+) flags=(0x\d+) state=/) { print "$mode $src $dst $proto $spi"; $replay = $2; print " -u $reqid" if $reqid; if ($mode eq 'add') { print " -m $ipsecmode -r $replay" if $replay; if ($proto eq 'esp') { print " -E $ealgo $ekey" if $ealgo; print " -A $aalgo $akey" if $aalgo; } elsif ($proto eq 'ah') { print " -A $aalgo $akey" if $aalgo; } } print ";\n"; $src = $dst = $upper = $proxy = ''; $ealgo = $ekey = $aalgo = $akey = ''; } } close(IN); exit 0; 67191c9f65cbd656b43e'>refslogtreecommitdiff
path: root/sys/dev/dm/dm_dev.c
AgeCommit message (Expand)Author
2019-12-04dm: style + whitespace + indentation fixestkusumi
2019-12-03dm: Make global dm locks statictkusumi
2018-01-05use some size_t, add whitespace between functions, rcsids.christos
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
2014-10-18src is too big these days to tolerate superfluous apostrophes. It'ssnj
2010-01-04Indent files remove unnecessary blank lines, white spaces and KNFize code.haad
2009-12-29Add private lock to dm_dev_t used for mutual exclusion for diks(9) apihaad
2009-09-09Fix bug in kmem_alloc/kmem_free of params string. Params string washaad
2009-04-13Destroy locks in dm_dev_free, do not allocate struct disk twice.haad
2009-03-18Ansify function definitions w/o arguments. Generated with sed.cegger
2009-03-06Fix lvm lvrename command. There was bug in dm_dev_lookup wherehaad
2008-12-19Merge the haad-dm branch to -current. This branch adds LVM functionality tohaad