Changeset 2193905 for lib/protocols_ospf.c
- Timestamp:
- 11/29/18 10:12:59 (2 years ago)
- Branches:
- develop
- Children:
- fdf23b8
- Parents:
- d74ca03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols_ospf.c
rf6f3ae5 r2193905 27 27 #include "libtrace.h" 28 28 #include "protocols.h" 29 #include <assert.h>30 29 #include <stdlib.h> 31 30 #include <stdio.h> // fprintf … … 45 44 return NULL; 46 45 } 47 /*assert(version != NULL && "version may not be NULL when calling trace_get_ospf_header!");*/48 46 if (!version) { 49 47 fprintf(stderr, "NULL version passed into trace_get_ospf_version()\n"); … … 70 68 char *ptr; 71 69 72 /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_ospf_contents!");*/73 70 if (!remaining) { 74 71 fprintf(stderr, "Remaining may not be NULL when calling trace_get_ospf_contents()\n"); … … 86 83 *ospf_type = 0; 87 84 *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");89 85 return NULL; 90 86 } … … 104 100 105 101 unsigned char *link_ptr = NULL; 106 /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_first_link_from_router_lsa_v2!");*/107 102 if (!remaining) { 108 103 fprintf(stderr, "Remaining may not be NULL when calling trace_get_first_link_from_router_lsa_v2()\n"); … … 116 111 if (*remaining < sizeof(libtrace_ospf_router_lsa_v2_t)) { 117 112 *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");119 113 return NULL; 120 114 } … … 132 126 unsigned char *lsa_ptr = NULL; 133 127 134 /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_first_ospf_v2_lsa!");*/135 128 if (!remaining) { 136 129 fprintf(stderr, "Remaining may not be NULL when calling trace_get_first_ospf_v2_lsa()\n"); … … 144 137 if (*remaining < sizeof(libtrace_ospf_db_desc_v2_t)) { 145 138 *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");147 139 return NULL; 148 140 } … … 160 152 unsigned char *lsa_ptr = NULL; 161 153 162 /*assert(remaining != NULL && "remaining may not be NULL when calling trace_get_first_ospf_v2_lsa!");*/163 154 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"); 165 157 return NULL; 166 158 } 167 159 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"); 169 162 return NULL; 170 163 } … … 172 165 if (*remaining < sizeof(libtrace_ospf_ls_update_t)) { 173 166 *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");175 167 return NULL; 176 168 } … … 187 179 uint32_t metric = 0; 188 180 189 /*assert(as_lsa);*/190 181 if (!as_lsa) { 191 182 fprintf(stderr, "NULL as_lsa passed into trace_get_ospf_metric_from_as_external_lsa_v2()\n"); … … 206 197 uint32_t metric = 0; 207 198 208 /*assert(sum_lsa);*/209 199 if (!sum_lsa) { 210 200 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.