mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-14 04:54:49 +00:00
trivial portability issues c89
This commit is contained in:
parent
5c455bda74
commit
2b6a4f97c3
@ -116,12 +116,12 @@ struct msg_buffer_s {
|
|||||||
|
|
||||||
|
|
||||||
struct hep_hdr{
|
struct hep_hdr{
|
||||||
u_int8_t hp_v; /* version */
|
uint8_t hp_v; /* version */
|
||||||
u_int8_t hp_l; /* length */
|
uint8_t hp_l; /* length */
|
||||||
u_int8_t hp_f; /* family */
|
uint8_t hp_f; /* family */
|
||||||
u_int8_t hp_p; /* protocol */
|
uint8_t hp_p; /* protocol */
|
||||||
u_int16_t hp_sport; /* source port */
|
uint16_t hp_sport; /* source port */
|
||||||
u_int16_t hp_dport; /* destination port */
|
uint16_t hp_dport; /* destination port */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,10 +114,10 @@ su_log_t tport_log[] = {
|
|||||||
/** Initialize logging. */
|
/** Initialize logging. */
|
||||||
int tport_open_log(tport_master_t *mr, tagi_t *tags)
|
int tport_open_log(tport_master_t *mr, tagi_t *tags)
|
||||||
{
|
{
|
||||||
|
int n;
|
||||||
int log_msg = mr->mr_log != 0;
|
int log_msg = mr->mr_log != 0;
|
||||||
char const *dump = NULL;
|
char const *dump = NULL;
|
||||||
char const *capt = NULL;;
|
char const *capt = NULL;;
|
||||||
int n;
|
|
||||||
|
|
||||||
if(mr->mr_capt_name) capt = mr->mr_capt_name;
|
if(mr->mr_capt_name) capt = mr->mr_capt_name;
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ void tport_capt_msg(tport_t const *self, msg_t *msg, size_t n,
|
|||||||
struct hep_ip6hdr hep_ip6header;
|
struct hep_ip6hdr hep_ip6header;
|
||||||
#endif
|
#endif
|
||||||
int eth_frame_len = 8000;
|
int eth_frame_len = 8000;
|
||||||
void* buffer;
|
char* buffer;
|
||||||
size_t i, dst = 0;
|
size_t i, dst = 0;
|
||||||
tport_master_t *mr;
|
tport_master_t *mr;
|
||||||
|
|
||||||
@ -408,16 +408,16 @@ void tport_capt_msg(tport_t const *self, msg_t *msg, size_t n,
|
|||||||
|
|
||||||
/* Copy hepheader */
|
/* Copy hepheader */
|
||||||
memset(buffer, '\0', eth_frame_len);
|
memset(buffer, '\0', eth_frame_len);
|
||||||
memcpy((void*)buffer, &hep_header, sizeof(struct hep_hdr));
|
memcpy(buffer, &hep_header, sizeof(struct hep_hdr));
|
||||||
buflen = sizeof(struct hep_hdr);
|
buflen = sizeof(struct hep_hdr);
|
||||||
|
|
||||||
if(su->su_family == AF_INET) {
|
if(su->su_family == AF_INET) {
|
||||||
memcpy((void*)buffer + buflen, &hep_ipheader, sizeof(struct hep_iphdr));
|
memcpy(buffer + buflen, &hep_ipheader, sizeof(struct hep_iphdr));
|
||||||
buflen += sizeof(struct hep_iphdr);
|
buflen += sizeof(struct hep_iphdr);
|
||||||
}
|
}
|
||||||
#if SU_HAVE_IN6
|
#if SU_HAVE_IN6
|
||||||
else {
|
else {
|
||||||
memcpy((void*)buffer+buflen, &hep_ip6header, sizeof(struct hep_ip6hdr));
|
memcpy(buffer+buflen, &hep_ip6header, sizeof(struct hep_ip6hdr));
|
||||||
buflen += sizeof(struct hep_ip6hdr);
|
buflen += sizeof(struct hep_ip6hdr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -430,7 +430,7 @@ void tport_capt_msg(tport_t const *self, msg_t *msg, size_t n,
|
|||||||
if((buflen + len) > eth_frame_len)
|
if((buflen + len) > eth_frame_len)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
memcpy((void*)(buffer + buflen) , (void*)iov[i].mv_base, len);
|
memcpy(buffer + buflen , (void*)iov[i].mv_base, len);
|
||||||
buflen +=len;
|
buflen +=len;
|
||||||
n -= len;
|
n -= len;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user