Lines Matching refs:bits
36 let mut bits = self.op_code << 11 | self.rcode as u16; in pack() localVariable
38 bits |= HEADER_BIT_RA in pack()
41 bits |= HEADER_BIT_RD in pack()
44 bits |= HEADER_BIT_TC in pack()
47 bits |= HEADER_BIT_AA in pack()
50 bits |= HEADER_BIT_QR in pack()
53 (id, bits) in pack()
102 pub bits: u16, field
123 msg = pack_uint16(msg, self.bits); in pack()
135 let (bits, off) = unpack_uint16(msg, off)?; in unpack()
136 self.bits = bits; in unpack()
156 response: (self.bits & HEADER_BIT_QR) != 0, in header()
157 op_code: ((self.bits >> 11) & 0xF) as OpCode, in header()
158 authoritative: (self.bits & HEADER_BIT_AA) != 0, in header()
159 truncated: (self.bits & HEADER_BIT_TC) != 0, in header()
160 recursion_desired: (self.bits & HEADER_BIT_RD) != 0, in header()
161 recursion_available: (self.bits & HEADER_BIT_RA) != 0, in header()
162 rcode: RCode::from((self.bits & 0xF) as u8), in header()