sctp_modify_hb.c 340 B

12345678910111213141516
  1. #include "unp.h"
  2. int heartbeat_action(int sock_fd, struct sockaddr *sa, socklen_t salen,
  3. u_int value)
  4. {
  5. struct sctp_paddrparams sp;
  6. int siz;
  7. bzero(&sp,sizeof(sp));
  8. sp.spp_hbinterval = value;
  9. memcpy((caddr_t)&sp.spp_address,sa,salen);
  10. Setsockopt(sock_fd,IPPROTO_SCTP,
  11. SCTP_PEER_ADDR_PARAMS, &sp, sizeof(sp));
  12. return(0);
  13. }