| 1 | package sendscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/ |
| 2 | |
| 3 | import ( |
| 4 | "encoding/binaryscip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/" |
| 5 | "ioscip-go gomod github.com/golang/go/src go1.12 io/" |
| 6 | "strconvscip-go gomod github.com/golang/go/src go1.12 strconv/" |
| 7 | ) |
| 8 | |
| 9 | var sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess. = binaryscip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/.LittleEndianscip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/LittleEndian. |
| 10 | |
| 11 | const ( |
| 12 | sendStreamMagicscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagic. = "btrfs-stream\x00" |
| 13 | sendStreamMagicSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagicSize. = len(sendStreamMagicscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamMagic.) |
| 14 | sendStreamVersionscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendStreamVersion. = 1 |
| 15 | ) |
| 16 | |
| 17 | const ( |
| 18 | sendBufSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendBufSize. = 64 * 1024 |
| 19 | sendReadSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendReadSize. = 48 * 1024 |
| 20 | ) |
| 21 | |
| 22 | const cmdHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeaderSize. = 10 |
| 23 | |
| 24 | type cmdHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader# struct { |
| 25 | Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Len. uint32 // len excluding the header |
| 26 | Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Cmd. CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# |
| 27 | Crcscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Crc. uint32 // crc including the header with zero crc field |
| 28 | } |
| 29 | |
| 30 | func (h *cmdHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#) Sizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Size().() int { return cmdHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeaderSize. } |
| 31 | func (h *cmdHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#) Unmarshalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Unmarshal().(p []byte) error { |
| 32 | if len(p) < cmdHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeaderSize. { |
| 33 | return ioscip-go gomod github.com/golang/go/src go1.12 io/.ErrUnexpectedEOFscip-go gomod github.com/golang/go/src go1.12 io/ErrUnexpectedEOF. |
| 34 | } |
| 35 | h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Len. = sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint32scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint32().(p[0:]) |
| 36 | h.Cmdscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Cmd. = CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType#(sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint16scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint16().(p[4:])) |
| 37 | h.Crcscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdHeader#Crc. = sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint32scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint32().(p[6:]) |
| 38 | return nil |
| 39 | } |
| 40 | |
| 41 | const tlvHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeaderSize. = 4 |
| 42 | |
| 43 | type tlvHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader# struct { |
| 44 | Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Type. uint16 |
| 45 | Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len. uint16 // len excluding the header |
| 46 | } |
| 47 | |
| 48 | func (h *tlvHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#) Sizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Size().() int { return tlvHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeaderSize. } |
| 49 | func (h *tlvHeaderscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#) Unmarshalscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Unmarshal().(p []byte) error { |
| 50 | if len(p) < tlvHeaderSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeaderSize. { |
| 51 | return ioscip-go gomod github.com/golang/go/src go1.12 io/.ErrUnexpectedEOFscip-go gomod github.com/golang/go/src go1.12 io/ErrUnexpectedEOF. |
| 52 | } |
| 53 | h.Typescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Type. = sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint16scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint16().(p[0:]) |
| 54 | h.Lenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/tlvHeader#Len. = sendEndianessscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendEndianess..Uint16scip-go gomod github.com/golang/go/src go1.12 `encoding/binary`/littleEndian#Uint16().(p[2:]) |
| 55 | return nil |
| 56 | } |
| 57 | |
| 58 | type CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType# uint16 |
| 59 | |
| 60 | func (c CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType#) Stringscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType#String().() string { |
| 61 | var name string |
| 62 | if int(c) < len(cmdTypeNamesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdTypeNames.) { |
| 63 | name = cmdTypeNamesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdTypeNames.[int(c)] |
| 64 | } |
| 65 | if name != "" { |
| 66 | return name |
| 67 | } |
| 68 | return strconvscip-go gomod github.com/golang/go/src go1.12 strconv/.FormatIntscip-go gomod github.com/golang/go/src go1.12 strconv/FormatInt().(int64(c), 16) |
| 69 | } |
| 70 | |
| 71 | var cmdTypeNamesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/cmdTypeNames. = []string{ |
| 72 | "<zero>", |
| 73 | |
| 74 | "subvol", |
| 75 | "snapshot", |
| 76 | |
| 77 | "mkfile", |
| 78 | "mkdir", |
| 79 | "mknod", |
| 80 | "mkfifo", |
| 81 | "mksock", |
| 82 | "symlink", |
| 83 | |
| 84 | "rename", |
| 85 | "link", |
| 86 | "unlink", |
| 87 | "rmdir", |
| 88 | |
| 89 | "set_xattr", |
| 90 | "remove_xattr", |
| 91 | |
| 92 | "write", |
| 93 | "clone", |
| 94 | |
| 95 | "truncate", |
| 96 | "chmod", |
| 97 | "chown", |
| 98 | "utimes", |
| 99 | |
| 100 | "end", |
| 101 | "update_extent", |
| 102 | "<max>", |
| 103 | } |
| 104 | |
| 105 | const ( |
| 106 | sendCmdUnspecscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdUnspec. = CmdTypescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/CmdType#(iota) |
| 107 | |
| 108 | sendCmdSubvolscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSubvol. |
| 109 | sendCmdSnapshotscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSnapshot. |
| 110 | |
| 111 | sendCmdMkfilescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkfile. |
| 112 | sendCmdMkdirscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkdir. |
| 113 | sendCmdMknodscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMknod. |
| 114 | sendCmdMkfifoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMkfifo. |
| 115 | sendCmdMksockscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMksock. |
| 116 | sendCmdSymlinkscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSymlink. |
| 117 | |
| 118 | sendCmdRenamescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdRename. |
| 119 | sendCmdLinkscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdLink. |
| 120 | sendCmdUnlinkscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdUnlink. |
| 121 | sendCmdRmdirscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdRmdir. |
| 122 | |
| 123 | sendCmdSetXattrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdSetXattr. |
| 124 | sendCmdRemoveXattrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdRemoveXattr. |
| 125 | |
| 126 | sendCmdWritescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdWrite. |
| 127 | sendCmdClonescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdClone. |
| 128 | |
| 129 | sendCmdTruncatescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdTruncate. |
| 130 | sendCmdChmodscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdChmod. |
| 131 | sendCmdChownscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdChown. |
| 132 | sendCmdUtimesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdUtimes. |
| 133 | |
| 134 | sendCmdEndscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdEnd. |
| 135 | sendCmdUpdateExtentscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdUpdateExtent. |
| 136 | _sendCmdMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/_sendCmdMax. |
| 137 | ) |
| 138 | |
| 139 | const sendCmdMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdMax. = _sendCmdMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/_sendCmdMax. - 1 |
| 140 | |
| 141 | type sendCmdAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr# uint16 |
| 142 | |
| 143 | func (c sendCmdAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr#) Stringscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr#String().() string { |
| 144 | var name string |
| 145 | if int(c) < len(sendAttrNamesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrNames.) { |
| 146 | name = sendAttrNamesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrNames.[int(c)] |
| 147 | } |
| 148 | if name != "" { |
| 149 | return name |
| 150 | } |
| 151 | return strconvscip-go gomod github.com/golang/go/src go1.12 strconv/.FormatIntscip-go gomod github.com/golang/go/src go1.12 strconv/FormatInt().(int64(c), 16) |
| 152 | } |
| 153 | |
| 154 | const ( |
| 155 | sendAttrUnspecscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUnspec. = sendCmdAttrscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendCmdAttr#(iota) |
| 156 | |
| 157 | sendAttrUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUuid. |
| 158 | sendAttrCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtransid. |
| 159 | |
| 160 | sendAttrInoscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrIno. |
| 161 | sendAttrSizescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrSize. |
| 162 | sendAttrModescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMode. |
| 163 | sendAttrUidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrUid. |
| 164 | sendAttrGidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrGid. |
| 165 | sendAttrRdevscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrRdev. |
| 166 | sendAttrCtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCtime. |
| 167 | sendAttrMtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMtime. |
| 168 | sendAttrAtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrAtime. |
| 169 | sendAttrOtimescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrOtime. |
| 170 | |
| 171 | sendAttrXattrNamescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrXattrName. |
| 172 | sendAttrXattrDatascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrXattrData. |
| 173 | |
| 174 | sendAttrPathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPath. |
| 175 | sendAttrPathToscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPathTo. |
| 176 | sendAttrPathLinkscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrPathLink. |
| 177 | |
| 178 | sendAttrFileOffsetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrFileOffset. |
| 179 | sendAttrDatascip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrData. |
| 180 | |
| 181 | sendAttrCloneUuidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneUuid. |
| 182 | sendAttrCloneCtransidscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneCtransid. |
| 183 | sendAttrClonePathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrClonePath. |
| 184 | sendAttrCloneOffsetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneOffset. |
| 185 | sendAttrCloneLenscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrCloneLen. |
| 186 | |
| 187 | _sendAttrMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/_sendAttrMax. |
| 188 | ) |
| 189 | const sendAttrMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrMax. = _sendAttrMaxscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/_sendAttrMax. - 1 |
| 190 | |
| 191 | var sendAttrNamesscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs/send`/sendAttrNames. = []string{ |
| 192 | "<zero>", |
| 193 | |
| 194 | "uuid", |
| 195 | "ctransid", |
| 196 | |
| 197 | "ino", |
| 198 | "size", |
| 199 | "mode", |
| 200 | "uid", |
| 201 | "gid", |
| 202 | "rdev", |
| 203 | "ctime", |
| 204 | "mtime", |
| 205 | "atime", |
| 206 | "otime", |
| 207 | |
| 208 | "xattrname", |
| 209 | "xattrdata", |
| 210 | |
| 211 | "path", |
| 212 | "pathto", |
| 213 | "pathlink", |
| 214 | |
| 215 | "fileoffset", |
| 216 | "data", |
| 217 | |
| 218 | "cloneuuid", |
| 219 | "clonectransid", |
| 220 | "clonepath", |
| 221 | "cloneoffset", |
| 222 | "clonelen", |
| 223 | |
| 224 | "<max>", |
| 225 | } |