Lines Matching refs:p
44 unsigned char *p; in x25_parse_facilities() local
68 p = skb->data + 1; in x25_parse_facilities()
71 switch (*p & X25_FAC_CLASS_MASK) { in x25_parse_facilities()
75 switch (*p) { in x25_parse_facilities()
77 if((p[1] & 0x81) == 0x81) { in x25_parse_facilities()
78 facilities->reverse = p[1] & 0x81; in x25_parse_facilities()
83 if((p[1] & 0x01) == 0x01) { in x25_parse_facilities()
84 facilities->reverse = p[1] & 0x01; in x25_parse_facilities()
89 if((p[1] & 0x80) == 0x80) { in x25_parse_facilities()
90 facilities->reverse = p[1] & 0x80; in x25_parse_facilities()
95 if(p[1] == 0x00) { in x25_parse_facilities()
103 facilities->throughput = p[1]; in x25_parse_facilities()
111 p[0], p[1]); in x25_parse_facilities()
114 p += 2; in x25_parse_facilities()
120 switch (*p) { in x25_parse_facilities()
122 facilities->pacsize_in = p[1]; in x25_parse_facilities()
123 facilities->pacsize_out = p[2]; in x25_parse_facilities()
127 facilities->winsize_in = p[1]; in x25_parse_facilities()
128 facilities->winsize_out = p[2]; in x25_parse_facilities()
134 p[0], p[1], p[2]); in x25_parse_facilities()
137 p += 3; in x25_parse_facilities()
145 p[0], p[1], p[2], p[3]); in x25_parse_facilities()
146 p += 4; in x25_parse_facilities()
150 if (len < p[1] + 2) in x25_parse_facilities()
152 switch (*p) { in x25_parse_facilities()
154 if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1) in x25_parse_facilities()
156 if (p[2] > X25_MAX_AE_LEN) in x25_parse_facilities()
158 dte_facs->calling_len = p[2]; in x25_parse_facilities()
159 memcpy(dte_facs->calling_ae, &p[3], p[1] - 1); in x25_parse_facilities()
163 if (p[1] > X25_MAX_DTE_FACIL_LEN || p[1] <= 1) in x25_parse_facilities()
165 if (p[2] > X25_MAX_AE_LEN) in x25_parse_facilities()
167 dte_facs->called_len = p[2]; in x25_parse_facilities()
168 memcpy(dte_facs->called_ae, &p[3], p[1] - 1); in x25_parse_facilities()
173 "length %d\n", p[0], p[1]); in x25_parse_facilities()
176 len -= p[1] + 2; in x25_parse_facilities()
177 p += p[1] + 2; in x25_parse_facilities()
182 return p - skb->data; in x25_parse_facilities()
192 unsigned char *p = buffer + 1; in x25_create_facilities() local
206 *p++ = X25_FAC_REVERSE; in x25_create_facilities()
207 *p++ = facilities->reverse; in x25_create_facilities()
211 *p++ = X25_FAC_THROUGHPUT; in x25_create_facilities()
212 *p++ = facilities->throughput; in x25_create_facilities()
217 *p++ = X25_FAC_PACKET_SIZE; in x25_create_facilities()
218 *p++ = facilities->pacsize_in ? : facilities->pacsize_out; in x25_create_facilities()
219 *p++ = facilities->pacsize_out ? : facilities->pacsize_in; in x25_create_facilities()
224 *p++ = X25_FAC_WINDOW_SIZE; in x25_create_facilities()
225 *p++ = facilities->winsize_in ? : facilities->winsize_out; in x25_create_facilities()
226 *p++ = facilities->winsize_out ? : facilities->winsize_in; in x25_create_facilities()
230 *p++ = X25_MARKER; in x25_create_facilities()
231 *p++ = X25_DTE_SERVICES; in x25_create_facilities()
236 *p++ = X25_FAC_CALLING_AE; in x25_create_facilities()
237 *p++ = 1 + bytecount; in x25_create_facilities()
238 *p++ = dte_facs->calling_len; in x25_create_facilities()
239 memcpy(p, dte_facs->calling_ae, bytecount); in x25_create_facilities()
240 p += bytecount; in x25_create_facilities()
247 *p++ = X25_FAC_CALLED_AE; in x25_create_facilities()
248 *p++ = 1 + bytecount; in x25_create_facilities()
249 *p++ = dte_facs->called_len; in x25_create_facilities()
250 memcpy(p, dte_facs->called_ae, bytecount); in x25_create_facilities()
251 p+=bytecount; in x25_create_facilities()
254 len = p - buffer; in x25_create_facilities()