MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / dns_a_parser

Function dns_a_parser

resolve.c:939–953  ·  view source on GitHub ↗

! \brief Parses an A record rdata into an a_rdata structure * \return 0 on error or a dyn. alloc'ed a_rdata struct */

Source from the content-addressed store, hash-verified

937 * \return 0 on error or a dyn. alloc'ed a_rdata struct
938 */
939struct a_rdata* dns_a_parser(unsigned char* rdata, unsigned char* end)
940{
941 struct a_rdata* a;
942
943 if (rdata+4>=end) goto error;
944 a=(struct a_rdata*)local_malloc(sizeof(struct a_rdata));
945 if (a==0){
946 LM_ERR("out of pkg memory\n");
947 goto error;
948 }
949 memcpy(a->ip, rdata, 4);
950 return a;
951error:
952 return 0;
953}
954
955
956

Callers 1

get_recordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected