1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fixed exception syntax error..

This commit is contained in:
Matias Fontanini
2011-08-24 00:00:24 -03:00
parent b746451b75
commit 7ccae0c994
8 changed files with 9 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ Tins::ARP::ARP(uint32_t target_ip, uint32_t sender_ip, const uint8_t *target_hw,
Tins::ARP::ARP(const uint8_t *buffer, uint32_t total_sz) : PDU(0x0608) {
if(total_sz < sizeof(arphdr))
throw std::runtime_error("Not enought size for an ARP header in the buffer.");
throw std::runtime_error("Not enough size for an ARP header in the buffer.");
memcpy(&_arp, buffer, sizeof(arphdr));
total_sz -= sizeof(arphdr);
if(total_sz)

View File

@@ -13,7 +13,7 @@ Tins::BootP::BootP() : PDU(255), _vend_size(64) {
Tins::BootP::BootP(const uint8_t *buffer, uint32_t total_sz, uint32_t vend_field_size) : PDU(255), _vend(0), _vend_size(vend_field_size) {
if(total_sz < sizeof(bootphdr) + vend_field_size)
throw std::runtime_error("Not enought size for a BootP header in the buffer.");
throw std::runtime_error("Not enough size for a BootP header in the buffer.");
std::memcpy(&_bootp, buffer, sizeof(bootphdr));
buffer += sizeof(bootphdr);
total_sz -= sizeof(bootphdr);

View File

@@ -46,13 +46,13 @@ Tins::DHCP::DHCP(const uint8_t *buffer, uint32_t total_sz) : BootP(buffer, total
args[i] = *(buffer++);
total_sz--;
if(!total_sz)
throw std::runtime_error("Not enought size for a DHCP header in the buffer.");
throw std::runtime_error("Not enough size for a DHCP header in the buffer.");
}
// If the END-OF-OPTIONS was not found...
if(args[0] != END) {
// Not enough size for this option
if(total_sz < args[1])
throw std::runtime_error("Not enought size for a DHCP header in the buffer.");
throw std::runtime_error("Not enough size for a DHCP header in the buffer.");
add_option((Options)args[0], args[1], buffer);
buffer += args[1];
total_sz -= args[1];

View File

@@ -58,7 +58,7 @@ Tins::EthernetII::EthernetII(uint32_t iface_index, const uint8_t* dst_hw_addr, c
Tins::EthernetII::EthernetII(const uint8_t *buffer, uint32_t total_sz) : PDU(ETHERTYPE_IP) {
if(total_sz < sizeof(ethhdr))
throw std::runtime_error("Not enought size for an ethernetII header in the buffer.");
throw std::runtime_error("Not enough size for an ethernetII header in the buffer.");
memcpy(&_eth, buffer, sizeof(ethhdr));
PDU *next = 0;
switch(payload_type()) {

View File

@@ -50,7 +50,7 @@ Tins::ICMP::ICMP(Flags flag) : PDU(IPPROTO_ICMP) {
Tins::ICMP::ICMP(const uint8_t *buffer, uint32_t total_sz) : PDU(IPPROTO_ICMP) {
if(total_sz < sizeof(icmphdr))
throw std::runtime_error("Not enought size for an ICMP header in the buffer.");
throw std::runtime_error("Not enough size for an ICMP header in the buffer.");
std::memcpy(&_icmp, buffer, sizeof(icmphdr));
total_sz -= sizeof(icmphdr);
if(total_sz)

View File

@@ -48,7 +48,7 @@ Tins::IP::IP(const string &ip_dst, const string &ip_src, PDU *child) : PDU(IPPRO
Tins::IP::IP(const uint8_t *buffer, uint32_t total_sz) : PDU(IPPROTO_IP) {
if(total_sz < sizeof(iphdr))
throw std::runtime_error("Not enought size for an IP header in the buffer.");
throw std::runtime_error("Not enough size for an IP header in the buffer.");
std::memcpy(&_ip, buffer, sizeof(iphdr));
/* Options... */

View File

@@ -44,7 +44,7 @@ Tins::TCP::TCP(uint16_t dport, uint16_t sport) : PDU(IPPROTO_TCP), _options_size
Tins::TCP::TCP(const uint8_t *buffer, uint32_t total_sz) : PDU(IPPROTO_TCP) {
if(total_sz < sizeof(tcphdr))
throw std::runtime_error("Not enought size for an TCP header in the buffer.");
throw std::runtime_error("Not enough size for an TCP header in the buffer.");
std::memcpy(&_tcp, buffer, sizeof(tcphdr));
buffer += sizeof(tcphdr);

View File

@@ -39,7 +39,7 @@ Tins::UDP::UDP(uint16_t dport, uint16_t sport, PDU *child) : PDU(IPPROTO_UDP, ch
Tins::UDP::UDP(const uint8_t *buffer, uint32_t total_sz) : PDU(IPPROTO_UDP) {
if(total_sz < sizeof(udphdr))
throw std::runtime_error("Not enought size for an UDP header in the buffer.");
throw std::runtime_error("Not enough size for an UDP header in the buffer.");
std::memcpy(&_udp, buffer, sizeof(udphdr));
total_sz -= sizeof(udphdr);
if(total_sz)