Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 55) sorted by relevance

123

/mOS-networking-stack/core/src/
H A Dtcp_send_buffer.c81 buf->head = buf->data; in SBInit()
83 buf->head_off = buf->tail_off = 0; in SBInit()
84 buf->len = buf->cum_len = 0; in SBInit()
87 buf->init_seq = buf->head_seq = init_seq; in SBInit()
110 to_put = MIN(len, buf->size - buf->len); in SBPut()
121 memmove(buf->data, buf->head, buf->len); in SBPut()
122 buf->head = buf->data; in SBPut()
125 buf->tail_off = buf->len + to_put; in SBPut()
147 buf->head = buf->data + buf->head_off; in SBRemove()
153 buf->head = buf->data; in SBRemove()
[all …]
H A Dtcp_rb.c118 tcpbufseg_t *buf; in buf_getbuf() local
128 buf = TAILQ_NEXT(buf, link); in buf_getbuf()
132 buf = TAILQ_PREV(buf, blist, link); in buf_getbuf()
135 buf = buf_first(rb); in buf_getbuf()
137 buf = buf_next(rb, buf); in buf_getbuf()
140 assert(buf); in buf_getbuf()
142 return buf; in buf_getbuf()
312 MEMCPY_FOR_##rw(&buf[off], &bufseg->buf[0], UNITBUFSIZE); \
318 MEMCPY_FOR_##rw(&buf[off], &bufseg->buf[0], UNITBUFSIZE); \
321 MEMCPY_FOR_##rw(&buf[off], &bufseg_to->buf[0], to % UNITBUFSIZE); \
[all …]
H A Dpipe.c29 char *buf; member
68 if (!pp->buf) { in mtcp_pipe()
81 free(pp->buf); in mtcp_pipe()
91 free(pp->buf); in mtcp_pipe()
203 memcpy(buf, pp->buf + pp->buf_off, to_read); in PipeRead()
207 memcpy(buf, pp->buf + pp->buf_off, temp_read); in PipeRead()
208 memcpy(buf + temp_read, pp->buf, to_read - temp_read); in PipeRead()
304 memcpy(pp->buf + pp->buf_tail, buf, to_write); in PipeWrite()
309 memcpy(pp->buf + pp->buf_tail, buf, temp_write); in PipeWrite()
310 memcpy(pp->buf, buf + temp_write, to_write - temp_write); in PipeWrite()
[all …]
H A Deth_out.c67 uint8_t *buf; in EthernetOutput() local
84 buf = mtcp->iom->get_wptr(mtcp->ctx, nif, iplen + ETHERNET_HEADER_LEN); in EthernetOutput()
85 if (!buf) { in EthernetOutput()
90 ethh = (struct ethhdr *)buf; in EthernetOutput()
107 uint8_t *buf; in ForwardEthernetFrame() local
123 buf = mtcp->iom->get_wptr(mtcp->ctx, pctx->out_ifidx, pctx->p.eth_len); in ForwardEthernetFrame()
125 if (!buf) { in ForwardEthernetFrame()
130 memcpy(buf, pctx->p.ethh, pctx->p.eth_len); in ForwardEthernetFrame()
H A Dtcp_sb_queue.c55 SBMemoryBarrier(struct tcp_send_buffer * volatile buf, volatile index_type index) in SBMemoryBarrier() argument
57 __asm__ volatile("" : : "m" (buf), "m" (index)); in SBMemoryBarrier()
97 SBEnqueue(sb_queue_t sq, struct tcp_send_buffer *buf) in SBEnqueue() argument
104 sq->_q[t] = buf; in SBEnqueue()
121 struct tcp_send_buffer *buf = sq->_q[h]; in SBDequeue() local
124 assert(buf); in SBDequeue()
126 return buf; in SBDequeue()
H A Dconfig.c62 for(line = buf, \
98 if (isspace(buf[i])) in DetectWord()
102 *word = &buf[i]; in DetectWord()
120 assert(*word >= buf && *word + *wlen <= buf + len); in DetectWord()
1052 while (buf < end && isspace(*buf)) in DetectBlock()
1053 buf++; in DetectBlock()
1064 while (buf < end && isspace(*buf)) in DetectBlock()
1065 buf++; in DetectBlock()
1068 if (buf >= end || *buf != '{') in DetectBlock()
1072 while (buf < end && isspace(*buf)) in DetectBlock()
[all …]
H A Dapi.c955 uint8_t buf[TOTAL_TCP_HEADER_LEN]; in eval_bpf_5tuple() local
960 ethh = (struct ethhdr *)buf; in eval_bpf_5tuple()
1531 return PipeRead(mctx, sockid, buf, len); in mtcp_recv()
1571 ret = CopyToUser(mtcp, cur_stream, buf, len); in mtcp_recv()
1574 ret = PeekForUser(mtcp, cur_stream, buf, len); in mtcp_recv()
1612 mtcp_read(mctx_t mctx, int sockid, char *buf, size_t len) in mtcp_read() argument
1614 return mtcp_recv(mctx, sockid, buf, len, 0); in mtcp_read()
1751 ret = SBPut(mtcp->rbm_snd, sndvar->sndbuf, buf, sndlen); in CopyFromUser()
1770 mtcp_write(mctx_t mctx, int sockid, const char *buf, size_t len) in mtcp_write() argument
1798 return PipeWrite(mctx, sockid, buf, len); in mtcp_write()
[all …]
/mOS-networking-stack/samples/simple_firewall/
H A Dsimple_firewall.c132 char* temp = (char*)buf; in ExtractPort()
152 check = buf; in ExtractPort()
158 port = atoi(buf); in ExtractPort()
165 SKIP_SPACES(buf); in ExtractPort()
167 return buf; in ExtractPort()
190 buf = temp + 1; in ExtractIPAddress()
195 check = buf; in ExtractIPAddress()
201 netmask = atoi(buf); in ExtractIPAddress()
209 buf = temp; in ExtractIPAddress()
210 SKIP_SPACES(buf); in ExtractIPAddress()
[all …]
/mOS-networking-stack/samples/lighttpd-1.4.32/src/
H A Dhttp-header-glue.c279 char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")]; in http_response_handle_cachable() local
284 if (used_len >= sizeof(buf)) { in http_response_handle_cachable()
287 con->request.http_if_modified_since, used_len, sizeof(buf) - 1); in http_response_handle_cachable()
295 strncpy(buf, con->request.http_if_modified_since, used_len); in http_response_handle_cachable()
296 buf[used_len] = '\0'; in http_response_handle_cachable()
298 if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) { in http_response_handle_cachable()
339 char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")]; in http_response_handle_cachable() local
344 if (used_len >= sizeof(buf)) return HANDLER_GO_ON; in http_response_handle_cachable()
346 strncpy(buf, con->request.http_if_modified_since, used_len); in http_response_handle_cachable()
347 buf[used_len] = '\0'; in http_response_handle_cachable()
[all …]
H A Dmod_status.c206 char buf[32]; in mod_status_handle_server_status_html() local
348 strftime(buf, sizeof(buf) - 1, "%Y-%m-%d %H:%M:%S", localtime(&ts)); in mod_status_handle_server_status_html()
349 buffer_append_string(b, buf); in mod_status_handle_server_status_html()
370 sprintf(buf, "%.2f", avg); in mod_status_handle_server_status_html()
371 buffer_append_string(b, buf); in mod_status_handle_server_status_html()
395 sprintf(buf, "%.2f", avg); in mod_status_handle_server_status_html()
396 buffer_append_string(b, buf); in mod_status_handle_server_status_html()
430 sprintf(buf, "%.2f", avg); in mod_status_handle_server_status_html()
569 char buf[32]; in mod_status_handle_server_status_text() local
578 snprintf(buf, sizeof(buf) - 1, "%.0f", avg); in mod_status_handle_server_status_text()
[all …]
H A Dmod_ssi.c239 char buf[32]; in build_ssi_cgi_vars() local
266 LI_ltostr(buf, in build_ssi_cgi_vars()
330 char buf[255]; in process_ssi_stmt() local
459 if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) { in process_ssi_stmt()
462 buffer_copy_string(b, buf); in process_ssi_stmt()
470 if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) { in process_ssi_stmt()
473 buffer_copy_string(b, buf); in process_ssi_stmt()
481 if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, gmtime(&t))) { in process_ssi_stmt()
484 buffer_copy_string(b, buf); in process_ssi_stmt()
613 if (0 == strftime(buf, sizeof(buf), p->timefmt->ptr, localtime(&t))) { in process_ssi_stmt()
[all …]
H A Dbuffer.c258 char *buf; in buffer_append_long_hex() local
274 buf = b->ptr + (b->used - 1); in buffer_append_long_hex()
282 *buf = '\0'; in buffer_append_long_hex()
287 int LI_ltostr(char *buf, long val) { in LI_ltostr() argument
294 *(buf++) = '-'; in LI_ltostr()
298 end = buf; in LI_ltostr()
305 len += end - buf; in LI_ltostr()
307 while (buf < end) { in LI_ltostr()
309 *end = *buf; in LI_ltostr()
310 *buf = swap; in LI_ltostr()
[all …]
H A Dmod_rrdtool.c190 static ssize_t safe_write(int fd, const void *buf, size_t count) { in safe_write() argument
194 res = write(fd, buf, count); in safe_write()
200 buf = (const char*) buf + res; in safe_write()
213 static ssize_t safe_read(int fd, void *buf, size_t count) { in safe_read() argument
217 res = read(fd, buf, count); in safe_read()
H A Dstat_cache.c212 static int stat_cache_attr_get(buffer *buf, char *name) { in stat_cache_attr_get() argument
217 buffer_prepare_copy(buf, attrlen); in stat_cache_attr_get()
219 if(0 == (ret = attr_get(name, "Content-Type", buf->ptr, &attrlen, 0))) { in stat_cache_attr_get()
220 buf->used = attrlen + 1; in stat_cache_attr_get()
221 buf->ptr[attrlen] = '\0'; in stat_cache_attr_get()
/mOS-networking-stack/core/src/include/
H A Dtcp_rb.h42 uint8_t buf[UNITBUFSIZE]; member
102 tcprb_fflen(tcprb_t *rb, uint8_t *buf, int len, loff_t off);
105 tcprb_ppeek(tcprb_t *rb, uint8_t *buf, int len, loff_t off);
108 tcprb_pwrite(tcprb_t *rb, uint8_t *buf, int len, loff_t off);
H A Dtcp_send_buffer.h35 SBFree(sb_manager_t sbm, struct tcp_send_buffer *buf);
38 SBPut(sb_manager_t sbm, struct tcp_send_buffer *buf, const void *data, size_t len);
41 SBRemove(sb_manager_t sbm, struct tcp_send_buffer *buf, size_t len);
H A Dpipe.h7 PipeRead(mctx_t mctx, int pipeid, char *buf, int len);
10 PipeWrite(mctx_t mctx, int pipeid, const char *buf, int len);
H A Dmtcp_api.h382 mtcp_recv(mctx_t mctx, int sockid, char *buf, size_t len, int flags);
388 mtcp_read(mctx_t mctx, int sock, char *buf, size_t len);
401 mtcp_write(mctx_t mctx, int sock, const char *buf, size_t len);
H A Dnetmap_user.h117 #define NETMAP_BUF_IDX(ring, buf) \ argument
118 ( ((char *)(buf) - ((char *)(ring) + (ring)->buf_ofs) ) / \
920 nm_inject(struct nm_desc *d, const void *buf, size_t size) in nm_inject() argument
939 nm_pkt_copy(buf, NETMAP_BUF(ring, idx), size); in nm_inject()
974 u_char *buf = (u_char *)NETMAP_BUF(ring, idx); in nm_dispatch() local
979 cb(arg, &d->hdr, buf); in nm_dispatch()
998 u_char *buf = (u_char *)NETMAP_BUF(ring, idx); in nm_nextpkt() local
1010 return buf; in nm_nextpkt()
/mOS-networking-stack/util/
H A Dnetlib.c207 GetHeaderString(const char *buf, const char* header, int hdrsize) in GetHeaderString() argument
210 char *temp = strstr(buf, header); in GetHeaderString()
222 GetHeaderLong(const char* buf, const char* header, int hdrsize, long int *val) in GetHeaderLong() argument
227 if ((temp = GetHeaderString(buf, header, hdrsize)) != NULL) { in GetHeaderLong()
H A Dhttp_parsing.c40 http_header_str_val(const char* buf, const char *key, const int keylen, in http_header_str_val() argument
43 char *temp = (char *) buf; /* temporarily de-const buf */ in http_header_str_val()
/mOS-networking-stack/core/src/bpf/
H A Dsf_scanner.c2870 buf[n] = (char) c; \
2872 buf[n++] = (char) c; \
4522 char *buf; in sfbpf__scan_bytes() local
4528 buf = (char *) sfbpf_alloc(n ); in sfbpf__scan_bytes()
4529 if ( ! buf ) in sfbpf__scan_bytes()
4533 buf[i] = yybytes[i]; in sfbpf__scan_bytes()
4535 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; in sfbpf__scan_bytes()
4537 b = sfbpf__scan_buffer(buf,n ); in sfbpf__scan_bytes()
4694 lex_init(buf) in lex_init() argument
4695 const char *buf; in lex_init()
[all …]
/mOS-networking-stack/core/include/
H A Dmtcp_api.h382 mtcp_recv(mctx_t mctx, int sockid, char *buf, size_t len, int flags);
388 mtcp_read(mctx_t mctx, int sock, char *buf, size_t len);
401 mtcp_write(mctx_t mctx, int sock, const char *buf, size_t len);
/mOS-networking-stack/util/include/
H A Dhttp_parsing.h20 char* http_header_str_val(const char* buf, const char *key, const int key_len, char* value, int val…
21 long int http_header_long_val(const char* buf, const char *key, int key_len);
H A Dnetlib.h46 char *GetHeaderString(const char *buf, const char* header, int hdrsize);
47 int GetHeaderLong(const char* buf, const char* header, int hdrsize, long int *val);

123