Lines Matching refs:buffer
147 char buffer[512]; in getconfig() local
149 while(fgets(buffer, sizeof(buffer), fp)) { in getconfig()
152 if(2 == sscanf(buffer, "%31s %31s", key, value)) { in getconfig()
186 static void loghex(unsigned char *buffer, ssize_t len) in loghex() argument
190 unsigned char *ptr = buffer; in loghex()
213 unsigned char *buffer, ssize_t len) in logprotocol() argument
217 unsigned char *ptr = buffer; in logprotocol()
459 unsigned char buffer[10]; in fixedheader() local
462 ssize_t rc = sread(fd, (char *)buffer, 2); in fixedheader()
469 loghex(buffer, rc); in fixedheader()
470 *bytep = buffer[0]; in fixedheader()
474 while(buffer[i] & 0x80) { in fixedheader()
476 rc = sread(fd, (char *)&buffer[i], 1); in fixedheader()
482 *remaining_lengthp = decode_length(&buffer[1], i, remaining_length_bytesp); in fixedheader()
491 unsigned char *buffer = NULL; in mqttit() local
523 buffer = malloc(buff_size); in mqttit()
524 if(!buffer) { in mqttit()
544 buffer = realloc(buffer, buff_size); in mqttit()
545 if(!buffer) { in mqttit()
553 rc = sread(fd, (char *)buffer, remaining_length); in mqttit()
556 loghex(buffer, rc); in mqttit()
562 dump, buffer, rc); in mqttit()
564 if(memcmp(protocol, buffer, sizeof(protocol))) { in mqttit()
569 payload_len = (size_t)(buffer[10] << 8) | buffer[11]; in mqttit()
574 conn_flags = buffer[7]; in mqttit()
579 payload_len += (size_t)(buffer[start_usr] << 8) | in mqttit()
580 buffer[start_usr + 1]; in mqttit()
587 payload_len += (size_t)(buffer[start_passwd] << 8) | in mqttit()
588 buffer[start_passwd + 1]; in mqttit()
603 memcpy(client_id, &buffer[12], client_id_length); in mqttit()
621 dump, buffer, rc); in mqttit()
630 packet_id = (unsigned short)((buffer[0] << 8) | buffer[1]); in mqttit()
633 topic_len = (size_t)(buffer[2] << 8) | buffer[3]; in mqttit()
639 memcpy(topic, &buffer[4], topic_len); in mqttit()
679 dump, buffer, rc); in mqttit()
681 topiclen = (size_t)(buffer[1 + bytes] << 8) | buffer[2 + bytes]; in mqttit()
691 rc = sread(fd, (char *)&buffer[0], 2); in mqttit()
694 loghex(buffer, rc); in mqttit()
695 logprotocol(FROM_CLIENT, "DISCONNECT", 0, dump, buffer, rc); in mqttit()
705 if(buffer) in mqttit()
706 free(buffer); in mqttit()