Ignore:
Timestamp:
11/29/18 10:12:59 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
fdf23b8
Parents:
d74ca03
Message:

Apply changes required for pull request #81

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_ospf.c

    rf6f3ae5 r2193905  
    2727#include "libtrace.h"
    2828#include "protocols.h"
    29 #include <assert.h>
    3029#include <stdlib.h>
    3130#include <stdio.h> // fprintf
     
    4544                return NULL;
    4645        }
    47         /*assert(version != NULL && "version may not be NULL when calling trace_get_ospf_header!");*/
    4846        if (!version) {
    4947                fprintf(stderr, "NULL version passed into trace_get_ospf_version()\n");
     
    7068        char *ptr;
    7169
    72         /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_ospf_contents!");*/
    7370        if (!remaining) {
    7471                fprintf(stderr, "Remaining may not be NULL when calling trace_get_ospf_contents()\n");
     
    8683                *ospf_type = 0;
    8784                *remaining = 0;
    88                 fprintf(stderr, "Remaining may not be less than the size of libtrace_ospf_v2_t when calling trace_get_ospf_contents()\n");
    8985                return NULL;
    9086        }
     
    104100
    105101        unsigned char *link_ptr = NULL;
    106         /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_first_link_from_router_lsa_v2!");*/
    107102        if (!remaining) {
    108103                fprintf(stderr, "Remaining may not be NULL when calling trace_get_first_link_from_router_lsa_v2()\n");
     
    116111        if (*remaining < sizeof(libtrace_ospf_router_lsa_v2_t)) {
    117112                *remaining = 0;
    118                 fprintf(stderr, "Remaining may not be less than the size of libtrace_ospf_router_lsa_v2_t when calling trace_get_first_ospf_link_from_router_lsa_v2()\n");
    119113                return NULL;
    120114        }
     
    132126        unsigned char *lsa_ptr = NULL;
    133127
    134         /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_first_ospf_v2_lsa!");*/
    135128        if (!remaining) {
    136129                fprintf(stderr, "Remaining may not be NULL when calling trace_get_first_ospf_v2_lsa()\n");
     
    144137        if (*remaining < sizeof(libtrace_ospf_db_desc_v2_t)) {
    145138                *remaining = 0;
    146                 fprintf(stderr, "Remaining may not be less than the size of libtrace_ospf_db_desc_v2_t when calling trace_get_first_ospf_lsa_from_db_desc_v2()\n");
    147139                return NULL;
    148140        }
     
    160152        unsigned char *lsa_ptr = NULL;
    161153
    162         /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_first_ospf_v2_lsa!");*/
    163154        if (!remaining) {
    164                 fprintf(stderr, "Remaining may not be NULL when calling trace_get_first_ospf_v2_lsa()\n");
     155                fprintf(stderr, "Remaining may not be NULL when calling "
     156                        "trace_get_first_ospf_lsa_from_update_v2()\n");
    165157                return NULL;
    166158        }
    167159        if (!ls_update) {
    168                 fprintf(stderr, "ls_update may not be NULL when calling trace_get_first_ospf_v2_lsa()\n");
     160                fprintf(stderr, "ls_update may not be NULL when calling "
     161                        "trace_get_first_ospf_lsa_from_update_v2()\n");
    169162                return NULL;
    170163        }
     
    172165        if (*remaining < sizeof(libtrace_ospf_ls_update_t)) {
    173166                *remaining = 0;
    174                 fprintf(stderr, "Remaining may not be less than the size of an ls_update when calling trace_get_first_ospf_v2_lsa()\n");
    175167                return NULL;
    176168        }
     
    187179        uint32_t metric = 0;
    188180
    189         /*assert(as_lsa);*/
    190181        if (!as_lsa) {
    191182                fprintf(stderr, "NULL as_lsa passed into trace_get_ospf_metric_from_as_external_lsa_v2()\n");
     
    206197        uint32_t metric = 0;
    207198
    208         /*assert(sum_lsa);*/
    209199        if (!sum_lsa) {
    210200                fprintf(stderr, "NULL sum_lsa passed into trace_get_ospf_metric_from_summary_lsa_v2()\n");
Note: See TracChangeset for help on using the changeset viewer.