Home | History | Annotate | Download | only in tcpdump

Lines Matching refs:cs

57 cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
62 next = cpack_next_boundary(cs->c_buf, cs->c_next, wordsize);
65 if (next - cs->c_buf + wordsize > cs->c_len)
73 cpack_advance(struct cpack_state *cs, const size_t toskip)
76 if (cs->c_next - cs->c_buf + toskip > cs->c_len)
78 cs->c_next += toskip;
83 cpack_init(struct cpack_state *cs, const uint8_t *buf, size_t buflen)
85 memset(cs, 0, sizeof(*cs));
87 cs->c_buf = buf;
88 cs->c_len = buflen;
89 cs->c_next = cs->c_buf;
96 cpack_uint64(struct cpack_state *cs, uint64_t *u)
100 if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
106 cs->c_next = next + sizeof(*u);
112 cpack_uint32(struct cpack_state *cs, uint32_t *u)
116 if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
122 cs->c_next = next + sizeof(*u);
128 cpack_uint16(struct cpack_state *cs, uint16_t *u)
132 if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
138 cs->c_next = next + sizeof(*u);
144 cpack_uint8(struct cpack_state *cs, uint8_t *u)
147 if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len)
150 *u = *cs->c_next;
153 cs->c_next++;