644{
645#if IP_OPTIONS_SEND
647}
648
658{
659#endif
662#if CHECKSUM_GEN_IP_INLINE
664#endif
665
666
667
669
671
672
675#if IP_OPTIONS_SEND
676 u16_t optlen_aligned = 0;
677 if (optlen != 0) {
678#if CHECKSUM_GEN_IP_INLINE
680#endif
681
682 optlen_aligned = ((optlen + 3) & ~3);
683 ip_hlen += optlen_aligned;
684
690 }
691 MEMCPY(
p->payload, ip_options, optlen);
692 if (optlen < optlen_aligned) {
693
694 memset(((
char*)
p->payload) + optlen, 0, optlen_aligned - optlen);
695 }
696#if CHECKSUM_GEN_IP_INLINE
697 for (
i = 0;
i < optlen_aligned/2;
i++) {
698 chk_sum += ((
u16_t*)
p->payload)[
i];
699 }
700#endif
701 }
702#endif
703
706
710 }
711
712 iphdr = (
struct ip_hdr *)
p->payload;
713 LWIP_ASSERT(
"check that first pbuf can hold struct ip_hdr",
714 (
p->len >=
sizeof(
struct ip_hdr)));
715
718#if CHECKSUM_GEN_IP_INLINE
720#endif
721
722
724#if CHECKSUM_GEN_IP_INLINE
727#endif
728
731#if CHECKSUM_GEN_IP_INLINE
733#endif
735#if CHECKSUM_GEN_IP_INLINE
736 chk_sum += iphdr->_len;
737#endif
740#if CHECKSUM_GEN_IP_INLINE
741 chk_sum += iphdr->_id;
742#endif
744
747 } else {
748
750 }
751
752#if CHECKSUM_GEN_IP_INLINE
755 chk_sum = (chk_sum >> 16) + (chk_sum & 0xFFFF);
756 chk_sum = (chk_sum >> 16) + chk_sum;
757 chk_sum = ~chk_sum;
758 iphdr->_chksum = chk_sum;
759#else
761#if CHECKSUM_GEN_IP
763#endif
764#endif
765 } else {
766
767 iphdr = (
struct ip_hdr *)
p->payload;
770 }
771
773
776
777#if ENABLE_LOOPBACK
779
782 }
783#if LWIP_IGMP
786 }
787#endif
788#endif
789#if IP_FRAG
790
793 }
794#endif
795
798}
#define LWIP_MAKE_U16(a, b)
#define IPH_VHL_SET(hdr, v, hl)
#define IPH_LEN_SET(hdr, len)
#define IPH_ID_SET(hdr, id)
#define IPH_PROTO_SET(hdr, proto)
#define IPH_OFFSET_SET(hdr, off)
#define IPH_TTL_SET(hdr, ttl)
#define IPH_CHKSUM_SET(hdr, chksum)
#define IPH_TOS_SET(hdr, tos)
#define snmp_inc_ipoutrequests()
#define snmp_inc_ipoutdiscards()
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define MEMCPY(DST, SRC, BYTES)
u8_t pbuf_header(struct pbuf *p, s16_t header_size_increment)
#define PBUF_FLAG_MCASTLOOP