]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/capture/cap_debug/ip.c
Added missing include.
[stg.git] / projects / stargazer / plugins / capture / cap_debug / ip.c
index bc632f37e9cca00e4907981d9009da29599c75c3..a2627177b278ce26e3582c8b38b0dea1584e1d2b 100644 (file)
@@ -53,72 +53,3 @@ pkt_ip_header(struct packet *pkt,
 
        return 0;
 }
-
-int
-pkt_ip_option_header(struct packet *pkt, unsigned char type, unsigned char len, unsigned char ptr, unsigned char oflw_flg, void *optval, size_t optlen)
-{
-       unsigned char *vp;
-       
-       if (!pkt)
-               return EPKTINVALPTR;
-       
-       vp = pkt->pkt_ptr;
-       *vp = type;             
-       switch (type) {
-               case PKT_IP_OPT_END:
-                       break;
-               case PKT_IP_OPT_NOP:
-                       break;
-               case PKT_IP_OPT_SEC:
-                       if ((pkt->pkt_pos + 2 + optlen) <= pkt->pkt_size) {
-                               *(vp+1) = len;
-                               memcpy((void*)(vp+2), optval, optlen);
-                       } else {
-                               return EPKTRANGE;
-                       }
-                       break;
-               case PKT_IP_OPT_RR:
-               case PKT_IP_OPT_LSRR:
-               case PKT_IP_OPT_SSRR:
-               case PKT_IP_OPT_SID:
-                       if ((pkt->pkt_pos + 3 + optlen) <= pkt->pkt_size) {
-                               *(vp+1) = len;
-                               *(vp+2) = ptr;
-                               memcpy((void*)(vp+3), optval, optlen);
-                       } else {
-                               return EPKTRANGE;
-                       }
-                       break;
-               case PKT_IP_OPT_TS:
-                       if ((pkt->pkt_pos + 4 + optlen) <= pkt->pkt_size) {
-                               *(vp+1) = len;
-                               *(vp+2) = ptr;
-                               *(vp+3) = oflw_flg;
-                               memcpy((void*)(vp+4), optval, optlen);
-                       } else {
-                               return EPKTRANGE;
-                       }
-                       break;
-               default:
-                       return EPKTUNKNOWNTYPE;
-       }
-       return PKTOK;
-}      
-       
-int
-pkt_ip_cksum(struct packet *pkt)
-{
-       /*
-       * checksum should be calculated by kernel 
-       * when we are using SOCK_RAW access.
-       */
-       struct ip *ip;
-
-       if (!pkt)
-               return EPKTINVALPTR;
-       
-       ip = (struct ip *) pkt->pkt_ptr;
-       ip->ip_sum = 0;
-       ip->ip_sum = in_cksum((unsigned short *)ip, sizeof(struct ip));
-       return 0;
-}