2
Original copyright header listed below. This comes via rsync.
3
Any additional changes are provided via the same license as the original.
5
Copyright (C) 2011 Muhammad Umair
9
* Copyright (C) 1996-2001 Internet Software Consortium.
11
* Permission to use, copy, modify, and distribute this software for any
12
* purpose with or without fee is hereby granted, provided that the above
13
* copyright notice and this permission notice appear in all copies.
15
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
16
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
17
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
18
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
19
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
20
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
22
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27
#include <drizzled/field.h>
30
#include <drizzled/type/ipv6.h>
37
class IPv6:public Field {
38
const charset_info_st *field_charset;
41
IPv6(unsigned char *ptr_arg,
43
unsigned char *null_ptr_arg,
44
unsigned char null_bit_arg,
45
const char *field_name_arg);
47
enum_field_types type() const { return DRIZZLE_TYPE_IPV6; }
48
enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
49
bool zero_pack() const { return 0; }
50
int reset(void) { memset(ptr, 0, type::IPv6::LENGTH); return 0; }
51
uint32_t pack_length() const { return type::IPv6::LENGTH; }
52
uint32_t key_length() const { return type::IPv6::LENGTH; }
54
int store(const char *to,uint32_t length, const charset_info_st * const charset);
55
int store(int64_t nr, bool unsigned_val);
56
double val_real() const;
57
int64_t val_int() const;
58
String *val_str(String*,String *) const;
59
void sql_type(drizzled::String&) const;
60
int store_decimal(const drizzled::type::Decimal*);
62
Item_result result_type () const { return STRING_RESULT; }
63
int cmp(const unsigned char*, const unsigned char*);
64
void sort_string(unsigned char*, uint32_t);
65
uint32_t max_display_length() { return type::IPv6::IPV6_DISPLAY_LENGTH; }
67
int store(double ) { return 0; }
68
inline String *val_str(String *str) { return val_str(str, str); }
69
uint32_t size_of() const { return sizeof(*this); }
71
static size_t max_string_length()
73
return type::IPv6::LENGTH;
77
} /* namespace field */
78
} /* namespace drizzled */