Lines Matching refs:hdr
1293 void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { in clusterProcessGossipSection() argument
1294 uint16_t count = ntohs(hdr->count); in clusterProcessGossipSection()
1295 clusterMsgDataGossip *g = (clusterMsgDataGossip*) hdr->data.ping.gossip; in clusterProcessGossipSection()
1296 clusterNode *sender = link->node ? link->node : clusterLookupNode(hdr->sender); in clusterProcessGossipSection()
1542 clusterMsg *hdr = (clusterMsg*) link->rcvbuf; in clusterProcessPacket() local
1543 uint32_t totlen = ntohl(hdr->totlen); in clusterProcessPacket()
1544 uint16_t type = ntohs(hdr->type); in clusterProcessPacket()
1554 if (ntohs(hdr->ver) != CLUSTER_PROTO_VER) { in clusterProcessPacket()
1559 uint16_t flags = ntohs(hdr->flags); in clusterProcessPacket()
1566 uint16_t count = ntohs(hdr->count); in clusterProcessPacket()
1582 ntohl(hdr->data.publish.msg.channel_len) + in clusterProcessPacket()
1583 ntohl(hdr->data.publish.msg.message_len); in clusterProcessPacket()
1600 sender = clusterLookupNode(hdr->sender); in clusterProcessPacket()
1603 senderCurrentEpoch = ntohu64(hdr->currentEpoch); in clusterProcessPacket()
1604 senderConfigEpoch = ntohu64(hdr->configEpoch); in clusterProcessPacket()
1614 sender->repl_offset = ntohu64(hdr->offset); in clusterProcessPacket()
1621 hdr->mflags[0] & CLUSTERMSG_FLAG0_PAUSED && in clusterProcessPacket()
1669 node->port = ntohs(hdr->port); in clusterProcessPacket()
1678 clusterProcessGossipSection(hdr,link); in clusterProcessPacket()
1699 if (nodeUpdateAddressIfNeeded(sender,link,ntohs(hdr->port))) in clusterProcessPacket()
1712 clusterRenameNode(link->node, hdr->sender); in clusterProcessPacket()
1718 } else if (memcmp(link->node->name,hdr->sender, in clusterProcessPacket()
1740 nodeUpdateAddressIfNeeded(sender,link,ntohs(hdr->port))) in clusterProcessPacket()
1768 if (!memcmp(hdr->slaveof,CLUSTER_NODE_NULL_NAME, in clusterProcessPacket()
1769 sizeof(hdr->slaveof))) in clusterProcessPacket()
1775 clusterNode *master = clusterLookupNode(hdr->slaveof); in clusterProcessPacket()
1818 hdr->myslots,sizeof(hdr->myslots)) != 0; in clusterProcessPacket()
1826 clusterUpdateSlotsConfigWith(sender,senderConfigEpoch,hdr->myslots); in clusterProcessPacket()
1850 if (bitmapTestBit(hdr->myslots,j)) { in clusterProcessPacket()
1882 if (sender) clusterProcessGossipSection(hdr,link); in clusterProcessPacket()
1887 failing = clusterLookupNode(hdr->data.fail.about.nodename); in clusterProcessPacket()
1893 hdr->sender, hdr->data.fail.about.nodename); in clusterProcessPacket()
1903 hdr->sender, hdr->data.fail.about.nodename); in clusterProcessPacket()
1914 channel_len = ntohl(hdr->data.publish.msg.channel_len); in clusterProcessPacket()
1915 message_len = ntohl(hdr->data.publish.msg.message_len); in clusterProcessPacket()
1917 (char*)hdr->data.publish.msg.bulk_data,channel_len); in clusterProcessPacket()
1919 (char*)hdr->data.publish.msg.bulk_data+channel_len, in clusterProcessPacket()
1927 clusterSendFailoverAuthIfNeeded(sender,hdr); in clusterProcessPacket()
1956 ntohu64(hdr->data.update.nodecfg.configEpoch); in clusterProcessPacket()
1959 n = clusterLookupNode(hdr->data.update.nodecfg.nodename); in clusterProcessPacket()
1974 hdr->data.update.nodecfg.slots); in clusterProcessPacket()
2018 clusterMsg *hdr; in clusterReadHandler() local
2032 hdr = (clusterMsg*) link->rcvbuf; in clusterReadHandler()
2036 if (memcmp(hdr->sig,"RCmb",4) != 0 || in clusterReadHandler()
2037 ntohl(hdr->totlen) < CLUSTERMSG_MIN_LEN) in clusterReadHandler()
2046 readlen = ntohl(hdr->totlen) - rcvbuflen; in clusterReadHandler()
2062 hdr = (clusterMsg*) link->rcvbuf; in clusterReadHandler()
2067 if (rcvbuflen >= 8 && rcvbuflen == ntohl(hdr->totlen)) { in clusterReadHandler()
2116 void clusterBuildMessageHdr(clusterMsg *hdr, int type) { in clusterBuildMessageHdr() argument
2128 memset(hdr,0,sizeof(*hdr)); in clusterBuildMessageHdr()
2129 hdr->ver = htons(CLUSTER_PROTO_VER); in clusterBuildMessageHdr()
2130 hdr->sig[0] = 'R'; in clusterBuildMessageHdr()
2131 hdr->sig[1] = 'C'; in clusterBuildMessageHdr()
2132 hdr->sig[2] = 'm'; in clusterBuildMessageHdr()
2133 hdr->sig[3] = 'b'; in clusterBuildMessageHdr()
2134 hdr->type = htons(type); in clusterBuildMessageHdr()
2135 memcpy(hdr->sender,myself->name,CLUSTER_NAMELEN); in clusterBuildMessageHdr()
2137 memcpy(hdr->myslots,master->slots,sizeof(hdr->myslots)); in clusterBuildMessageHdr()
2138 memset(hdr->slaveof,0,CLUSTER_NAMELEN); in clusterBuildMessageHdr()
2140 memcpy(hdr->slaveof,myself->slaveof->name, CLUSTER_NAMELEN); in clusterBuildMessageHdr()
2141 hdr->port = htons(server.port); in clusterBuildMessageHdr()
2142 hdr->flags = htons(myself->flags); in clusterBuildMessageHdr()
2143 hdr->state = server.cluster->state; in clusterBuildMessageHdr()
2146 hdr->currentEpoch = htonu64(server.cluster->currentEpoch); in clusterBuildMessageHdr()
2147 hdr->configEpoch = htonu64(master->configEpoch); in clusterBuildMessageHdr()
2154 hdr->offset = htonu64(offset); in clusterBuildMessageHdr()
2158 hdr->mflags[0] |= CLUSTERMSG_FLAG0_PAUSED; in clusterBuildMessageHdr()
2169 hdr->totlen = htonl(totlen); in clusterBuildMessageHdr()
2177 clusterMsg *hdr; in clusterSendPing() local
2226 hdr = (clusterMsg*) buf; in clusterSendPing()
2231 clusterBuildMessageHdr(hdr,type); in clusterSendPing()
2264 if (memcmp(hdr->data.ping.gossip[j].nodename,this->name, in clusterSendPing()
2271 gossip = &(hdr->data.ping.gossip[gossipcount]); in clusterSendPing()
2287 hdr->count = htons(gossipcount); in clusterSendPing()
2288 hdr->totlen = htonl(totlen); in clusterSendPing()
2335 clusterMsg *hdr = (clusterMsg*) buf; in clusterSendPublish() local
2344 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_PUBLISH); in clusterSendPublish()
2348 hdr->data.publish.msg.channel_len = htonl(channel_len); in clusterSendPublish()
2349 hdr->data.publish.msg.message_len = htonl(message_len); in clusterSendPublish()
2350 hdr->totlen = htonl(totlen); in clusterSendPublish()
2357 memcpy(payload,hdr,sizeof(*hdr)); in clusterSendPublish()
2358 hdr = (clusterMsg*) payload; in clusterSendPublish()
2360 memcpy(hdr->data.publish.msg.bulk_data,channel->ptr,sdslen(channel->ptr)); in clusterSendPublish()
2361 memcpy(hdr->data.publish.msg.bulk_data+sdslen(channel->ptr), in clusterSendPublish()
2381 clusterMsg *hdr = (clusterMsg*) buf; in clusterSendFail() local
2383 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAIL); in clusterSendFail()
2384 memcpy(hdr->data.fail.about.nodename,nodename,CLUSTER_NAMELEN); in clusterSendFail()
2385 clusterBroadcastMessage(buf,ntohl(hdr->totlen)); in clusterSendFail()
2393 clusterMsg *hdr = (clusterMsg*) buf; in clusterSendUpdate() local
2396 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_UPDATE); in clusterSendUpdate()
2397 memcpy(hdr->data.update.nodecfg.nodename,node->name,CLUSTER_NAMELEN); in clusterSendUpdate()
2398 hdr->data.update.nodecfg.configEpoch = htonu64(node->configEpoch); in clusterSendUpdate()
2399 memcpy(hdr->data.update.nodecfg.slots,node->slots,sizeof(node->slots)); in clusterSendUpdate()
2400 clusterSendMessage(link,buf,ntohl(hdr->totlen)); in clusterSendUpdate()
2426 clusterMsg *hdr = (clusterMsg*) buf; in clusterRequestFailoverAuth() local
2429 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST); in clusterRequestFailoverAuth()
2433 if (server.cluster->mf_end) hdr->mflags[0] |= CLUSTERMSG_FLAG0_FORCEACK; in clusterRequestFailoverAuth()
2435 hdr->totlen = htonl(totlen); in clusterRequestFailoverAuth()
2442 clusterMsg *hdr = (clusterMsg*) buf; in clusterSendFailoverAuth() local
2446 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK); in clusterSendFailoverAuth()
2448 hdr->totlen = htonl(totlen); in clusterSendFailoverAuth()
2455 clusterMsg *hdr = (clusterMsg*) buf; in clusterSendMFStart() local
2459 clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_MFSTART); in clusterSendMFStart()
2461 hdr->totlen = htonl(totlen); in clusterSendMFStart()