Lines Matching full:cs
57 nd_cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
62 next = nd_cpack_next_boundary(cs->c_buf, cs->c_next, wordsize);
65 if (next - cs->c_buf + wordsize > cs->c_len)
73 nd_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 nd_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 nd_cpack_uint64(netdissect_options *ndo, struct cpack_state *cs, uint64_t *u)
100 if ((next = nd_cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
106 cs->c_next = next + sizeof(*u);
112 nd_cpack_int64(netdissect_options *ndo, struct cpack_state *cs, int64_t *u)
116 if ((next = nd_cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
122 cs->c_next = next + sizeof(*u);
128 nd_cpack_uint32(netdissect_options *ndo, struct cpack_state *cs, uint32_t *u)
132 if ((next = nd_cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
138 cs->c_next = next + sizeof(*u);
144 nd_cpack_int32(netdissect_options *ndo, struct cpack_state *cs, int32_t *u)
148 if ((next = nd_cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
154 cs->c_next = next + sizeof(*u);
160 nd_cpack_uint16(netdissect_options *ndo, struct cpack_state *cs, uint16_t *u)
164 if ((next = nd_cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
170 cs->c_next = next + sizeof(*u);
176 nd_cpack_int16(netdissect_options *ndo, struct cpack_state *cs, int16_t *u)
180 if ((next = nd_cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
186 cs->c_next = next + sizeof(*u);
192 nd_cpack_uint8(netdissect_options *ndo, struct cpack_state *cs, uint8_t *u)
195 if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len)
198 *u = GET_U_1(cs->c_next);
201 cs->c_next++;
207 nd_cpack_int8(netdissect_options *ndo, struct cpack_state *cs, int8_t *u)
210 if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len)
213 *u = GET_S_1(cs->c_next);
216 cs->c_next++;