uint8* dhcp_message::PrepareMessage(uint8 type) { uint8 *next = options; next = PutOption(next, OPTION_MESSAGE_TYPE, type); next = PutOption(next, OPTION_MESSAGE_SIZE, (uint16)htons(sizeof(dhcp_message))); return next; }
double Divided_Delta_Put(const double& T, const double& K, const double& sigma, const double& r, const double& q, const double& S, const double& h){ double Put_Plus = PutOption(T, K, sigma, r, q, S + h); double Put_Minus = PutOption(T, K, sigma, r, q, S - h); return (Put_Plus - Put_Minus) / (2 * h); }
double Divided_Rho_Put(const double& T, const double& K, const double& sigma, const double& r, const double& q, const double& S, const double& h){ double Put_Plus = PutOption(T, K, sigma, r + h, q, S); double Put_Minus = PutOption(T, K, sigma, r - h, q, S); return (Put_Plus - Put_Minus) / (2 * h); }
double Divided_Gamma_Put(const double& T, const double& K, const double& sigma, const double& r, const double& q, const double& S, const double& h){ double Put_Plus = PutOption(T, K, sigma, r, q, S + h); double Put_Minus = PutOption(T, K, sigma, r, q, S - h); return (Put_Plus - 2 * PutOption(T, K, sigma, r, q, S) + Put_Minus) / (h * h); }
uint8* dhcp_message::FinishOptions(uint8 *next) { return PutOption(next, OPTION_END); }
uint8* dhcp_message::PutOption(uint8* options, message_option option, uint32 data) { return PutOption(options, option, (uint8*)&data, sizeof(data)); }
uint8* dhcp_message::PutOption(uint8* options, message_option option, uint8 data) { return PutOption(options, option, &data, 1); }