References: =========== - [MS-SMB2]: 2.2.9
| 288 | |
| 289 | |
| 290 | class SMB2TreeConnectRequest(Structure): |
| 291 | """ |
| 292 | References: |
| 293 | =========== |
| 294 | - [MS-SMB2]: 2.2.9 |
| 295 | """ |
| 296 | |
| 297 | STRUCTURE_FORMAT = "<HHHH" |
| 298 | STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT) |
| 299 | |
| 300 | def __init__(self, path): |
| 301 | self.path = path |
| 302 | |
| 303 | def initMessage(self, message): |
| 304 | Structure.initMessage(self, message) |
| 305 | message.command = SMB2_COM_TREE_CONNECT |
| 306 | |
| 307 | def prepare(self, message): |
| 308 | message.data = struct.pack(self.STRUCTURE_FORMAT, |
| 309 | 9, # Structure size. Must be 9 as mandated by [MS-SMB2] 2.2.9 |
| 310 | 0, # Reserved |
| 311 | SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, |
| 312 | len(self.path)*2) + self.path.encode('UTF-16LE') |
| 313 | |
| 314 | |
| 315 | class SMB2TreeConnectResponse(Structure): |
no outgoing calls
no test coverage detected